From 96ea5ac96d71300d2d7b89bb319102eb2c7a0a28 Mon Sep 17 00:00:00 2001 From: Bartosz Sosnowski Date: Fri, 3 Nov 2017 12:43:59 +0100 Subject: [PATCH] test: no extra new line in skipped test output Removes extra empty line when a test was skipped. PR-URL: https://github.com/libuv/libuv/pull/1616 Reviewed-By: Colin Ihrig --- test/runner.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/runner.c b/test/runner.c index b766097c..f017902a 100644 --- a/test/runner.c +++ b/test/runner.c @@ -130,6 +130,7 @@ void log_tap_result(int test_count, const char* result; const char* directive; char reason[1024]; + int reason_length; switch (status) { case TEST_OK: @@ -147,6 +148,9 @@ void log_tap_result(int test_count, if (status == TEST_SKIP && process_output_size(process) > 0) { process_read_last_line(process, reason, sizeof reason); + reason_length = strlen(reason); + if (reason_length > 0 && reason[reason_length - 1] == '\n') + reason[reason_length - 1] = '\0'; } else { reason[0] = '\0'; }