Blame run-lit-tests

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