Renato Golin | 94cc104 | 2016-04-26 11:02:23 +0100 | [diff] [blame] | 1 | #!/usr/bin/env bash |
| 2 | |
| 3 | # This script calls the run.sh in the test-suite (see the test-suite dir) |
| 4 | # and bails if the tests fail, giving enough to run.sh to mark that commit |
| 5 | # as BAD and bail. |
| 6 | |
| 7 | if [[ $1 = '' ]]; then |
| 8 | echo "Syntax: $0 <full-test-name>" |
| 9 | exit 1 |
| 10 | fi |
| 11 | testname=$1 |
| 12 | if [ ! -d test ]; then |
| 13 | echo "Missing test directory" |
| 14 | exit 1 |
| 15 | fi |
| 16 | if [ ! -f test/run.sh ]; then |
| 17 | echo "Missing test script" |
| 18 | exit 1 |
| 19 | fi |
| 20 | |
| 21 | # Check which build was built last |
| 22 | build_dir=build |
| 23 | if [ build2/bin/clang -nt build/bin/clang ]; then |
| 24 | build_dir=build2 |
| 25 | fi |
| 26 | |
| 27 | # Update install dir |
| 28 | rm -f install |
| 29 | ln -s $build_dir install |
| 30 | |
| 31 | # Run the test |
| 32 | cd test |
| 33 | ./run.sh -t $testname |
| 34 | result=$? |
| 35 | cd .. |
| 36 | |
| 37 | if [[ $result != 0 ]]; then |
| 38 | exit 1 |
| 39 | fi |