Logo AND Algorithmique Numérique Distribuée

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