File: run_tests.sh

package info (click to toggle)
ctdb 1.12%2Bgit20120201-5
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 6,656 kB
  • sloc: ansic: 61,736; sh: 18,367; xml: 3,887; python: 1,220; makefile: 554; perl: 319; awk: 118
file content (40 lines) | stat: -rwxr-xr-x 723 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/sh

# Eventscript unit test harness.

cd $(dirname "$0")
export EVENTSCRIPTS_TESTS_DIR=$(pwd)

test_dir=$(dirname "$EVENTSCRIPTS_TESTS_DIR")

opts="-d"

for i ; do
    case "$i" in
	-v)
	    export EVENTSCRIPT_TESTS_VERBOSE="yes"
	    shift
	    ;;
	-T)
	    # This will cause tests to fail but is good for debugging
	    # individual tests when they fail.
	    export EVENTSCRIPTS_TESTS_TRACE="sh -x"
	    shift
	    ;;
	-*)
	    opts="$opts $i"
	    shift
	    ;;
	*)
	    break
    esac
done

tests=""
if [ -z "$*" ] ; then
    tests=$(ls simple/[0-9][0-9].*.*.[0-9][0-9][0-9].sh simple/[0-9][0-9].*.*.[0-9][0-9][0-9]/run_test.sh 2>/dev/null)
fi

"$test_dir/scripts/run_tests" $opts "$@" $tests || exit 1

exit 0