Logo AND Algorithmique Numérique Distribuée

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