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 gras_TESTS="gras/trp_tcp_usage; gras/trp_file_usage; \
44 gras/datadesc_usage@EXEEXT@; \
45 gras/datadesc_usage@EXEEXT@ --read @srcdir@/gras/datadesc.little32; \
46 gras/datadesc_usage@EXEEXT@ --read @srcdir@/gras/datadesc.little32_4;\
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.big32_8_4; \
50 gras/datadesc_usage@EXEEXT@ --read @srcdir@/gras/datadesc.big32_2;"
52 # Data sets still to regenerate:
54 # gras/datadesc_usage@EXEEXT@ --read @srcdir@/gras/datadesc.big32_4; \
55 # gras/datadesc_usage@EXEEXT@ --read @srcdir@/gras/datadesc.big64;"
58 ## Loop on all tests to run them
61 # we split tests on ';' so that they can contain spaces (test=accumulator)
64 for testpart in $xbt_TESTS $gras_TESTS $surf_TESTS
66 test="$test $testpart"
67 if echo $test | grep ';' ; then
68 # end of test declaration found.
70 # we must have a space after the ;
71 if echo $test | egrep ';[^ ]' ; then
72 echo "$0.in broken: you should add a space after each ';'"
76 # Cleanup test declaration, run it.
77 test=`echo $test | sed 's/;//'`
79 tests_nb=`expr $tests_nb + 1`
80 echo "#### Test $test"
81 if [ x@EXEEXT@ = x ] ; then
86 if [ "x$test" = "xdict_crash@EXEEXT@" ] ; then
87 $wine ./$test --xbt-log="root.thres=info" 2>&1
91 if [ x@EXEEXT@ != x ] ; then
92 if echo ${test} | grep @EXEEXT@ >/dev/null ; then : ; else
93 # echo "This is not a win32 binary, don't use wine"
97 # if the user defines valgrind while cross-compiling, too bad
98 $wine $valgrind ./$test --xbt-log="root.thres=info" 2>&1
102 if [ $retval != 0 ] ; then if [ $retval != 77 ]; then
103 echo "## failed" # . Rerun $test with full details."
104 # if [ "x$test" = "xdict_crash" ] ; then
105 # $wine ./$test --xbt-log="root.thres=debug" 2>&1
107 # $wine $valgrind ./$test --xbt-log="root.thres=debug" 2>&1
109 failed_nb=`expr $failed_nb + 1`
110 echo " $test (returned $retval)" >> test.failed
112 echo "## Ignored since it returned 77"
113 ignored_nb=`expr $ignored_nb + 1`
114 echo " $test" >> test.ignored
117 success_nb=`expr $success_nb + 1`
118 echo " $test" >> test.success
121 fi # end of ';' found in test declaration => run it
130 echo "$success_nb tests of $tests_nb successfull:"
133 if [ $ignored_nb != 0 ] ; then
134 echo "$failed_nb tests of $tests_nb ignored:"
136 echo " (they returned 77, meaning that they are not applicable)"
138 if [ $failed_nb != 0 ] ; then
139 echo "$failed_nb tests of $tests_nb failed: "
141 echo "Rerun the tests using the following command: script -c 'make test' simgrid.tests.log"
142 echo " and send the following informations to simgrid2-users@listes.ens-lyon.fr:"
143 echo " - the file simgrid.tests.log produced by this command."
144 echo " - a short description of the target platform (arch, OS, distrib, compiler)."
145 echo " - the config.log produced by the compilation."
148 rm -f test.success test.failed test.ignored