Logo AND Algorithmique Numérique Distribuée

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