Logo AND Algorithmique Numérique Distribuée

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