Logo AND Algorithmique Numérique Distribuée

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