From b8467292c9be14b31c028d472107946770ed977e Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Sat, 4 May 2013 13:10:56 -0400 Subject: Improve sync handling for -Ojob/-Otarget and recursion. If we are not going to sync a command line then dump any collected output first to preserve ordering. Do some code cleanup: * Move the handle init to a separate function. * Move the temp file truncation to the output function. * Remember whether we sync in a variable for readability. * Handle EINTR and short writes in child_out(). * Always call sync_output() in case output_sync was changed due to error. --- tests/scripts/features/output-sync | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tests/scripts/features') diff --git a/tests/scripts/features/output-sync b/tests/scripts/features/output-sync index c8ff291..a1560ad 100644 --- a/tests/scripts/features/output-sync +++ b/tests/scripts/features/output-sync @@ -244,5 +244,15 @@ foo: end # Remove temporary directories and contents. output_sync_clean(); +# Ensure recursion doesn't mis-order or double-print output +run_make_test(qq! +all: +\t\@echo foo +\t\@+echo bar +!, + '-j -Ojob', "foo\nbar\n"); + +run_make_test(undef, '-j -Otarget', "foo\nbar\n"); + # This tells the test driver that the perl test script executed properly. 1; -- cgit v1.2.3