| #!/usr/bin/env bash |
| |
| # This script calls the run.sh in the test-suite (see the test-suite dir) |
| # and bails if the tests fail, giving enough to run.sh to mark that commit |
| # as BAD and bail. |
| |
| if [[ $1 = '' ]]; then |
| echo "Syntax: $0 <full-test-name>" |
| exit 1 |
| fi |
| testname=$1 |
| if [ ! -d test ]; then |
| echo "Missing test directory" |
| exit 1 |
| fi |
| if [ ! -f test/run.sh ]; then |
| echo "Missing test script" |
| exit 1 |
| fi |
| |
| # Check which build was built last |
| build_dir=build |
| if [ build2/bin/clang -nt build/bin/clang ]; then |
| build_dir=build2 |
| fi |
| |
| # Update install dir |
| rm -f install |
| ln -s $build_dir install |
| |
| # Run the test |
| cd test |
| ./run.sh -t $testname |
| result=$? |
| cd .. |
| |
| if [[ $result != 0 ]]; then |
| exit 1 |
| fi |