From f312d23f4598097b56883d95d598dc4b502498b7 Mon Sep 17 00:00:00 2001 From: Igor Pashev Date: Tue, 24 Mar 2015 22:30:52 +0300 Subject: Implemented .WAIT Based on this patch: http://lists.gnu.org/archive/html/help-make/2005-04/msg00091.html Test file (wait.mk): simple: 1 .WAIT 2 @echo $@ 1: @sleep 2; echo $@ 2: @echo $@ run: ./make --sun -f wait.mk -j50 simple Output: 1 2 simple --- tests/scripts/features/sun-wait | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 tests/scripts/features/sun-wait (limited to 'tests') diff --git a/tests/scripts/features/sun-wait b/tests/scripts/features/sun-wait new file mode 100644 index 0000000..bc2fab6 --- /dev/null +++ b/tests/scripts/features/sun-wait @@ -0,0 +1,34 @@ +# -*-perl-*- +$description = "Check .WAIT special target"; + +$details = ""; + +run_make_test(' +one: + @sleep 2; echo $@ +two: + @echo $@ + +three: one .WAIT two + @echo $@ + +four: one two + @echo $@ + +', +'--sun three', # note: one job +"one\ntwo\nthree"); + +# Same file, but 3 jobs, must be the same result due to .WAIT: +run_make_test(undef, '--sun -j3 three', "one\ntwo\nthree"); + +# Same file, but "two" should not depend on "one": +run_make_test(undef, '--sun two', "two"); + +# Same file, but "two" should end earlier: +run_make_test(undef, '--sun -j3 four', "two\none\nfour"); +# Same file, but "two" should end earlier even in mornal mode ;-) +run_make_test(undef, '-j3 four', "two\none\nfour"); + +# This tells the test driver that the perl test script executed properly. +1; -- cgit v1.2.3