Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Yet another dataset regeneration (some machines need a loooong time to recompile SG)
[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   exenv="libtool --mode=execute valgrind --show-reachable=yes"
21 else
22   exenv=
23 fi
24
25 ##
26 ## Tests defintions
27 ##
28 xbt_TESTS=" xbt/ex_test@EXEEXT@;          \
29             xbt/log_usage@EXEEXT@;        \
30             xbt/dynar_int@EXEEXT@;        \
31               xbt/dynar_double@EXEEXT@;   \
32               xbt/dynar_string@EXEEXT@;   \
33             xbt/dict_usage@EXEEXT@;       \
34               xbt/dict_crash@EXEEXT@;     \
35               xbt/multidict_crash@EXEEXT@; \
36             xbt/config_usage@EXEEXT@;     \
37             xbt/heap_bench@EXEEXT@;"
38            
39 surf_TESTS="surf/maxmin_usage@EXEEXT@;                                        \
40             surf/maxmin_bench@EXEEXT@;                                        \
41             surf/trace_usage@EXEEXT@ --surf-path=@srcdir@/surf/;              \
42             surf/surf_usage@EXEEXT@  --surf-path=@srcdir@/surf/ platform.xml; \
43             surf/surf_usage2@EXEEXT@ --surf-path=@srcdir@/surf/ platform.xml;"
44
45 gras_TESTS="gras/trp_tcp_usage;      gras/trp_file_usage;                        \
46             gras/datadesc_usage@EXEEXT@;                                         \
47             gras/datadesc_usage@EXEEXT@ --read @srcdir@/gras/datadesc.little32;  \
48             gras/datadesc_usage@EXEEXT@ --read @srcdir@/gras/datadesc.little32_4;\
49             gras/datadesc_usage@EXEEXT@ --read @srcdir@/gras/datadesc.little64;  \
50             gras/datadesc_usage@EXEEXT@ --read @srcdir@/gras/datadesc.big32;     \
51             gras/datadesc_usage@EXEEXT@ --read @srcdir@/gras/datadesc.big32_8_4; \
52             gras/datadesc_usage@EXEEXT@ --read @srcdir@/gras/datadesc.big32_2;"     
53
54 # Data sets still to regenerate:
55 #
56 #           gras/datadesc_usage@EXEEXT@ --read @srcdir@/gras/datadesc.big32_4;   \
57 #           gras/datadesc_usage@EXEEXT@ --read @srcdir@/gras/datadesc.big64;"    
58
59 ##
60 ## Loop on all tests to run them
61 ##
62
63 # we split tests on ';' so that they can contain spaces (test=accumulator)
64 test=""
65
66 for testpart in $xbt_TESTS $gras_TESTS $surf_TESTS
67 do
68   test="$test $testpart"
69   if echo $test | grep ';' ; then
70     # end of test declaration found.
71   
72     # we must have a space after the ;
73     if echo $test | egrep ';[^ ]' ; then
74       echo "$0.in broken: you should add a space after each ';'"
75       exit 1
76     fi
77     
78     # Cleanup test declaration, run it.
79     test=`echo $test | sed 's/;//'`
80     
81     tests_nb=`expr $tests_nb + 1`
82     echo "#### Test $test"
83     if [ x@EXEEXT@ = x ] ; then
84       :
85     else
86       # overwrites "valgrind" as a value, but should be exclusive.
87       exenv=wine  
88     fi
89     exenvsave=$exenv    
90     if [ "x$test" = "xxbt/dict_crash@EXEEXT@" ] ; then 
91       if echo $exenv | grep valgrind >/dev/null ; then
92         exenv=
93       fi
94       $exenv ./$test --xbt-log="root.thres=info" 2>&1
95       retval=$?
96     else 
97       if [ x@EXEEXT@ != x ] && [ x$exenv = xwine ] ; then 
98         if echo ${test} | grep @EXEEXT@ >/dev/null ; then : ; else
99           exenv=""
100         fi
101       fi
102       $exenv ./$test --xbt-log="root.thres=info" 2>&1
103       retval=$?
104     fi
105     exenv=$exenvsave
106     if [ $retval != 0 ] ; then if [ $retval != 77 ]; then
107       echo "## failed" # . Rerun $test with full details."
108 #      if [ "x$test" = "xdict_crash" ] ; then
109 #      $exenv ./$test --xbt-log="root.thres=debug" 2>&1
110 #    else 
111 #      $exenv ./$test --xbt-log="root.thres=debug" 2>&1
112 #    fi
113       failed_nb=`expr $failed_nb + 1`
114       echo "  $test (returned $retval)" >> test.failed
115     else # retval == 77
116       echo "## Ignored since it returned 77"
117       ignored_nb=`expr $ignored_nb + 1`
118       echo "  $test" >> test.ignored
119     fi else
120       echo "## Success"
121       success_nb=`expr $success_nb + 1`
122       echo "  $test" >> test.success
123     fi
124     test=""
125   fi # end of ';' found in test declaration => run it
126 done
127
128 ###
129 ### Display summary
130 ###
131
132 echo
133 echo "#### Summary"
134 echo "$success_nb tests of $tests_nb successfull:"
135 cat test.success
136
137 if [ $ignored_nb != 0 ] ; then
138   echo "$failed_nb tests of $tests_nb ignored:"
139   cat test.ignored
140   echo "  (they returned 77, meaning that they are not applicable)"
141 fi
142 if [ $failed_nb != 0 ] ; then
143   echo "$failed_nb tests of $tests_nb failed: "
144   cat test.failed
145   echo "Rerun the tests using the following command: script -c 'make test' simgrid.tests.log"
146   echo " and send the following informations to simgrid-devel@lists.gforge.inria.fr:"
147   echo "   - the file simgrid.tests.log produced by this command."
148   echo "   - a short description of the target platform (arch, OS, distrib, compiler)."
149   echo "   - the config.log produced by the compilation."
150 fi
151
152 rm -f test.success test.failed test.ignored
153 exit $failed_nb