mirror of
https://github.com/mirror/make.git
synced 2025-03-27 20:40:35 +08:00
[SV 63243] tests: Avoid SIGTERM racing with make error messages
Original patch from Frank Heckenbach <f.heckenbach@fh-soft.de>. * tests/scripts/features/output-sync: Introduce a sleep to let make write its error message. Some systems use different names for SIGTERM so match with a regex. * tests/scripts/features/temp_stdin: Ditto.
This commit is contained in:
parent
c2f92c980f
commit
54214176b1
@ -352,10 +352,12 @@ use POSIX ();
|
|||||||
# Test that make removes temporary files, even when a signal is received.
|
# Test that make removes temporary files, even when a signal is received.
|
||||||
# The general test_driver postprocessing will ensure the temporary file used
|
# The general test_driver postprocessing will ensure the temporary file used
|
||||||
# to synchronize output and the jobserver fifo are both removed.
|
# to synchronize output and the jobserver fifo are both removed.
|
||||||
|
# sleep is needed to let make write its "... Terminated" message to the log
|
||||||
|
# file.
|
||||||
run_make_test(q!
|
run_make_test(q!
|
||||||
pid:=$(shell echo $$PPID)
|
pid:=$(shell echo $$PPID)
|
||||||
all:; @kill -TERM $(pid)
|
all:; @kill -TERM $(pid) && sleep 16
|
||||||
!, '-O -j2', "", POSIX::SIGTERM);
|
!, '-O -j2', '/#MAKE#: \*\*\* \[#MAKEFILE#:3: all] Terminated/', POSIX::SIGTERM);
|
||||||
}
|
}
|
||||||
|
|
||||||
unlink($fout);
|
unlink($fout);
|
||||||
|
@ -62,6 +62,8 @@ use POSIX ();
|
|||||||
# include bye.mk and bye.mk: rule is needed to cause make to keep the temporary
|
# include bye.mk and bye.mk: rule is needed to cause make to keep the temporary
|
||||||
# file for re-exec. Without re-exec make will remove the file before the signal
|
# file for re-exec. Without re-exec make will remove the file before the signal
|
||||||
# arrives.
|
# arrives.
|
||||||
|
# sleep is needed to let make write its "... Terminated" message to the log
|
||||||
|
# file.
|
||||||
&utouch(-600, 'bye.mk');
|
&utouch(-600, 'bye.mk');
|
||||||
close(STDIN);
|
close(STDIN);
|
||||||
open(STDIN, "<", 'input.mk') || die "$0: cannot open input.mk for reading: $!";
|
open(STDIN, "<", 'input.mk') || die "$0: cannot open input.mk for reading: $!";
|
||||||
@ -69,9 +71,9 @@ run_make_test(q!
|
|||||||
include bye.mk
|
include bye.mk
|
||||||
pid:=$(shell echo $$PPID)
|
pid:=$(shell echo $$PPID)
|
||||||
all:;
|
all:;
|
||||||
bye.mk: force; @kill -TERM $(pid)
|
bye.mk: force; @kill -TERM $(pid) && sleep 16
|
||||||
force:
|
force:
|
||||||
!, '-f-', "", POSIX::SIGTERM);
|
!, '-f-', '/#MAKE#: \*\*\* \[#MAKEFILE#:5: bye.mk] Terminated/', POSIX::SIGTERM);
|
||||||
}
|
}
|
||||||
unlink($fout);
|
unlink($fout);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user