4 ## Cleanups of previous executions
11 rm -f test.failed test.success test.ignored
14 ## Args parsing (simplistic for now)
16 if [ xvalgrind = "x$1" ] ; then
17 valgrind="libtool --mode=execute valgrind --show-reachable=yes"
25 xbt_TESTS=" xbt/log_usage@EXEEXT@; \
26 xbt/dynar_int@EXEEXT@; \
27 xbt/dynar_double@EXEEXT@; \
28 xbt/dynar_string@EXEEXT@; \
29 xbt/dict_usage@EXEEXT@; \
30 xbt/dict_crash@EXEEXT@; \
31 xbt/config_usage@EXEEXT@; \
32 xbt/heap_bench@EXEEXT@;"
34 surf_TESTS="surf/maxmin_usage@EXEEXT@; \
35 surf/maxmin_bench@EXEEXT@; \
36 surf/trace_usage@EXEEXT@ --surf-path=@srcdir@/surf/; \
37 surf/surf_usage@EXEEXT@ --surf-path=@srcdir@/surf/ platform.xml; \
38 surf/surf_usage2@EXEEXT@ --surf-path=@srcdir@/surf/ platform.xml;"
40 msg_TESTS=" msg/msg_test@EXEEXT@ --surf-path=@top_srcdir@/examples/msg/;"
42 gras_TESTS="gras/trp_tcp_usage; gras/trp_file_usage; \
43 gras/datadesc_usage@EXEEXT@; \
46 gras_ignored="gras/datadesc_usage@EXEEXT@ --read @srcdir@/gras/datadesc.little32; \
47 gras/datadesc_usage@EXEEXT@ --read @srcdir@/gras/datadesc.little64; \
48 gras/datadesc_usage@EXEEXT@ --read @srcdir@/gras/datadesc.big32; \
49 gras/datadesc_usage@EXEEXT@ --read @srcdir@/gras/datadesc.big64; \
50 gras/datadesc_usage@EXEEXT@ --read @srcdir@/gras/datadesc.aix; \
51 gras/datadesc_usage@EXEEXT@ --read @srcdir@/gras/datadesc.win32; \
52 gras/datadesc_usage@EXEEXT@ --read @srcdir@/gras/datadesc.g5;" \
55 ## Loop on all tests to run them
58 # we split tests on ';' so that they can contain spaces (test=accumulator)
61 for testpart in $xbt_TESTS $msg_TESTS $gras_TESTS $surf_TESTS #
63 test="$test $testpart"
64 if echo $test | grep ';' ; then
65 # end of test declaration found.
67 # we must have a space after the ;
68 if echo $test | egrep ';[^ ]' ; then
69 echo "$0.in broken: you should add a space after each ';'"
73 # Cleanup test declaration, run it.
74 test=`echo $test | sed 's/;//'`
76 tests_nb=`expr $tests_nb + 1`
77 echo "#### Test $test"
78 if [ x@EXEEXT@ = x ] ; then
83 if [ "x$test" = "xdict_crash@EXEEXT@" ] ; then
84 $wine ./$test --xbt-log="root.thres=info" 2>&1
88 if [ x@EXEEXT@ != x ] ; then
89 if echo ${test} | grep @EXEEXT@ >/dev/null ; then : ; else
90 # echo "This is not a win32 binary, don't use wine"
94 # if the user defines valgrind while cross-compiling, too bad
95 $wine $valgrind ./$test --xbt-log="root.thres=info" 2>&1
99 if [ $retval != 0 ] ; then if [ $retval != 77 ]; then
100 echo "## failed" # . Rerun $test with full details."
101 # if [ "x$test" = "xdict_crash" ] ; then
102 # $wine ./$test --xbt-log="root.thres=debug" 2>&1
104 # $wine $valgrind ./$test --xbt-log="root.thres=debug" 2>&1
106 failed_nb=`expr $failed_nb + 1`
107 echo " $test (returned $retval)" >> test.failed
109 echo "## Ignored since it returned 77"
110 ignored_nb=`expr $ignored_nb + 1`
111 echo " $test" >> test.ignored
114 success_nb=`expr $success_nb + 1`
115 echo " $test" >> test.success
118 fi # end of ';' found in test declaration => run it
127 echo "$success_nb tests of $tests_nb successfull:"
130 if [ $ignored_nb != 0 ] ; then
131 echo "$failed_nb tests of $tests_nb ignored:"
133 echo " (they returned 77, meaning that they are not applicable)"
135 if [ $failed_nb != 0 ] ; then
136 echo "$failed_nb tests of $tests_nb failed: "
138 echo "Rerun the tests using the following command: script -c 'make test' simgrid.tests.log"
139 echo " and send the following informations to simgrid2-users@listes.ens-lyon.fr:"
140 echo " - the file simgrid.tests.log produced by this command."
141 echo " - a short description of the target platform (arch, OS, distrib, compiler)."
142 echo " - the config.log produced by the compilation."
145 rm -f test.success test.failed test.ignored