Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
only display logs of failed tests
authormquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Fri, 30 Nov 2007 16:58:35 +0000 (16:58 +0000)
committermquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Fri, 30 Nov 2007 16:58:35 +0000 (16:58 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@5099 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/xbt/cunit.c

index 717b4e1..ab53a53 100644 (file)
@@ -308,12 +308,14 @@ static int xbt_test_suite_run(xbt_test_suite_t suite) {
                                          (test->failed?" FAIL":" PASS"))),
                  test->title, file, line);
          
                                          (test->failed?" FAIL":" PASS"))),
                  test->title, file, line);
          
-         xbt_dynar_foreach(test->logs,it_log,log) {
-           file = (log->file != NULL ? log->file : file);
-           line = (log->line != 0    ? log->line : line);
-           fprintf(stderr, "             %s:%d: %s\n", 
-                   file, line,log->text);
-           
+         if  ( (test->expected_failure && !test->failed) || (!test->expected_failure && test->failed) ) {
+            xbt_dynar_foreach(test->logs,it_log,log) {
+               file = (log->file != NULL ? log->file : file);
+               line = (log->line != 0    ? log->line : line);
+               fprintf(stderr, "             %s:%d: %s\n", 
+                       file, line,log->text);
+               
+            }
          }
        }
        fprintf(stderr, "    Summary: %d of %d tests failed",unit->test_failed, unit->nb_tests);
          }
        }
        fprintf(stderr, "    Summary: %d of %d tests failed",unit->test_failed, unit->nb_tests);