Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Rename GROS to XBT, thanks Arnaud ;)
[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"
11 else
12   valgrind=
13 fi
14 for test in xbt/log_usage                                          \
15             xbt/dynar_int xbt/dynar_double xbt/dynar_string      \
16             xbt/dict_usage xbt/dict_crash                         \
17             xbt/config_usage                                       \
18             \
19             gras/trp_tcp_usage      gras/trp_file_usage             \
20             gras/datadesc_usage                                     
21 #           "gras/datadesc_usage --read @srcdir@/datadesc.little32" \
22 #           "gras/datadesc_usage --read @srcdir@/datadesc.big32"    \
23 #           "gras/datadesc_usage --read @srcdir@/datadesc.big64" 
24
25 #           "gras/datadesc_usage --read @srcdir@/datadesc.little64" \
26 do                  
27   tests_nb=`expr $tests_nb + 1`
28   echo "#### Test $test"
29   if [ "x$test" = "xdict_crash" ] ; then
30     ./$test --gras-log="root.thres=info" 2>&1
31   else 
32     $valgrind ./$test --gras-log="root.thres=info" 2>&1
33   fi
34   retval=$?
35   if [ $retval != 0 ] ; then if [ $retval != 77 ]; then
36     echo "## failed. Rerun $test with full details."
37     if [ "x$test" = "xdict_crash" ] ; then
38       ./$test --gras-log="root.thres=debug" 2>&1
39     else 
40       $valgrind ./$test --gras-log="root.thres=debug" 2>&1
41     fi
42     failed_nb=`expr $failed_nb + 1`
43     echo "  $test (returned $retval)" >> test.failed
44   else # retval == 77
45     echo "## Ignored since it returned 77"
46     ignored_nb=`expr $ignored_nb + 1`
47     echo "  $test" >> test.ignored
48   fi else
49     echo "## Success"
50     success_nb=`expr $success_nb + 1`
51     echo "  $test" >> test.success
52   fi
53 done
54
55
56 echo
57 echo "#### Summary"
58 echo "$success_nb tests of $tests_nb successfull:"
59 cat test.success
60
61 if [ $ignored_nb != 0 ] ; then
62   echo "$failed_nb tests of $tests_nb ignored:"
63   cat test.ignored
64   echo "  (they returned 77, meaning that they are not applicable)"
65 fi
66 if [ $failed_nb != 0 ] ; then
67   echo "$failed_nb tests of $tests_nb failed: "
68   cat test.failed
69   echo "Rerun the tests using the following command: script -c 'make test' gras.tests.log"
70   echo " and send the following informations to martin.quinson@ens-lyon.fr:"
71   echo "   - the file gras.tests.log produced by this command."
72   echo "   - a short description of the target platform (arch, OS, distrib, compiler)."
73   echo "   - the config.log produced by the compilation."
74 fi
75
76 rm -f test.success test.failed test.ignored
77 exit $failed_nb