summaryrefslogtreecommitdiff
path: root/tests/scripts
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2013-05-04 13:10:56 -0400
committerPaul Smith <psmith@gnu.org>2013-05-04 13:10:56 -0400
commit5cb4d63dca75c5cfcd23fda46501e63a936f1311 (patch)
tree83a4a38f0209303e73e93d03218528e1ba07c366 /tests/scripts
parentd5f580e0ad639ec6d14ee6c8362adbedb38a7b27 (diff)
downloadmake-5cb4d63dca75c5cfcd23fda46501e63a936f1311.tar.gz
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.
Diffstat (limited to 'tests/scripts')
-rw-r--r--tests/scripts/features/output-sync10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/scripts/features/output-sync b/tests/scripts/features/output-sync
index c8ff2911..a1560adb 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;