Blame SOURCES/run-lit-tests

f79958
#!/bin/bash
f79958
f79958
usage() {
f79958
    cat << EOF
f79958
usage: `basename $0` [OPTIONS]
f79958
  --threads NUM         The number of threads to use for running tests.
f79958
  --multilib-arch ARCH  Use this option to test 32-bit libs/binaries on
f79958
                        64-bit hosts.
f79958
EOF
f79958
}
f79958
f79958
threads_arg=''
f79958
f79958
while [ $# -gt 0 ]; do
f79958
    case $1 in
f79958
        --threads)
f79958
            shift
f79958
            threads_arg="--threads $1"
f79958
            ;;
f79958
        --multilib-arch)
f79958
            shift
f79958
            ARCH=$1
f79958
            ;;
f79958
        * )
f79958
            echo "unknown option: $1"
f79958
            echo ""
f79958
            usage
f79958
            exit 1
f79958
            ;;
f79958
    esac
f79958
    shift
f79958
done
f79958
f79958
if [ `whoami` = "root" ]; then
f79958
    echo "error: lld tests do not support running as root."
f79958
    exit 1
f79958
fi
f79958
f79958
set -xe
f79958
f79958
if [ -z "$ARCH" ]; then
f79958
    ARCH=`rpm --eval '%_arch'`
f79958
fi
f79958
f79958
case $ARCH in
f79958
    arm)
f79958
        ;&
f79958
    i686)
f79958
        LIB_DIR="/usr/lib/"
f79958
        ;;
f79958
    *)
f79958
        LIB_DIR="/usr/lib64/"
f79958
        ;;
f79958
esac
f79958
f79958
cd $(mktemp -d)
f79958
ln -s /usr/include include
f79958
tar -xzf /usr/share/lld/src/test.tar.gz
36eb0e
ln -s /usr/share/lld/src/$ARCH.site.cfg.py test/lit.site.cfg.py
36eb0e
ln -s /usr/share/lld/src/$ARCH.Unit.site.cfg.py test/Unit/lit.site.cfg.py
36eb0e
f79958
f79958
LD_LIBRARY_PATH=$LIB_DIR/lld:$LD_LIBRARY_PATH \
f79958
lit -v -s $threads_arg test \
f79958
        -Dlld_obj_root=`pwd` \
f79958
        -Dlld_test_root=`pwd`/test \
f79958
        -Dlld_unittest_bindir=$LIB_DIR/lld