Blame SOURCES/run-lit-tests

c8621d
#!/bin/bash
c8621d
c8621d
usage() {
c8621d
    echo "usage: `basename $0` [OPTIONS]"
c8621d
    echo "  --threads NUM         The number of threads to use for running tests."
c8621d
    echo "  --multilib-arch ARCH  Use this option to test 32-bit libs/binaries on"
c8621d
    echo "                        64-bit hosts."
c8621d
}
c8621d
c8621d
threads_arg=''
c8621d
c8621d
while [ $# -gt 0 ]; do
c8621d
    case $1 in
c8621d
        --threads)
c8621d
            shift
c8621d
            threads_arg="--threads $1"
c8621d
            ;;
c8621d
	--multilib-arch)
c8621d
            shift
c8621d
	    ARCH=$1
c8621d
	    ;;
c8621d
        * )
c8621d
            echo "unknown option: $1"
c8621d
            echo ""
c8621d
            usage
c8621d
            exit 1
c8621d
            ;;
c8621d
    esac
c8621d
    shift
c8621d
done
c8621d
c8621d
set -xe
c8621d
c8621d
if [ -z "$ARCH" ]; then
c8621d
    ARCH=`rpm --eval '%_arch'`
c8621d
fi
c8621d
c8621d
case $ARCH in
c8621d
    arm)
c8621d
	;&
c8621d
    i686)
c8621d
        LIB_DIR="/usr/lib/"
c8621d
        ;;
c8621d
    *)
c8621d
        LIB_DIR="/usr/lib64/"
c8621d
        ;;
c8621d
esac
c8621d
c8621d
cd $(mktemp -d)
c8621d
ln -s /usr/include include
c8621d
tar -xzf /usr/share/llvm/src/test.tar.gz
c746b4
ln -s /usr/share/llvm/src/$ARCH.site.cfg.py test/lit.site.cfg.py
c746b4
ln -s /usr/share/llvm/src/$ARCH.Unit.site.cfg.py test/Unit/lit.site.cfg.py
08f1e7
ln -s /usr/share/llvm/src/docs docs
08f1e7
lit -v $threads_arg test \
c8621d
	-Dllvm_obj_root=`pwd` \
c8621d
	-Dllvm_test_root=`pwd`/test \
c8621d
	-Dllvm_unittest_bindir=$LIB_DIR/llvm \
c8621d
	-Dllvm_shlib_dir=$LIB_DIR