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 <cjihrig@gmail.com>
This commit is contained in:
Bartosz Sosnowski 2017-11-03 12:43:59 +01:00 committed by cjihrig
parent e7f4e9ecca
commit 96ea5ac96d
No known key found for this signature in database
GPG Key ID: 7434390BDBE9B9C5

View File

@ -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';
}