From 1d992d8fe75f5dbc832cbcfe82e3f56489f7df54 Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Sun, 5 May 2013 17:03:51 -0400 Subject: Ensure command lines are written synchronously with -O. If output-sync is enabled, have make write the command line to the temp file instead of printing it directly to the screen to ensure that the output is ordered properly. Also, remove extraneous enter/leave operations by having them printed directly when dumping temp file output. --- tests/ChangeLog | 6 ++++++ tests/scripts/features/output-sync | 28 +++++++++++----------------- 2 files changed, 17 insertions(+), 17 deletions(-) (limited to 'tests') diff --git a/tests/ChangeLog b/tests/ChangeLog index ade64f0..4d11706 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,9 @@ +2013-05-05 Paul Smith + + * scripts/features/output-sync (output_sync_set): Remove + extraneous enter/leave lines, which are no longer printed. + Add tests for syncing command line printing. + 2013-05-04 Paul Smith * scripts/features/loadapi: Use the new alloc functions. diff --git a/tests/scripts/features/output-sync b/tests/scripts/features/output-sync index a1560ad..e7edfce 100644 --- a/tests/scripts/features/output-sync +++ b/tests/scripts/features/output-sync @@ -127,14 +127,11 @@ make-foo: ; \$(MAKE) -C foo make-bar: ; \$(MAKE) -C bar!, '-j -Omake', "#MAKEPATH# -C foo -#MAKEPATH# -C bar -#MAKE#[1]: Entering directory '#PWD#/foo' #MAKE#[1]: Entering directory '#PWD#/foo' foo: start foo: end #MAKE#[1]: Leaving directory '#PWD#/foo' -#MAKE#[1]: Leaving directory '#PWD#/foo' -#MAKE#[1]: Entering directory '#PWD#/bar' +#MAKEPATH# -C bar #MAKE#[1]: Entering directory '#PWD#/bar' bar: start bar: end @@ -142,7 +139,6 @@ bar: end #MAKE#[1]: Entering directory '#PWD#/bar' baz: start baz: end -#MAKE#[1]: Leaving directory '#PWD#/bar' #MAKE#[1]: Leaving directory '#PWD#/bar'\n", 0, 6); # Test per-target synchronization. @@ -160,8 +156,6 @@ make-bar: ; $sleep_command 1 ; \$(MAKE) -C bar!, '-j --output-sync=target', "#MAKEPATH# -C foo $sleep_command 1 ; #MAKEPATH# -C bar -#MAKE#[1]: Entering directory '#PWD#/foo' -#MAKE#[1]: Entering directory '#PWD#/bar' #MAKE#[1]: Entering directory '#PWD#/bar' bar: start bar: end @@ -170,11 +164,9 @@ bar: end foo: start foo: end #MAKE#[1]: Leaving directory '#PWD#/foo' -#MAKE#[1]: Leaving directory '#PWD#/foo' #MAKE#[1]: Entering directory '#PWD#/bar' baz: start baz: end -#MAKE#[1]: Leaving directory '#PWD#/bar' #MAKE#[1]: Leaving directory '#PWD#/bar'\n", 0, 6); # Test that messages from make itself are enclosed with @@ -189,20 +181,16 @@ make-bar-bar: ; $sleep_command 1 ; \$(MAKE) -C bar bar!, '-j -O', "#MAKEPATH# -C foo foo-fail $sleep_command 1 ; #MAKEPATH# -C bar bar -#MAKE#[1]: Entering directory '#PWD#/foo' -#MAKE#[1]: Entering directory '#PWD#/bar' #MAKE#[1]: Entering directory '#PWD#/bar' bar: start bar: end #MAKE#[1]: Leaving directory '#PWD#/bar' -#MAKE#[1]: Leaving directory '#PWD#/bar' #MAKE#[1]: Entering directory '#PWD#/foo' foo-fail: start foo-fail: end Makefile:20: recipe for target 'foo-fail' failed #MAKE#[1]: *** [foo-fail] Error 1 #MAKE#[1]: Leaving directory '#PWD#/foo' -#MAKE#[1]: Leaving directory '#PWD#/foo' #MAKEFILE#:4: recipe for target 'make-foo-fail' failed #MAKE#: *** [make-foo-fail] Error 2\n", 512); @@ -224,20 +212,16 @@ make-bar: ; $sleep_command 1 ; \$(MAKE) -C bar bar-job!, "#MAKEPATH# -C foo foo-job $sleep_command 1 ; #MAKEPATH# -C bar bar-job #MAKE#[1]: Entering directory '#PWD#/foo' -#MAKE#[1]: Entering directory '#PWD#/foo' foo: start #MAKE#[1]: Leaving directory '#PWD#/foo' #MAKE#[1]: Entering directory '#PWD#/bar' -#MAKE#[1]: Entering directory '#PWD#/bar' bar: start #MAKE#[1]: Leaving directory '#PWD#/bar' #MAKE#[1]: Entering directory '#PWD#/bar' bar: end #MAKE#[1]: Leaving directory '#PWD#/bar' -#MAKE#[1]: Leaving directory '#PWD#/bar' #MAKE#[1]: Entering directory '#PWD#/foo' foo: end -#MAKE#[1]: Leaving directory '#PWD#/foo' #MAKE#[1]: Leaving directory '#PWD#/foo'\n", 0, 6); @@ -254,5 +238,15 @@ all: run_make_test(undef, '-j -Otarget', "foo\nbar\n"); +# Ensure when make writes out command it's not misordered +run_make_test(qq! +all: +\t\@echo foobar +\ttrue +!, + '-j -Ojob', "foobar\ntrue\n"); + +run_make_test(undef, '-j -Otarget', "foobar\ntrue\n"); + # This tells the test driver that the perl test script executed properly. 1; -- cgit v1.2.3