2 $description = "Test handling of double-colon rules.";
5 We test these features:
7 - Multiple commands for the same (double-colon) target
8 - Different prerequisites for targets: only out-of-date
10 - Double-colon targets that aren't the goal target.
12 Then we do the same thing for parallel builds: double-colon
13 targets should always be built serially.";
15 # TEST 0: A simple double-colon rule that isn't the goal target.
20 foo:: f1.h ; @echo foo FIRST
21 foo:: f2.h ; @echo foo SECOND
23 bar:: ; @echo aaa; sleep 1; echo aaa done
41 # TEST 1: As above, in parallel
44 run_make_test(undef, "-j10 all", "aaa\nbbb\n");
47 # TEST 2: A simple double-colon rule that is the goal target
49 run_make_test(undef, "bar", "aaa\naaa done\nbbb\n");
51 # TEST 3: As above, in parallel
54 run_make_test(undef, "-j10 bar", "aaa\naaa done\nbbb\n");
57 # TEST 4: Each double-colon rule is supposed to be run individually
62 run_make_test(undef, "foo", "f1.h\nfoo FIRST\n");
64 # TEST 5: Again, in parallel.
67 run_make_test(undef, "-j10 foo", "f1.h\nfoo FIRST\n");
70 # TEST 6: Each double-colon rule is supposed to be run individually
76 run_make_test(undef, "foo", "f2.h\nfoo SECOND\n");
78 # TEST 7: Again, in parallel.
81 run_make_test(undef, "-j10 foo", "f2.h\nfoo SECOND\n");
84 # TEST 8: Test circular dependency check; PR/1671
86 run_make_test(undef, "d", "ok\n$make_name: Circular d <- d dependency dropped.\noops\n");
88 # TEST 8: I don't grok why this is different than the above, but it is...
90 # Hmm... further testing indicates this might be timing-dependent?
92 #if ($parallel_jobs) {
93 # run_make_test(undef, "-j10 biz", "aaa\ntwo\nbbb\n");
96 unlink('foo','f1.h','f2.h');
99 # TEST 9: make sure all rules in s double colon family get executed
100 # (Savannah bug #14334).
124 unlink('result','one','two');
126 # TEST 10: SV 33399 : check for proper backslash handling
134 # Test 11: SV 44742 : All double-colon rules should be run in parallel build.
154 > @touch 01 02 03 04 05
156 '-j10 result', "update\nupdate\nupdate\nupdate\nupdate\n");
158 unlink('result', '01', '02', '03', '04', '05');
160 # Test 12: SV 44742 : Double-colon rules with parallelism
163 root: all ; echo root
165 all:: 3 ; echo all_two
168 '-rs -j2 1 2 root', "all_one\nall_two\nroot\n");
170 # SV 47995 : Parallel double-colon rules with FORCE
175 all:: joe ; @echo four
177 joe: FORCE ; touch joe-is-forced
181 '-j5', "one\ntouch joe-is-forced\nfour\n");
183 unlink('joe-is-forced');
186 # Even though test.x is explicitly mentioned, terminal pattern rules still
187 # apply only if the prerequisite exists.
190 # subtest 1. test.x is explicitly mentioned.
193 %.z:: test.x ; touch $@
196 '', "#MAKE#: Nothing to be done for 'all'.\n");
200 # subtest 2. hello.x is derived from the stem.
208 '', "#MAKE#: Nothing to be done for 'all'.\n");
213 # hello.x is explicitly mentioned on an unrelated rule and thus is not an
215 # Terminal pattern rules do not apply anyway and there is no rule to built
224 '', "#MAKE#: *** No rule to make target 'hello.x', needed by 'hello.z'. Stop.\n", 512);
229 # This tells the test driver that the perl test script executed properly.