From 98eb5e45a67c65a6cb14d593eedc8bab8a309023 Mon Sep 17 00:00:00 2001 From: Snaipe Date: Sun, 13 Sep 2015 15:02:13 +0200 Subject: [PATCH] Added elapsed time on time out --- po/fr.po | 6 +++--- src/log/normal.c | 7 ++++--- src/log/tap.c | 5 +++-- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/po/fr.po b/po/fr.po index 84b22a67..a59b0661 100644 --- a/po/fr.po +++ b/po/fr.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: criterion 1.0.0\n" "Report-Msgid-Bugs-To: franklinmathieu+criterion@gmail.com\n" -"POT-Creation-Date: 2015-09-13 13:10+0200\n" +"POT-Creation-Date: 2015-09-13 14:51+0200\n" "PO-Revision-Date: 2015-04-03 17:58+0200\n" "Last-Translator: \n" "Language-Team: French\n" @@ -61,8 +61,8 @@ msgstr "" #: src/log/normal.c:61 #, fuzzy, c-format -msgid "%1$s::%2$s: Timed out.\n" -msgstr "%1$s::%2$s: Délai expiré.\n" +msgid "%1$s::%2$s: Timed out. (%3$3.2fs)\n" +msgstr "%1$s::%2$s: Délai expiré. (%3$3.2fs)\n" #: src/log/normal.c:62 #, c-format diff --git a/src/log/normal.c b/src/log/normal.c index 5bae2efc..6e3b1dbd 100644 --- a/src/log/normal.c +++ b/src/log/normal.c @@ -58,7 +58,7 @@ static msg_t msg_post_suite_test = N_("%1$s::%2$s: Test is disabled\n"); static msg_t msg_post_suite_suite = N_("%1$s::%2$s: Suite is disabled\n"); static msg_t msg_assert_fail = N_("%1$s%2$s%3$s:%4$s%5$d%6$s: Assertion failed: %7$s\n"); static msg_t msg_theory_fail = N_(" Theory %1$s::%2$s failed with the following parameters: (%3$s)\n"); -static msg_t msg_test_timeout = N_("%1$s::%2$s: Timed out.\n"); +static msg_t msg_test_timeout = N_("%1$s::%2$s: Timed out. (%3$3.2fs)\n"); static msg_t msg_test_crash_line = N_("%1$s%2$s%3$s:%4$s%5$u%6$s: Unexpected signal caught below this line!\n"); static msg_t msg_test_crash = N_("%1$s::%2$s: CRASH!\n"); static msg_t msg_test_other_crash = N_("%1$sWarning! The test `%2$s::%3$s` crashed during its setup or teardown.%4$s\n"); @@ -78,7 +78,7 @@ static msg_t msg_post_suite_test = "%s::%s: Test is disabled\n"; static msg_t msg_post_suite_suite = "%s::%s: Suite is disabled\n"; static msg_t msg_assert_fail = "%s%s%s:%s%d%s: Assertion failed: %s\n"; static msg_t msg_theory_fail = " Theory %s::%s failed with the following parameters: %s\n"; -static msg_t msg_test_timeout = "%s::%s: timed out.\n"; +static msg_t msg_test_timeout = "%s::%s: Timed out. (%3.2fs)\n"; static msg_t msg_test_crash_line = "%s%s%s:%s%u%s: Unexpected signal caught below this line!\n"; static msg_t msg_test_crash = "%s::%s: CRASH!\n"; static msg_t msg_test_other_crash = "%sWarning! The test `%s::%s` crashed during its setup or teardown.%s\n"; @@ -226,7 +226,8 @@ void normal_log_test_timeout(UNUSED struct criterion_test_stats *stats) { criterion_pimportant(CRITERION_PREFIX_FAIL, _(msg_test_timeout), stats->test->category, - stats->test->name); + stats->test->name, + stats->elapsed_time); } struct criterion_output_provider normal_logging = { diff --git a/src/log/tap.c b/src/log/tap.c index b3180b51..9a87b78d 100644 --- a/src/log/tap.c +++ b/src/log/tap.c @@ -119,9 +119,10 @@ void tap_log_test_crash(struct criterion_test_stats *stats) { } void tap_log_test_timeout(struct criterion_test_stats *stats) { - criterion_important("not ok - %s::%s timed out\n", + criterion_important("not ok - %s::%s timed out (%3.2fs)\n", stats->test->category, - stats->test->name); + stats->test->name, + stats->elapsed_time); } struct criterion_output_provider tap_logging = {