Logo AND Algorithmique Numérique Distribuée

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