Blame SOURCES/run-lit-tests

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