Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
e317166427d4d22e9d6c61591877d4bcf9a7471f
[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             \
29             surf/maxmin_usage@EXEEXT@       surf/maxmin_bench@EXEEXT@               \
30             surf/trace_usage@EXEEXT@                                        \
31             surf/surf_usage@EXEEXT@                                         
32 do                  
33   tests_nb=`expr $tests_nb + 1`
34   echo "#### Test $test"
35   dir=`echo $test |sed 's|\([^/]*\)/\(.*\)|\1|'`
36   cmd=`echo $test |sed 's|\([^/]*\)/\(.*\)|\2|'`
37   if [ x@EXEEXT@ = x ] ; then 
38     wine=
39   else
40     wine=wine
41   fi
42   if [ "x$test" = "xdict_crash@EXEEXT@" ] ; then
43     cd $dir
44     $wine ./$cmd --gras-log="root.thres=info" 2>&1
45     retval=$?
46     cd ..
47   else 
48     cd $dir
49     winesave=$wine
50     if [ x@EXEEXT@ != x ] ; then 
51       if echo ${cmd} | 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 ./$cmd --gras-log="root.thres=info" 2>&1
58       retval=$?
59     wine=$winesave
60     cd ..
61   fi
62   if [ $retval != 0 ] ; then if [ $retval != 77 ]; then
63     echo "## failed. Rerun $test with full details."
64 #    if [ "x$test" = "xdict_crash" ] ; then
65 #      cd $dir
66 #      $wine ./$cmd --gras-log="root.thres=debug" 2>&1
67 #      cd ..
68 #    else 
69 #      cd $dir
70 #      $wine $valgrind ./$cmd --gras-log="root.thres=debug" 2>&1
71 #      cd ..
72 #    fi
73     failed_nb=`expr $failed_nb + 1`
74     echo "  $test (returned $retval)" >> test.failed
75   else # retval == 77
76     echo "## Ignored since it returned 77"
77     ignored_nb=`expr $ignored_nb + 1`
78     echo "  $test" >> test.ignored
79   fi else
80     echo "## Success"
81     success_nb=`expr $success_nb + 1`
82     echo "  $test" >> test.success
83   fi
84 done
85
86
87 echo
88 echo "#### Summary"
89 echo "$success_nb tests of $tests_nb successfull:"
90 cat test.success
91
92 if [ $ignored_nb != 0 ] ; then
93   echo "$failed_nb tests of $tests_nb ignored:"
94   cat test.ignored
95   echo "  (they returned 77, meaning that they are not applicable)"
96 fi
97 if [ $failed_nb != 0 ] ; then
98   echo "$failed_nb tests of $tests_nb failed: "
99   cat test.failed
100   echo "Rerun the tests using the following command: script -c 'make test' gras.tests.log"
101   echo " and send the following informations to martin.quinson@ens-lyon.fr:"
102   echo "   - the file gras.tests.log produced by this command."
103   echo "   - a short description of the target platform (arch, OS, distrib, compiler)."
104   echo "   - the config.log produced by the compilation."
105 fi
106
107 rm -f test.success test.failed test.ignored
108 exit $failed_nb