Logo AND Algorithmique Numérique Distribuée

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