Routino SVN Repository Browser

Check out the latest version of Routino: svn co http://routino.org/svn/trunk routino

ViewVC logotype

Contents of /trunk/src/test/run-tests.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1907 - (show annotations) (download) (as text)
Sat Mar 25 13:04:53 2017 UTC (8 years ago) by amb
File MIME type: text/x-sh
File size: 1824 byte(s)
Change the test scripts to make it easier to enable and disable the
use of valgrind for all tests.

1 #!/bin/sh
2
3 # Run with a debugger or not?
4
5 debugger=valgrind
6 debugger=
7
8 # Overall status
9
10 status=true
11
12 # Functions for running tests
13
14 run_a_test ()
15 {
16 script=$1
17 shift
18
19 if ./$script $@ ; then
20 echo "... passed"
21 else
22 echo "... FAILED"
23 status=false
24 fi
25 }
26
27 compare_results ()
28 {
29 if diff -q -r $1 $2; then
30 echo "... matched"
31 else
32 echo "... match FAILED"
33 status=false
34 fi
35 }
36
37
38 # Initial informational message
39
40 echo ""
41 ./is-fast-math message
42
43
44 # Loop round the different test types
45
46 TEST_DEBUGGER=$debugger
47 export TEST_DEBUGGER
48
49 for type in 1 2 3; do
50
51 case $type in
52 1)
53 suffix=""
54 arg=""
55 description=""
56 ;;
57 2)
58 suffix="+lib"
59 arg="lib"
60 description="libroutino"
61 ;;
62 3)
63 suffix="-pruned"
64 arg="prune"
65 description="pruned"
66 ;;
67 esac
68
69 # Normal mode
70
71 for script in $@; do
72 echo ""
73 echo "Testing: $script (non-slim, $description) ... "
74 run_a_test $script fat $arg
75 done
76
77 # Normal mode
78
79 for script in $@; do
80 echo ""
81 echo "Testing: $script (slim, $description) ... "
82 run_a_test $script slim $arg
83 done
84
85 # Check results
86
87 if $status; then
88 echo "Success: all tests passed"
89 else
90 echo "Warning: Some tests FAILED"
91 exit 1
92 fi
93
94 # Compare normal/slim results
95
96 echo ""
97
98 echo "Comparing: slim and non-slim results ($description) ... "
99
100 compare_results fat$suffix slim$suffix
101
102 # Check comparison
103
104 if $status; then
105 echo "Success: slim and non-slim results match"
106 else
107 echo "Warning: slim and non-slim results are different"
108 exit 1
109 fi
110
111 done
112
113 exit 0

Properties

Name Value
svn:executable *