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@; \
44 gras/datadesc_usage@EXEEXT@ --read @srcdir@/gras/datadesc.little32; \
45 gras/datadesc_usage@EXEEXT@ --read @srcdir@/gras/datadesc.little64; \
46 gras/datadesc_usage@EXEEXT@ --read @srcdir@/gras/datadesc.big32; \
47 gras/datadesc_usage@EXEEXT@ --read @srcdir@/gras/datadesc.big64; \
48 gras/datadesc_usage@EXEEXT@ --read @srcdir@/gras/datadesc.aix; \
49 gras/datadesc_usage@EXEEXT@ --read @srcdir@/gras/datadesc.win32; \
50 gras/datadesc_usage@EXEEXT@ --read @srcdir@/gras/datadesc.g5;" \
53 ## Loop on all tests to run them
56 # we split tests on ';' so that they can contain spaces (test=accumulator)
59 for testpart in $xbt_TESTS $msg_TESTS $gras_TESTS $surf_TESTS
61 test="$test $testpart"
62 if echo $test | grep ';' ; then
63 # end of test declaration found.
65 # we must have a space after the ;
66 if echo $test | egrep ';[^ ]' ; then
67 echo "$0.in broken: you should add a space after each ';'"
71 # Cleanup test declaration, run it.
72 test=`echo $test | sed 's/;//'`
74 tests_nb=`expr $tests_nb + 1`
75 echo "#### Test $test"
76 if [ x@EXEEXT@ = x ] ; then
81 if [ "x$test" = "xdict_crash@EXEEXT@" ] ; then
82 $wine ./$test --xbt-log="root.thres=info" 2>&1
86 if [ x@EXEEXT@ != x ] ; then
87 if echo ${test} | grep @EXEEXT@ >/dev/null ; then : ; else
88 # echo "This is not a win32 binary, don't use wine"
92 # if the user defines valgrind while cross-compiling, too bad
93 $wine $valgrind ./$test --xbt-log="root.thres=info" 2>&1
97 if [ $retval != 0 ] ; then if [ $retval != 77 ]; then
98 echo "## failed" # . Rerun $test with full details."
99 # if [ "x$test" = "xdict_crash" ] ; then
100 # $wine ./$test --xbt-log="root.thres=debug" 2>&1
102 # $wine $valgrind ./$test --xbt-log="root.thres=debug" 2>&1
104 failed_nb=`expr $failed_nb + 1`
105 echo " $test (returned $retval)" >> test.failed
107 echo "## Ignored since it returned 77"
108 ignored_nb=`expr $ignored_nb + 1`
109 echo " $test" >> test.ignored
112 success_nb=`expr $success_nb + 1`
113 echo " $test" >> test.success
116 fi # end of ';' found in test declaration => run it
125 echo "$success_nb tests of $tests_nb successfull:"
128 if [ $ignored_nb != 0 ] ; then
129 echo "$failed_nb tests of $tests_nb ignored:"
131 echo " (they returned 77, meaning that they are not applicable)"
133 if [ $failed_nb != 0 ] ; then
134 echo "$failed_nb tests of $tests_nb failed: "
136 echo "Rerun the tests using the following command: script -c 'make test' simgrid.tests.log"
137 echo " and send the following informations to simgrid2-users@listes.ens-lyon.fr:"
138 echo " - the file simgrid.tests.log produced by this command."
139 echo " - a short description of the target platform (arch, OS, distrib, compiler)."
140 echo " - the config.log produced by the compilation."
143 rm -f test.success test.failed test.ignored