summaryrefslogtreecommitdiff
path: root/tests/defs
diff options
context:
space:
mode:
authorStefano Lattarini <stefano.lattarini@gmail.com>2011-09-06 17:10:21 +0200
committerStefano Lattarini <stefano.lattarini@gmail.com>2011-09-06 17:29:46 +0200
commite1177186ff44b11d6c14d74637bb2564b84151d0 (patch)
tree8410c69c9a6902254748b4ad5e61d20a53c82cfa /tests/defs
parent8bae346819ce77fa3d653af4abfc6f1da9788303 (diff)
downloadautomake-e1177186ff44b11d6c14d74637bb2564b84151d0.tar.gz
tests: fix spurious failures due to ignored signals
* tests/defs (is_blocked_signal): New function. * tests/parallel-tests-interrupt.test: Do not try to use/trap signals that are ignored by the parent shell: they will be ignored by all the child processes too. * tests/self-check-exit.test: Likewise. * tests/self-check-cleanup.test: Likewise, and do few minor improvements and extensions since we are at it.
Diffstat (limited to 'tests/defs')
-rw-r--r--tests/defs9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/defs b/tests/defs
index fe73d855d..2c43bc172 100644
--- a/tests/defs
+++ b/tests/defs
@@ -153,6 +153,15 @@ is_newest ()
test -z "$is_newest_files"
}
+# is_blocked_signal SIGNAL-NUMBER
+# --------------------------------
+# Return success if the given signal number is blocked in the shell,
+# return a non-zero exit status and print a proper diagnostic otherwise.
+is_blocked_signal ()
+{
+ $SHELL -c "kill -$1 \$\$; echo '$me: signal $1 seems blocked'"
+}
+
# AUTOMAKE_run status [options...]
# --------------------------------
# Run Automake with OPTIONS, and fail if automake