From c3f8997103629ced10eb0115bcbf771e5217ce9d Mon Sep 17 00:00:00 2001 From: mquinson Date: Fri, 30 Nov 2007 16:58:35 +0000 Subject: [PATCH] only display logs of failed tests git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@5099 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- src/xbt/cunit.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/xbt/cunit.c b/src/xbt/cunit.c index 717b4e1a3b..ab53a53787 100644 --- a/src/xbt/cunit.c +++ b/src/xbt/cunit.c @@ -308,12 +308,14 @@ static int xbt_test_suite_run(xbt_test_suite_t suite) { (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); -- 2.20.1