From 877bf59cb6f64cf6ca663cfedd65efdc579874e8 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Tue, 13 Nov 2018 20:34:29 -0800 Subject: [PATCH] GUACAMOLE-662: Force line-buffered output. --- util/generate-test-runner.pl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/util/generate-test-runner.pl b/util/generate-test-runner.pl index a121a071..7534f805 100755 --- a/util/generate-test-runner.pl +++ b/util/generate-test-runner.pl @@ -177,6 +177,11 @@ while ((my $suite_name, my $test_names) = each (%test_suites)) { print <<"END"; + /* Force line-buffered output to ensure log messages are visible even if + * a test crashes */ + setvbuf(stdout, NULL, _IOLBF, 0); + setvbuf(stderr, NULL, _IOLBF, 0); + /* Write TAP header */ printf("1..$num_tests\\n");