From 282dc7bc227eed61df2c3b657de4be351995e972 Mon Sep 17 00:00:00 2001 From: Santiago Gimeno Date: Mon, 22 Aug 2016 13:30:52 +0200 Subject: [PATCH] test: improve tap output on test failures MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Print `errmsg` on TAP output. After making the TAP output the default, the info in `errmsg` was not being used anymore. PR-URL: https://github.com/libuv/libuv/pull/1012 Reviewed-By: Colin Ihrig Reviewed-By: Imran Iqbal Reviewed-By: Saúl Ibarra Corretgé --- test/runner.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/runner.c b/test/runner.c index 5e22c18f..4f54f85e 100644 --- a/test/runner.c +++ b/test/runner.c @@ -145,7 +145,7 @@ void log_tap_result(int test_count, int run_test(const char* test, int benchmark_output, int test_count) { - char errmsg[1024] = "no error"; + char errmsg[1024] = ""; process_info_t processes[1024]; process_info_t *main_proc; task_entry_t* task; @@ -274,6 +274,8 @@ out: /* Show error and output from processes if the test failed. */ if ((status != TEST_OK && status != TEST_SKIP) || task->show_output) { + if (strlen(errmsg) > 0) + fprintf(stderr, "# %s\n", errmsg); fprintf(stderr, "# "); fflush(stderr);