~ubuntu-branches/ubuntu/vivid/nip2/vivid-proposed

« back to all changes in this revision

Viewing changes to test/test_all.sh.in

  • Committer: Bazaar Package Importer
  • Author(s): Jay Berkenbilt
  • Date: 2010-12-27 14:53:08 UTC
  • mfrom: (2.1.12 sid)
  • Revision ID: james.westby@ubuntu.com-20101227145308-vampjbuuft281j3l
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/bin/sh
2
2
 
 
3
result=0
 
4
 
 
5
test_result() {
 
6
        if [ $? = 0 ]; then
 
7
                echo ok
 
8
        else
 
9
                echo failed
 
10
                result=1
 
11
        fi
 
12
}
 
13
 
3
14
# run the test workspaces
4
 
for i in @TOP_SRCDIR@/test/workspaces/*; do
5
 
        echo -n "testing `basename $i` ... "
6
 
        if ! @TOP_SRCDIR@/src/nip2 --prefix=@TOP_SRCDIR@ --test $i ; then
7
 
                echo failed
8
 
        else
9
 
                echo ok
10
 
        fi
11
 
done
 
15
test_workspaces() {
 
16
        for i in @TOP_SRCDIR@/test/workspaces/*; do
 
17
                echo -n "testing `basename $i` ... "
 
18
                @TOP_SRCDIR@/src/nip2 --prefix=@TOP_SRCDIR@ --test $i
 
19
                test_result
 
20
        done
 
21
}
12
22
 
13
23
# load all the example workspaces too
14
 
for i in @TOP_SRCDIR@/share/nip2/data/examples/*/*.ws; do
15
 
        # have to skip these two, they use a non-free plugin
16
 
        if test x"`basename $i`" = x"framing.ws" ; then
17
 
                continue
18
 
        fi
19
 
        if test x"`basename $i`" = x"registering.ws" ; then
20
 
                continue
21
 
        fi
22
 
 
23
 
        echo -n "testing `basename $i` ... "
24
 
 
25
 
        if ! @TOP_SRCDIR@/src/nip2 --prefix=@TOP_SRCDIR@ --test $i ; then
26
 
                echo failed
27
 
        else
28
 
                echo ok
29
 
        fi
30
 
done
 
24
test_examples() {
 
25
        for i in @TOP_SRCDIR@/share/nip2/data/examples/*/*.ws; do
 
26
                # have to skip these two, they use a non-free plugin
 
27
                if test x"`basename $i`" = x"framing.ws" ; then
 
28
                        continue
 
29
                fi
 
30
                if test x"`basename $i`" = x"registering.ws" ; then
 
31
                        continue
 
32
                fi
 
33
 
 
34
                echo -n "testing `basename $i` ... "
 
35
                @TOP_SRCDIR@/src/nip2 --prefix=@TOP_SRCDIR@ --test $i 
 
36
                test_result
 
37
        done
 
38
}
31
39
 
32
40
# run all the test scripts in scripts/, passing in @TOP_SRCDIR@ so they can
33
41
# find stuff
34
42
 
35
43
# these scripts put temp files here, we remove the dir on exit
36
 
mkdir -p tmp
37
 
 
38
 
for i in @TOP_SRCDIR@/test/scripts/*.sh; do
39
 
        echo "running `basename $i`:"
40
 
        if ! $i @TOP_SRCDIR@ ; then
41
 
                echo "++ `basename $i` failed"
42
 
        fi
43
 
done
44
 
 
45
 
rm -rf tmp
 
44
test_scripts() {
 
45
        mkdir -p tmp
 
46
 
 
47
        for i in @TOP_SRCDIR@/test/scripts/*.sh; do
 
48
                echo "running `basename $i`:"
 
49
                $i @TOP_SRCDIR@ 
 
50
                test_result
 
51
        done
 
52
 
 
53
        rm -rf tmp
 
54
}
 
55
 
 
56
test_workspaces
 
57
test_examples
 
58
test_scripts
 
59
 
 
60
echo "repeating tests with the vectorising system disabled"
 
61
 
 
62
export NO_VECTOR=1
 
63
test_workspaces
 
64
test_examples
 
65
test_scripts
 
66
 
 
67
exit $result