Changeset 501 in kBuild for vendor/gnumake/current/tests/scripts/features/order_only
- Timestamp:
- Sep 15, 2006 2:30:32 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/gnumake/current/tests/scripts/features/order_only
r284 r501 6 6 prerequisites and ensure they behave properly. Test the \$| variable."; 7 7 8 open(MAKEFILE,"> $makefile"); 8 # TEST #0 -- Basics 9 9 10 print MAKEFILE <<'EOF'; 10 run_make_test(' 11 %r: | baz ; @echo $< $^ $| 12 bar: foo 13 foo:;@: 14 baz:;@:', 15 '', "foo foo baz\n"); 16 17 # TEST #1 -- First try: the order-only prereqs need to be built. 18 19 run_make_test(q! 11 20 foo: bar | baz 12 21 @echo '$$^ = $^' … … 17 26 18 27 bar baz: 19 touch $@ 20 EOF 21 22 close(MAKEFILE); 23 24 25 # TEST #1 -- just the syntax 26 27 &run_make_with_options($makefile, "", &get_logfile); 28 $answer = "touch bar\ntouch baz\n\$^ = bar\n\$| = baz\ntouch foo\n"; 29 &compare_output($answer,&get_logfile(1)); 28 touch $@!, 29 '', "touch bar\ntouch baz\n\$^ = bar\n\$| = baz\ntouch foo\n"); 30 30 31 31 32 32 # TEST #2 -- now we do it again: baz is PHONY but foo should _NOT_ be updated 33 33 34 &run_make_with_options($makefile, "", &get_logfile); 35 $answer = "touch baz\n"; 36 &compare_output($answer,&get_logfile(1)); 34 run_make_test(undef, '', "touch baz\n"); 37 35 38 36 unlink(qw(foo bar baz)); 39 37 40 # T est prereqs that are both order and non-order38 # TEST #3 -- Make sure the order-only prereq was promoted to normal. 41 39 42 $makefile2 = &get_tmpfile; 43 44 open(MAKEFILE,"> $makefile2"); 45 46 print MAKEFILE <<'EOF'; 40 run_make_test(q! 47 41 foo: bar | baz 48 42 @echo '$$^ = $^' … … 55 49 56 50 bar baz: 57 touch $@ 58 EOF 59 60 close(MAKEFILE); 61 62 # TEST #3 -- Make sure the order-only prereq was promoted to normal. 63 64 &run_make_with_options($makefile2, "", &get_logfile); 65 $answer = "touch bar\ntouch baz\n\$^ = bar baz\n\$| = \ntouch foo\n"; 66 &compare_output($answer,&get_logfile(1)); 51 touch $@!, 52 '', "touch bar\ntouch baz\n\$^ = bar baz\n\$| = \ntouch foo\n"); 67 53 68 54 69 55 # TEST #4 -- now we do it again 70 56 71 &run_make_with_options($makefile2, "", &get_logfile); 72 $answer = "touch baz\n\$^ = bar baz\n\$| = \ntouch foo\n"; 73 &compare_output($answer,&get_logfile(1)); 57 run_make_test(undef, '', "touch baz\n\$^ = bar baz\n\$| = \ntouch foo\n"); 74 58 75 59 unlink(qw(foo bar baz)); … … 77 61 # Test empty normal prereqs 78 62 79 $makefile3 = &get_tmpfile; 63 # TEST #5 -- make sure the parser was correct. 80 64 81 open(MAKEFILE,"> $makefile3"); 82 83 print MAKEFILE <<'EOF'; 65 run_make_test(q! 84 66 foo:| baz 85 67 @echo '$$^ = $^' … … 90 72 91 73 baz: 92 touch $@ 93 EOF 94 95 close(MAKEFILE); 96 97 # TEST #5 -- make sure the parser was correct. 98 99 &run_make_with_options($makefile3, "", &get_logfile); 100 $answer = "touch baz\n\$^ = \n\$| = baz\ntouch foo\n"; 101 &compare_output($answer,&get_logfile(1)); 102 74 touch $@!, 75 '', "touch baz\n\$^ = \n\$| = baz\ntouch foo\n"); 103 76 104 77 # TEST #6 -- now we do it again: this time foo won't be built 105 78 106 &run_make_with_options($makefile3, "", &get_logfile); 107 $answer = "touch baz\n"; 108 &compare_output($answer,&get_logfile(1)); 79 run_make_test(undef, '', "touch baz\n"); 109 80 110 81 unlink(qw(foo baz)); … … 112 83 # Test order-only in pattern rules 113 84 114 $makefile4 = &get_tmpfile; 85 # TEST #7 -- make sure the parser was correct. 115 86 116 open(MAKEFILE,"> $makefile4"); 117 118 print MAKEFILE <<'EOF'; 87 run_make_test(q! 119 88 %.w : %.x | baz 120 89 @echo '$$^ = $^' … … 126 95 .PHONY: baz 127 96 foo.x baz: 128 touch $@ 129 EOF 130 131 close(MAKEFILE); 132 133 # TEST #7 -- make sure the parser was correct. 134 135 &run_make_with_options($makefile4, "", &get_logfile); 136 $answer = "touch foo.x\ntouch baz\n\$^ = foo.x\n\$| = baz\ntouch foo.w\n"; 137 &compare_output($answer,&get_logfile(1)); 97 touch $@!, 98 '', 99 "touch foo.x\ntouch baz\n\$^ = foo.x\n\$| = baz\ntouch foo.w\n"); 138 100 139 101 # TEST #8 -- now we do it again: this time foo.w won't be built 140 102 141 &run_make_with_options($makefile4, "", &get_logfile); 142 $answer = "touch baz\n"; 143 &compare_output($answer,&get_logfile(1)); 103 run_make_test(undef, '', "touch baz\n"); 144 104 145 105 unlink(qw(foo.w foo.x baz)); … … 152 112 bar: foo 153 113 foo:;@: 154 baz:;@: 155 ','', "foo foo baz\n");114 baz:;@:', 115 '', "foo foo baz\n"); 156 116 157 117
Note:
See TracChangeset
for help on using the changeset viewer.

