4 ## Cleanups of previous executions
11 rm -f test.failed test.success test.ignored
13 # Work around a libtool issue on solaris, making sure that it works even on sh older than tcsh
14 LD_LIBRARY_PATH=@top_srcdir@/src/.libs
15 if export LD_LIBRARY_PATH ; then
18 setenv LD_LIBRARY_PATH @top_srcdir@/src/.libs
22 ## Args parsing (simplistic for now)
24 if [ xvalgrind = "x$1" ] ; then
25 exenv="libtool --mode=execute valgrind --show-reachable=yes"
34 xbt/log_usage@EXEEXT@; \
35 xbt/context_usage@EXEEXT@; \
36 xbt/graphxml_usage@EXEEXT@ @srcdir@/xbt/graph.xml; \
37 xbt/heap_bench@EXEEXT@;"
39 surf_TESTS="surf/lmm_usage@EXEEXT@; \
40 surf/maxmin_bench@EXEEXT@; \
41 surf/trace_usage@EXEEXT@ --surf-path=@srcdir@/surf/; \
42 surf/surf_usage@EXEEXT@ --surf-path=@srcdir@/surf/ platform.xml; \
43 surf/surf_usage2@EXEEXT@ --surf-path=@srcdir@/surf/ platform.xml;"
45 simdag_TESTS="simdag/sd_test --surf-path=@srcdir@/simdag @srcdir@/simdag/small_platform_variable.xml; \
46 simdag/sd_test @top_srcdir@/examples/msg/small_platform.xml; \
47 simdag/sd_test @top_srcdir@/examples/msg/msg_platform.xml; "
51 ## Loop on all tests to run them
54 # we split tests on ';' so that they can contain spaces (test=accumulator)
57 for testpart in $xbt_TESTS $surf_TESTS $simdag_TESTS
59 test="$test $testpart"
60 if echo $test | grep ';' >/dev/null ; then
61 # end of test declaration found.
63 # we must have a space after the ;
64 if echo $test | egrep ';[^ ]' ; then
65 echo "$0.in broken: you should add a space after each ';'"
69 # Cleanup test declaration, run it.
70 test=`echo $test | sed 's/;//'`
72 if [ ".$1" = .windump ] ; then
73 test=`echo $test | sed 's|/home.*testsuite/|//10.0.2.4/qemu/testsuite/|'`
74 test=`echo $test | sed 's|/|\\\\|g'`
75 echo "\\\\10.0.2.4\\qemu\\testsuite\\$test"
76 echo "@if errorlevel 1 echo ERRORERRORERRORERRORERRORERRORERRORERRORERRORERRORERRORERROR"
79 tests_nb=`expr $tests_nb + 1`
80 echo "#### Test $test"
81 if [ x@EXEEXT@ = x ] ; then
84 # overwrites "valgrind" as a value, but should be exclusive.
88 if [ "x$test" = "xxbt/dict_crash@EXEEXT@" ] ; then
89 if echo $exenv | grep valgrind >/dev/null ; then
92 $exenv ./$test --log="root.thres=info" 2>&1
95 if [ x@EXEEXT@ != x ] && [ x$exenv = xwine ] ; then
96 if echo ${test} | grep @EXEEXT@ >/dev/null ; then : ; else
100 $exenv ./$test --log="root.thres=info" 2>&1
104 if [ $retval != 0 ] ; then if [ $retval != 77 ]; then
105 echo "## failed" # . Rerun $test with full details."
106 # if [ "x$test" = "xdict_crash" ] ; then
107 # $exenv ./$test --log="root.thres=debug" 2>&1
109 # $exenv ./$test --log="root.thres=debug" 2>&1
111 failed_nb=`expr $failed_nb + 1`
112 echo " $test (returned $retval)" >> test.failed
114 echo "## Ignored since it returned 77"
115 ignored_nb=`expr $ignored_nb + 1`
116 echo " $test" >> test.ignored
119 success_nb=`expr $success_nb + 1`
120 echo " $test" >> test.success
123 fi # end of ';' found in test declaration => run it
124 fi # end of run it only if not in windump mode
130 if [ ".$1" = .windump ] ; then
137 echo "$success_nb tests of $tests_nb successfull:"
140 if [ $ignored_nb != 0 ] ; then
141 echo "$failed_nb tests of $tests_nb ignored:"
143 echo " (they returned 77, meaning that they are not applicable)"
145 if [ $failed_nb != 0 ] ; then
146 echo "$failed_nb tests of $tests_nb failed: "
148 echo "Rerun the tests using the following command: script -c 'make check' simgrid.tests.log"
149 echo " and send the following informations to simgrid-devel@lists.gforge.inria.fr:"
150 echo " - the file simgrid.tests.log produced by this command."
151 echo " - a short description of the target platform (arch, OS, distrib, compiler)."
152 echo " - the config.log produced by the compilation."
155 rm -f test.success test.failed test.ignored