diff --git a/test-suite/runtest.sh b/test-suite/runtest.sh new file mode 100755 index 0000000..a9049ad --- /dev/null +++ b/test-suite/runtest.sh @@ -0,0 +1,62 @@ +#!/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." +} + +threads="1" +cc="clang" +cxx="clang++" +testsuite_dir="/usr/share/llvm-test-suite/" + +while [ $# -gt 0 ]; do + case $1 in + --threads) + shift + threads="$1" + ;; + --testsuite-dir) + shift + testsuire_dir="$1" + ;; + --compiler) + shift + compiler="$1" + case $compiler in + clang) + cc="clang" + cxx="clang++" + ;; + gcc) + cc="gcc" + cxx="g++" + ;; + *) + echo "unknown compiler: $1" + exit 1 + ;; + esac + ;; + * ) + echo "unknown option: $1" + echo "" + usage + exit 1 + ;; + esac + shift +done + +set -xe + +cd $(mktemp -d) + +cmake -G Ninja $testsuite_dir \ + -DCMAKE_C_COMPILER=$cc \ + -DCMAKE_CXX_COMPILER=$cxx \ + -DTEST_SUITE_LIT_FLAGS="-svj$threads" + +ninja -j $threads check diff --git a/tests.yml b/tests.yml new file mode 100644 index 0000000..215f671 --- /dev/null +++ b/tests.yml @@ -0,0 +1,10 @@ +- hosts: localhost + roles: + - role: standard-test-basic + tags: + - classic + required_packages: + - clang + - ninja-build + tests: + - test-suite