Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
A nice example on how to use MSG.
[simgrid.git] / testsuite / run_tests.in
1 #! @BASH@
2 failed_nb=0
3 success_nb=0
4 ignored_nb=0
5 tests_nb=0
6
7 rm -f test.failed test.success test.ignored
8
9 if [ xvalgrind = "x$1" ] ; then
10   valgrind="libtool --mode=execute valgrind --show-reachable=yes"
11 else
12   valgrind=
13 fi
14 for test in xbt/log_usage@EXEEXT@                                 \
15             xbt/dynar_int@EXEEXT@ xbt/dynar_double@EXEEXT@ xbt/dynar_string@EXEEXT@       \
16             xbt/dict_usage@EXEEXT@ xbt/dict_crash@EXEEXT@                         \
17             xbt/config_usage@EXEEXT@                                      \
18             xbt/heap_bench@EXEEXT@ \
19             \
20             gras/trp_tcp_usage      gras/trp_file_usage             \
21             gras/datadesc_usage@EXEEXT@                                     \
22             "gras/datadesc_usage@EXEEXT@ --read @top_srcdir@/testsuite/gras/datadesc.little32" \
23             "gras/datadesc_usage@EXEEXT@ --read @top_srcdir@/testsuite/gras/datadesc.little64" \
24             "gras/datadesc_usage@EXEEXT@ --read @top_srcdir@/testsuite/gras/datadesc.big32"    \
25             "gras/datadesc_usage@EXEEXT@ --read @top_srcdir@/testsuite/gras/datadesc.big64"    \
26             "gras/datadesc_usage@EXEEXT@ --read @top_srcdir@/testsuite/gras/datadesc.aix" \
27             "gras/datadesc_usage@EXEEXT@ --read @top_srcdir@/testsuite/gras/datadesc.win32" \
28             "gras/datadesc_usage@EXEEXT@ --read @top_srcdir@/testsuite/gras/datadesc.g5" \
29             \
30             surf/maxmin_usage@EXEEXT@       surf/maxmin_bench@EXEEXT@               \
31             "surf/trace_usage@EXEEXT@ --surf-path=@top_srcdir@/testsuite/surf/"                            \
32             "surf/surf_usage@EXEEXT@  --surf-path=@top_srcdir@/testsuite/surf/ platform.xml" \
33             "surf/surf_usage2@EXEEXT@ --surf-path=@top_srcdir@/testsuite/surf/ platform.xml" \
34             "msg/msg_test@EXEEXT@ --surf-path=@top_srcdir@/testsuite/msg/ platform.xml"
35 do                  
36   tests_nb=`expr $tests_nb + 1`
37   echo "#### Test $test"
38   if [ x@EXEEXT@ = x ] ; then 
39     wine=
40   else
41     wine=wine
42   fi
43   if [ "x$test" = "xdict_crash@EXEEXT@" ] ; then
44     $wine ./$test --gras-log="root.thres=info" 2>&1
45     retval=$?
46   else 
47     winesave=$wine
48     if [ x@EXEEXT@ != x ] ; then 
49       if echo ${test} | grep @EXEEXT@ >/dev/null ; then : ; else
50         echo "This is not a win32 binary, don't use wine"
51         wine=""
52       fi
53     fi
54       # if the user defines valgrind while cross-compiling, too bad
55       $wine $valgrind ./$test --gras-log="root.thres=info" 2>&1
56       retval=$?
57     wine=$winesave
58   fi
59   if [ $retval != 0 ] ; then if [ $retval != 77 ]; then
60     echo "## failed. Rerun $test with full details."
61 #    if [ "x$test" = "xdict_crash" ] ; then
62 #      $wine ./$test --gras-log="root.thres=debug" 2>&1
63 #    else 
64 #      $wine $valgrind ./$test --gras-log="root.thres=debug" 2>&1
65 #    fi
66     failed_nb=`expr $failed_nb + 1`
67     echo "  $test (returned $retval)" >> test.failed
68   else # retval == 77
69     echo "## Ignored since it returned 77"
70     ignored_nb=`expr $ignored_nb + 1`
71     echo "  $test" >> test.ignored
72   fi else
73     echo "## Success"
74     success_nb=`expr $success_nb + 1`
75     echo "  $test" >> test.success
76   fi
77 done
78
79
80 echo
81 echo "#### Summary"
82 echo "$success_nb tests of $tests_nb successfull:"
83 cat test.success
84
85 if [ $ignored_nb != 0 ] ; then
86   echo "$failed_nb tests of $tests_nb ignored:"
87   cat test.ignored
88   echo "  (they returned 77, meaning that they are not applicable)"
89 fi
90 if [ $failed_nb != 0 ] ; then
91   echo "$failed_nb tests of $tests_nb failed: "
92   cat test.failed
93   echo "Rerun the tests using the following command: script -c 'make test' gras.tests.log"
94   echo " and send the following informations to martin.quinson@ens-lyon.fr:"
95   echo "   - the file gras.tests.log produced by this command."
96   echo "   - a short description of the target platform (arch, OS, distrib, compiler)."
97   echo "   - the config.log produced by the compilation."
98 fi
99
100 rm -f test.success test.failed test.ignored
101 exit $failed_nb