Blob Blame History Raw
#!/bin/bash

usage() {
    echo "usage `basename $0` [OPTIONS]"
    echo "  --threads NUM       The number of threads to use for running tests."
    echo "  --testsuite-dir DIR Directory containing the test-suite source."
    echo "  --compiler [gcc|clang] The compiler to test."
}

testsuite_dir="/usr/share/llvm-test-suite/"
compiler="clang"
thread_args=""

while [ $# -gt 0 ]; do
    case $1 in
        --threads)
            shift
            threads="$1"
            ;;
        --testsuite-dir)
            shift
            testsuire_dir="$1"
            ;;
        --compiler)
            shift
            compiler="$1"
            ;;
        * )
            echo "unknown option: $1"
            echo ""
            usage
            exit 1
            ;;
    esac
    shift
done

if [ -n "$threads" ]; then
  thread_args="-j$threads"
fi

set -xe

cd $(mktemp -d)
#using hard links is easier on the fs
cp -al $testsuite_dir/ABI-Testsuite .
cd ABI-Testsuite
python3 linux-x86.py $compiler test -v $thread_args