Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
enable the multidict_crash test, even if it's not perfect yet
[simgrid.git] / testsuite / run_tests.in
1 #! @BASH@
2
3 ##
4 ## Cleanups of previous executions
5 ##
6 failed_nb=0
7 success_nb=0
8 ignored_nb=0
9 tests_nb=0
10
11 rm -f test.failed test.success test.ignored
12
13 # Work around a libtool issue on solaris
14 export LD_LIBRARY_PATH=@top_srcdir@/src/.libs
15
16 ##
17 ## Args parsing (simplistic for now)
18 ##
19 if [ xvalgrind = "x$1" ] ; then
20   valgrind="libtool --mode=execute valgrind --show-reachable=yes"
21 else
22   valgrind=
23 fi
24
25 ##
26 ## Tests defintions
27 ##
28 xbt_TESTS=" xbt/log_usage@EXEEXT@;        \
29             xbt/dynar_int@EXEEXT@;        \
30               xbt/dynar_double@EXEEXT@;   \
31               xbt/dynar_string@EXEEXT@;   \
32             xbt/dict_usage@EXEEXT@;       \
33               xbt/dict_crash@EXEEXT@;     \
34               xbt/multdict_crash@EXEEXT@; \
35             xbt/config_usage@EXEEXT@;     \
36             xbt/heap_bench@EXEEXT@;"
37            
38 surf_TESTS="surf/maxmin_usage@EXEEXT@;                                        \
39             surf/maxmin_bench@EXEEXT@;                                        \
40             surf/trace_usage@EXEEXT@ --surf-path=@srcdir@/surf/;              \
41             surf/surf_usage@EXEEXT@  --surf-path=@srcdir@/surf/ platform.xml; \
42             surf/surf_usage2@EXEEXT@ --surf-path=@srcdir@/surf/ platform.xml;"
43
44 gras_TESTS="gras/trp_tcp_usage;      gras/trp_file_usage;                        \
45             gras/datadesc_usage@EXEEXT@;                                         \
46             gras/datadesc_usage@EXEEXT@ --read @srcdir@/gras/datadesc.little32;  \
47             gras/datadesc_usage@EXEEXT@ --read @srcdir@/gras/datadesc.little32_4;\
48             gras/datadesc_usage@EXEEXT@ --read @srcdir@/gras/datadesc.little64;  \
49             gras/datadesc_usage@EXEEXT@ --read @srcdir@/gras/datadesc.big32;     \
50             gras/datadesc_usage@EXEEXT@ --read @srcdir@/gras/datadesc.big32_8_4; \
51             gras/datadesc_usage@EXEEXT@ --read @srcdir@/gras/datadesc.big32_2;"     
52
53 # Data sets still to regenerate:
54 #
55 #           gras/datadesc_usage@EXEEXT@ --read @srcdir@/gras/datadesc.big32_4;   \
56 #           gras/datadesc_usage@EXEEXT@ --read @srcdir@/gras/datadesc.big64;"    
57
58 ##
59 ## Loop on all tests to run them
60 ##
61
62 # we split tests on ';' so that they can contain spaces (test=accumulator)
63 test=""
64
65 for testpart in $xbt_TESTS $gras_TESTS $surf_TESTS
66 do
67   test="$test $testpart"
68   if echo $test | grep ';' ; then
69     # end of test declaration found.
70   
71     # we must have a space after the ;
72     if echo $test | egrep ';[^ ]' ; then
73       echo "$0.in broken: you should add a space after each ';'"
74       exit 1
75     fi
76     
77     # Cleanup test declaration, run it.
78     test=`echo $test | sed 's/;//'`
79     
80     tests_nb=`expr $tests_nb + 1`
81     echo "#### Test $test"
82     if [ x@EXEEXT@ = x ] ; then 
83       wine=
84     else
85       wine=wine
86     fi
87     if [ "x$test" = "xdict_crash@EXEEXT@" ] ; then
88       $wine ./$test --xbt-log="root.thres=info" 2>&1
89       retval=$?
90     else 
91       winesave=$wine
92       if [ x@EXEEXT@ != x ] ; then 
93         if echo ${test} | grep @EXEEXT@ >/dev/null ; then : ; else
94 #         echo "This is not a win32 binary, don't use wine"
95           wine=""
96         fi
97       fi
98         # if the user defines valgrind while cross-compiling, too bad
99         $wine $valgrind ./$test --xbt-log="root.thres=info" 2>&1
100         retval=$?
101       wine=$winesave
102     fi
103     if [ $retval != 0 ] ; then if [ $retval != 77 ]; then
104       echo "## failed" # . Rerun $test with full details."
105 #      if [ "x$test" = "xdict_crash" ] ; then
106 #      $wine ./$test --xbt-log="root.thres=debug" 2>&1
107 #    else 
108 #      $wine $valgrind ./$test --xbt-log="root.thres=debug" 2>&1
109 #    fi
110       failed_nb=`expr $failed_nb + 1`
111       echo "  $test (returned $retval)" >> test.failed
112     else # retval == 77
113       echo "## Ignored since it returned 77"
114       ignored_nb=`expr $ignored_nb + 1`
115       echo "  $test" >> test.ignored
116     fi else
117       echo "## Success"
118       success_nb=`expr $success_nb + 1`
119       echo "  $test" >> test.success
120     fi
121     test=""
122   fi # end of ';' found in test declaration => run it
123 done
124
125 ###
126 ### Display summary
127 ###
128
129 echo
130 echo "#### Summary"
131 echo "$success_nb tests of $tests_nb successfull:"
132 cat test.success
133
134 if [ $ignored_nb != 0 ] ; then
135   echo "$failed_nb tests of $tests_nb ignored:"
136   cat test.ignored
137   echo "  (they returned 77, meaning that they are not applicable)"
138 fi
139 if [ $failed_nb != 0 ] ; then
140   echo "$failed_nb tests of $tests_nb failed: "
141   cat test.failed
142   echo "Rerun the tests using the following command: script -c 'make test' simgrid.tests.log"
143   echo " and send the following informations to simgrid-devel@lists.gforge.inria.fr:"
144   echo "   - the file simgrid.tests.log produced by this command."
145   echo "   - a short description of the target platform (arch, OS, distrib, compiler)."
146   echo "   - the config.log produced by the compilation."
147 fi
148
149 rm -f test.success test.failed test.ignored
150 exit $failed_nb