summaryrefslogtreecommitdiff
path: root/usr.bin/make/unit-tests/cmd-interrupt.exp
diff options
context:
space:
mode:
authorrillig <rillig@NetBSD.org>2020-08-28 18:16:22 +0000
committerrillig <rillig@NetBSD.org>2020-08-28 18:16:22 +0000
commitc2d9dfe41e98b8fc196c0c6d449ab28fa6c5e250 (patch)
tree8104412e6a6e760c2fc44bf76b78949527dbf964 /usr.bin/make/unit-tests/cmd-interrupt.exp
parent831e9f797092f506c934e773327e45bb5ba6a526 (diff)
make(1): fix test for interrupted command execution
In the first version of this test, I had completely misunderstood the whole topic. To test the interrupt, the make process has to be interrupted, not the shell. This generates the correct message that the target is removed. The filename for .PHONY targets is removed even though .PHONY targets usually don't correspond to a file. The message is only printed if there actually is a corresponding file. That's why this message does not appear when interrupting "make clean". Finally, since files get created and removed during a single run of make, the file cache needs to be disabled. This is done by prefixing the filenames with "././", see Dir_FindFile.
Diffstat (limited to 'usr.bin/make/unit-tests/cmd-interrupt.exp')
-rw-r--r--usr.bin/make/unit-tests/cmd-interrupt.exp20
1 files changed, 6 insertions, 14 deletions
diff --git a/usr.bin/make/unit-tests/cmd-interrupt.exp b/usr.bin/make/unit-tests/cmd-interrupt.exp
index fa4f0c3aabb..91f4439e7be 100644
--- a/usr.bin/make/unit-tests/cmd-interrupt.exp
+++ b/usr.bin/make/unit-tests/cmd-interrupt.exp
@@ -1,17 +1,9 @@
-make -r -k -f cmd-interrupt.mk cmd-interrupt-ordinary || true
> cmd-interrupt-ordinary
-kill -INT $$
-*** Signal 2 (continuing)
-
-Stop.
-make: stopped in unit-tests
-ok
-make -r -k -f cmd-interrupt.mk cmd-interrupt-phony || true
+make: *** cmd-interrupt-ordinary removed
+interrupt-ordinary: ok
> cmd-interrupt-phony
-kill -INT $$
-*** Signal 2 (continuing)
-
-Stop.
-make: stopped in unit-tests
-ok
+make: *** cmd-interrupt-phony removed
+interrupt-phony: ok
+> cmd-interrupt-precious
+interrupt-precious: ok
exit status 0