Add lots of tests for pack/unpack code, fix bugs found
[profile/ivi/jansson.git] / test / run-suites
1 #!/bin/sh
2
3 while [ -n "$1" ]; do
4     suite=$1
5     if [ -x $top_srcdir/test/suites/$suite/run ]; then
6         SUITES="$SUITES $suite"
7     else
8         echo "No such suite: $suite"
9         exit 1
10     fi
11     shift
12 done
13
14 if [ -z "$SUITES" ]; then
15     suitedirs=$top_srcdir/test/suites/*
16     for suitedir in $suitedirs; do
17         if [ -d $suitedir ]; then
18             SUITES="$SUITES `basename $suitedir`"
19         fi
20     done
21 fi
22
23 [ -z "$STOP" ] && STOP=0
24
25 export suites_srcdir=$top_srcdir/test/suites
26 export suites_builddir=suites
27 export scriptdir=$top_srcdir/test/scripts
28 export logdir=logs
29 export bindir=bin
30
31 passed=0
32 failed=0
33 for suite in $SUITES; do
34     echo "Suite: $suite"
35     if $suites_srcdir/$suite/run $suite; then
36         passed=$(($passed+1))
37     else
38         failed=$(($failed+1))
39         [ $STOP -eq 1 ] && break
40     fi
41 done
42
43 if [ $failed -gt 0 ]; then
44     echo "$failed of $((passed+failed)) test suites failed"
45     exit 1
46 else
47     echo "$passed test suites passed"
48     rm -rf $logdir
49 fi