Blame SOURCES/run-lit-tests

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