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
6c366f
ln -s /usr/share/llvm/src/$ARCH.site.cfg.py test/lit.site.cfg.py
6c366f
ln -s /usr/share/llvm/src/$ARCH.Unit.site.cfg.py test/Unit/lit.site.cfg.py
f07775
ln -s /usr/share/llvm/src/docs docs
f07775
lit -v $threads_arg test \
6c366f
	-Dllvm_obj_root=`pwd` \
fefa20
	-Dllvm_test_root=`pwd`/test \
fefa20
	-Dllvm_unittest_bindir=$LIB_DIR/llvm \
fefa20
	-Dllvm_shlib_dir=$LIB_DIR