Blame SOURCES/run-lit-tests

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