4 ## Cleanups of previous executions
11 rm -f test.failed test.success test.ignored
13 # Work around a libtool issue on solaris
14 export LD_LIBRARY_PATH=@top_srcdir@/src/.libs
17 ## Args parsing (simplistic for now)
19 if [ xvalgrind = "x$1" ] ; then
20 valgrind="libtool --mode=execute valgrind --show-reachable=yes"
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/config_usage@EXEEXT@; \
35 xbt/heap_bench@EXEEXT@;"
37 surf_TESTS="surf/maxmin_usage@EXEEXT@; \
38 surf/maxmin_bench@EXEEXT@; \
39 surf/trace_usage@EXEEXT@ --surf-path=@srcdir@/surf/; \
40 surf/surf_usage@EXEEXT@ --surf-path=@srcdir@/surf/ platform.xml; \
41 surf/surf_usage2@EXEEXT@ --surf-path=@srcdir@/surf/ platform.xml;"
43 msg_TESTS=" msg/msg_test@EXEEXT@ --surf-path=@top_srcdir@/examples/msg/;"
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;"
52 # Data sets still to regenerate:
54 # gras/datadesc_usage@EXEEXT@ --read @srcdir@/gras/datadesc.big32_8_4; \
55 # gras/datadesc_usage@EXEEXT@ --read @srcdir@/gras/datadesc.big32_4; \
56 # gras/datadesc_usage@EXEEXT@ --read @srcdir@/gras/datadesc.big32_2; \
57 # gras/datadesc_usage@EXEEXT@ --read @srcdir@/gras/datadesc.big64;"
60 ## Loop on all tests to run them
63 # we split tests on ';' so that they can contain spaces (test=accumulator)
66 for testpart in $xbt_TESTS $msg_TESTS $gras_TESTS $surf_TESTS
68 test="$test $testpart"
69 if echo $test | grep ';' ; then
70 # end of test declaration found.
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 ';'"
78 # Cleanup test declaration, run it.
79 test=`echo $test | sed 's/;//'`
81 tests_nb=`expr $tests_nb + 1`
82 echo "#### Test $test"
83 if [ x@EXEEXT@ = x ] ; then
88 if [ "x$test" = "xdict_crash@EXEEXT@" ] ; then
89 $wine ./$test --xbt-log="root.thres=info" 2>&1
93 if [ x@EXEEXT@ != x ] ; then
94 if echo ${test} | grep @EXEEXT@ >/dev/null ; then : ; else
95 # echo "This is not a win32 binary, don't use wine"
99 # if the user defines valgrind while cross-compiling, too bad
100 $wine $valgrind ./$test --xbt-log="root.thres=info" 2>&1
104 if [ $retval != 0 ] ; then if [ $retval != 77 ]; then
105 echo "## failed" # . Rerun $test with full details."
106 # if [ "x$test" = "xdict_crash" ] ; then
107 # $wine ./$test --xbt-log="root.thres=debug" 2>&1
109 # $wine $valgrind ./$test --xbt-log="root.thres=debug" 2>&1
111 failed_nb=`expr $failed_nb + 1`
112 echo " $test (returned $retval)" >> test.failed
114 echo "## Ignored since it returned 77"
115 ignored_nb=`expr $ignored_nb + 1`
116 echo " $test" >> test.ignored
119 success_nb=`expr $success_nb + 1`
120 echo " $test" >> test.success
123 fi # end of ';' found in test declaration => run it
132 echo "$success_nb tests of $tests_nb successfull:"
135 if [ $ignored_nb != 0 ] ; then
136 echo "$failed_nb tests of $tests_nb ignored:"
138 echo " (they returned 77, meaning that they are not applicable)"
140 if [ $failed_nb != 0 ] ; then
141 echo "$failed_nb tests of $tests_nb failed: "
143 echo "Rerun the tests using the following command: script -c 'make test' simgrid.tests.log"
144 echo " and send the following informations to simgrid2-users@listes.ens-lyon.fr:"
145 echo " - the file simgrid.tests.log produced by this command."
146 echo " - a short description of the target platform (arch, OS, distrib, compiler)."
147 echo " - the config.log produced by the compilation."
150 rm -f test.success test.failed test.ignored