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/timer_usage@EXEEXT@; \
47 gras/datadesc_usage@EXEEXT@; \
48 gras/datadesc_usage@EXEEXT@ --read @srcdir@/gras/datadesc.little32; \
49 gras/datadesc_usage@EXEEXT@ --read @srcdir@/gras/datadesc.little32_4;\
50 gras/datadesc_usage@EXEEXT@ --read @srcdir@/gras/datadesc.little64; \
51 gras/datadesc_usage@EXEEXT@ --read @srcdir@/gras/datadesc.big32;"
53 # Data sets still to regenerate:
55 # gras/datadesc_usage@EXEEXT@ --read @srcdir@/gras/datadesc.big32_8_4; \
56 # gras/datadesc_usage@EXEEXT@ --read @srcdir@/gras/datadesc.big32_4; \
57 # gras/datadesc_usage@EXEEXT@ --read @srcdir@/gras/datadesc.big32_2; \
58 # gras/datadesc_usage@EXEEXT@ --read @srcdir@/gras/datadesc.big64;"
61 ## Loop on all tests to run them
64 # we split tests on ';' so that they can contain spaces (test=accumulator)
67 for testpart in $xbt_TESTS $msg_TESTS $gras_TESTS $surf_TESTS
69 test="$test $testpart"
70 if echo $test | grep ';' ; then
71 # end of test declaration found.
73 # we must have a space after the ;
74 if echo $test | egrep ';[^ ]' ; then
75 echo "$0.in broken: you should add a space after each ';'"
79 # Cleanup test declaration, run it.
80 test=`echo $test | sed 's/;//'`
82 tests_nb=`expr $tests_nb + 1`
83 echo "#### Test $test"
84 if [ x@EXEEXT@ = x ] ; then
89 if [ "x$test" = "xdict_crash@EXEEXT@" ] ; then
90 $wine ./$test --xbt-log="root.thres=info" 2>&1
94 if [ x@EXEEXT@ != x ] ; then
95 if echo ${test} | grep @EXEEXT@ >/dev/null ; then : ; else
96 # echo "This is not a win32 binary, don't use wine"
100 # if the user defines valgrind while cross-compiling, too bad
101 $wine $valgrind ./$test --xbt-log="root.thres=info" 2>&1
105 if [ $retval != 0 ] ; then if [ $retval != 77 ]; then
106 echo "## failed" # . Rerun $test with full details."
107 # if [ "x$test" = "xdict_crash" ] ; then
108 # $wine ./$test --xbt-log="root.thres=debug" 2>&1
110 # $wine $valgrind ./$test --xbt-log="root.thres=debug" 2>&1
112 failed_nb=`expr $failed_nb + 1`
113 echo " $test (returned $retval)" >> test.failed
115 echo "## Ignored since it returned 77"
116 ignored_nb=`expr $ignored_nb + 1`
117 echo " $test" >> test.ignored
120 success_nb=`expr $success_nb + 1`
121 echo " $test" >> test.success
124 fi # end of ';' found in test declaration => run it
133 echo "$success_nb tests of $tests_nb successfull:"
136 if [ $ignored_nb != 0 ] ; then
137 echo "$failed_nb tests of $tests_nb ignored:"
139 echo " (they returned 77, meaning that they are not applicable)"
141 if [ $failed_nb != 0 ] ; then
142 echo "$failed_nb tests of $tests_nb failed: "
144 echo "Rerun the tests using the following command: script -c 'make test' simgrid.tests.log"
145 echo " and send the following informations to simgrid2-users@listes.ens-lyon.fr:"
146 echo " - the file simgrid.tests.log produced by this command."
147 echo " - a short description of the target platform (arch, OS, distrib, compiler)."
148 echo " - the config.log produced by the compilation."
151 rm -f test.success test.failed test.ignored