blob: 5d7eb130e6aab5599ba800006f412ab392d3b73b [file] [log] [blame]
Renato Golin94cc1042016-04-26 11:02:23 +01001#!/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
7if [[ $1 = '' ]]; then
8 echo "Syntax: $0 <full-test-name>"
9 exit 1
10fi
11testname=$1
12if [ ! -d test ]; then
13 echo "Missing test directory"
14 exit 1
15fi
16if [ ! -f test/run.sh ]; then
17 echo "Missing test script"
18 exit 1
19fi
20
21# Check which build was built last
22build_dir=build
23if [ build2/bin/clang -nt build/bin/clang ]; then
24 build_dir=build2
25fi
26
27# Update install dir
28rm -f install
29ln -s $build_dir install
30
31# Run the test
32cd test
33./run.sh -t $testname
34result=$?
35cd ..
36
37if [[ $result != 0 ]]; then
38 exit 1
39fi