1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116
|
# -*-perl-*-
$description = "Test the behaviour of the .NOTINTERMEDIATE target.";
$details = "\
Test the behavior of the .NOTINTERMEDIATE special target.\n";
touch('hello.z');
unlink('hello.x');
# Test 1. A file which matches a .NOTINTERMEDIATE pattern is not intermediate.
run_make_test(q!
hello.z:
%.z: %.x; touch $@
%.x: ;
.NOTINTERMEDIATE: %.q %.x
!, '', "touch hello.z\n");
# Test 2. .NOTINTERMEDIATE: %.q pattern has no effect on hello.x.
touch('hello.z');
run_make_test(q!
hello.z:
%.z: %.x; touch $@
%.x: ;
.NOTINTERMEDIATE: %.q
!, '', "#MAKE#: 'hello.z' is up to date.\n");
# Test 3. A file which is a prereq of .NOTINTERMEDIATE is not intermediate.
run_make_test(q!
hello.z:
%.z: %.x; touch $@
%.x: ;
.NOTINTERMEDIATE: %.q hello.x
!, '', "touch hello.z\n");
# Test 4. .NOTINTERMEDIATE without prerequisites makes everything
# notintermediate.
run_make_test(q!
hello.z:
%.z: %.x; touch $@
%.x: ;
.NOTINTERMEDIATE:
!, '', "touch hello.z\n");
# Test 5. Same file cannot be intermediate and notintermediate.
run_make_test(q!
.INTERMEDIATE: hello.x
.NOTINTERMEDIATE: hello.x
!, '', "#MAKE#: *** hello.x cannot be both .NOTINTERMEDIATE and .INTERMEDIATE. Stop.\n", 512);
# Test 6. Same file cannot be secondary and notintermediate.
run_make_test(q!
.SECONDARY: hello.x
.NOTINTERMEDIATE: hello.x
!, '', "#MAKE#: *** hello.x cannot be both .NOTINTERMEDIATE and .SECONDARY. Stop.\n", 512);
# Test 7. All .SECONDARY and all .NOTINTERMEDIATE are mutually exclusive.
run_make_test(q!
.SECONDARY:
.NOTINTERMEDIATE:
!, '', "#MAKE#: *** .NOTINTERMEDIATE and .SECONDARY are mutually exclusive. Stop.\n", 512);
# Test 8. .INTERMEDIATE file takes priority over a .NOTINTERMEDIATE pattern.
unlink('hello.x');
run_make_test(q!
hello.z:
%.z: %.x; touch $@
%.x: ;
.INTERMEDIATE: hello.x
.NOTINTERMEDIATE: %.q %.x
!, '', "#MAKE#: 'hello.z' is up to date.\n");
# Test 9. Everything is notintermediate, except hello.x.
unlink('hello.x');
run_make_test(q!
hello.z:
%.z: %.x; touch $@
%.x: ;
.INTERMEDIATE: hello.x
.NOTINTERMEDIATE:
!, '', "#MAKE#: 'hello.z' is up to date.\n");
# Test 10. Everything is notintermediate, except hello.x.
unlink('hello.x');
run_make_test(q!
hello.z:
%.z: %.x; touch $@
%.x: ;
.SECONDARY: hello.x
.NOTINTERMEDIATE:
!, '', "#MAKE#: 'hello.z' is up to date.\n");
# Test 11. Everything is secondary, except %.q, hello.x.
unlink('hello.x');
run_make_test(q!
hello.z:
%.z: %.x; touch $@
%.x: ;
.NOTINTERMEDIATE: %.q hello.x
.SECONDARY:
!, '', "touch hello.z\n");
# Test 12. Everything is secondary, except %.q %.x.
unlink('hello.x');
run_make_test(q!
hello.z:
%.z: %.x; touch $@
%.x: ;
.NOTINTERMEDIATE: %.q %.x
.SECONDARY:
!, '', "touch hello.z\n");
unlink('hello.z');
# This tells the test driver that the perl test script executed properly.
1;
|