Blame SOURCES/run-lit-tests

ef93f8
#!/bin/bash
ef93f8
ef93f8
usage() {
ef93f8
    echo "usage: `basename $0` [OPTIONS]"
fefa20
    echo "  --threads NUM         The number of threads to use for running tests."
fefa20
    echo "  --multilib-arch ARCH  Use this option to test 32-bit libs/binaries on"
fefa20
    echo "                        64-bit hosts."
ef93f8
}
ef93f8
ef93f8
threads_arg=''
ef93f8
ef93f8
while [ $# -gt 0 ]; do
ef93f8
    case $1 in
ef93f8
        --threads)
ef93f8
            shift
ef93f8
            threads_arg="--threads $1"
ef93f8
            ;;
fefa20
	--multilib-arch)
fefa20
            shift
fefa20
	    ARCH=$1
fefa20
	    ;;
ef93f8
        * )
ef93f8
            echo "unknown option: $1"
ef93f8
            echo ""
ef93f8
            usage
ef93f8
            exit 1
ef93f8
            ;;
ef93f8
    esac
ef93f8
    shift
ef93f8
done
ef93f8
ef93f8
set -xe
ef93f8
fefa20
if [ -z "$ARCH" ]; then
fefa20
    ARCH=`rpm --eval '%_arch'`
fefa20
fi
fefa20
fefa20
case $ARCH in
fefa20
    arm)
fefa20
	;&
fefa20
    i686)
fefa20
        LIB_DIR="/usr/lib/"
fefa20
        ;;
fefa20
    *)
fefa20
        LIB_DIR="/usr/lib64/"
fefa20
        ;;
fefa20
esac
fefa20
ef93f8
cd $(mktemp -d)
ef93f8
ln -s /usr/include include
ef93f8
tar -xzf /usr/share/llvm/src/test.tar.gz
fefa20
ln -s $ARCH.site.cfg.py test/lit.site.cfg.py
fefa20
ln -s $ARCH.site.cfg.py test/Unit/lit.site.cfg.py
4fb979
4fb979
# llvm_obj_root is used to determine the directory the tests will run in.
4fb979
# test/MC/MachO/gen-dwarf.s fails if llvm_obj_root is a parent directory
4fb979
# of the source file.  To workaround this, we set llvm_obj_root to a
4fb979
# different directory than the one used to store the test sources.
4fb979
# This also matches better how tests are run from the llvm source tree.
fefa20
lit -v -s $threads_arg test \
4fb979
	-Dllvm_obj_root=$(mktemp -d) \
fefa20
	-Dllvm_test_root=`pwd`/test \
fefa20
	-Dllvm_unittest_bindir=$LIB_DIR/llvm \
fefa20
	-Dllvm_shlib_dir=$LIB_DIR