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=@top_srcdir@/testsuite/surf/; \
37 surf/surf_usage@EXEEXT@ --surf-path=@top_srcdir@/testsuite/surf/ platform.xml; \
38 surf/surf_usage2@EXEEXT@ --surf-path=@top_srcdir@/testsuite/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 @top_srcdir@/testsuite/gras/datadesc.little32; \
45 gras/datadesc_usage@EXEEXT@ --read @top_srcdir@/testsuite/gras/datadesc.little64; \
46 gras/datadesc_usage@EXEEXT@ --read @top_srcdir@/testsuite/gras/datadesc.big32; \
47 gras/datadesc_usage@EXEEXT@ --read @top_srcdir@/testsuite/gras/datadesc.big64; \
48 gras/datadesc_usage@EXEEXT@ --read @top_srcdir@/testsuite/gras/datadesc.aix; \
49 gras/datadesc_usage@EXEEXT@ --read @top_srcdir@/testsuite/gras/datadesc.win32; \
50 gras/datadesc_usage@EXEEXT@ --read @top_srcdir@/testsuite/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 $surf_TESTS $msg_TESTS
62 test="$test $testpart"
63 if echo $test | grep ';' ; then
64 # end of test declaration found.
66 # we must have a space after the ;
67 if echo $test | egrep ';[^ ]' ; then
68 echo "$0.in broken: you should add a space after each ';'"
72 # Cleanup test declaration, run it.
73 test=`echo $test | sed 's/;//'`
75 tests_nb=`expr $tests_nb + 1`
76 echo "#### Test $test"
77 if [ x@EXEEXT@ = x ] ; then
82 if [ "x$test" = "xdict_crash@EXEEXT@" ] ; then
83 $wine ./$test --xbt-log="root.thres=info" 2>&1
87 if [ x@EXEEXT@ != x ] ; then
88 if echo ${test} | grep @EXEEXT@ >/dev/null ; then : ; else
89 # echo "This is not a win32 binary, don't use wine"
93 # if the user defines valgrind while cross-compiling, too bad
94 $wine $valgrind ./$test --xbt-log="root.thres=info" 2>&1
98 if [ $retval != 0 ] ; then if [ $retval != 77 ]; then
99 echo "## failed" # . Rerun $test with full details."
100 # if [ "x$test" = "xdict_crash" ] ; then
101 # $wine ./$test --xbt-log="root.thres=debug" 2>&1
103 # $wine $valgrind ./$test --xbt-log="root.thres=debug" 2>&1
105 failed_nb=`expr $failed_nb + 1`
106 echo " $test (returned $retval)" >> test.failed
108 echo "## Ignored since it returned 77"
109 ignored_nb=`expr $ignored_nb + 1`
110 echo " $test" >> test.ignored
113 success_nb=`expr $success_nb + 1`
114 echo " $test" >> test.success
117 fi # end of ';' found in test declaration => run it
126 echo "$success_nb tests of $tests_nb successfull:"
129 if [ $ignored_nb != 0 ] ; then
130 echo "$failed_nb tests of $tests_nb ignored:"
132 echo " (they returned 77, meaning that they are not applicable)"
134 if [ $failed_nb != 0 ] ; then
135 echo "$failed_nb tests of $tests_nb failed: "
137 echo "Rerun the tests using the following command: script -c 'make test' simgrid.tests.log"
138 echo " and send the following informations to simgrid2-users@listes.ens-lyon.fr:"
139 echo " - the file simgrid.tests.log produced by this command."
140 echo " - a short description of the target platform (arch, OS, distrib, compiler)."
141 echo " - the config.log produced by the compilation."
144 rm -f test.success test.failed test.ignored