From: mquinson Date: Fri, 30 Nov 2007 16:58:35 +0000 (+0000) Subject: only display logs of failed tests X-Git-Tag: v3.3~749 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/c3f8997103629ced10eb0115bcbf771e5217ce9d?hp=4e9a70eee1c1b9b934d5844de1b6721e0c37b15c 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 --- 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);