diff options
author | Xavier Leroy <xavier.leroy@inria.fr> | 2017-10-08 11:50:34 +0200 |
---|---|---|
committer | Xavier Leroy <xavier.leroy@inria.fr> | 2017-10-08 11:50:34 +0200 |
commit | a3aa013181a2ae9f27c4fa494c1b923c8c2ad03b (patch) | |
tree | 586225308bcc628e39df2450d4b356c2092843a3 | |
parent | b6bda6a76e1275bca8102ed606d30de60a50c5f7 (diff) | |
download | ocaml-a3aa013181a2ae9f27c4fa494c1b923c8c2ad03b.tar.gz |
tests/lib-threads: remove the 'signal2' test
This test shows bizarre behaviors on the BSDs, including MacOS: it looks like the INT signal is ignored when the test program is run from signal2.runner, but not when running it manually outside of the test script. That could be a Caml problem, or a BSD pthread implementation problem, or a misunderstanding of signal handling in POSIX threads.
At any rate, the signal2 test as it was until recently is useless because it is designed to succeed even in the face of the BSD failure mentioned above (kill -9 to guarantee termination + grepping only for [ab]*, which always succeeds). So, I'm just removing it.
-rw-r--r-- | testsuite/tests/lib-threads/signal2.checker | 17 | ||||
-rw-r--r-- | testsuite/tests/lib-threads/signal2.ml | 13 | ||||
-rw-r--r-- | testsuite/tests/lib-threads/signal2.precheck | 16 | ||||
-rw-r--r-- | testsuite/tests/lib-threads/signal2.runner | 21 |
4 files changed, 0 insertions, 67 deletions
diff --git a/testsuite/tests/lib-threads/signal2.checker b/testsuite/tests/lib-threads/signal2.checker deleted file mode 100644 index aea6ff0189..0000000000 --- a/testsuite/tests/lib-threads/signal2.checker +++ /dev/null @@ -1,17 +0,0 @@ -#************************************************************************** -#* * -#* OCaml * -#* * -#* Xavier Clerc, SED, INRIA Rocquencourt * -#* * -#* Copyright 2010 Institut National de Recherche en Informatique et * -#* en Automatique. * -#* * -#* All rights reserved. This file is distributed under the terms of * -#* the GNU Lesser General Public License version 2.1, with the * -#* special exception on linking described in the file LICENSE. * -#* * -#************************************************************************** - -sed -e 1q signal2.result | grep -q '^[ab]*Got signal INT, exiting...[ab]\{0,2\}$' - diff --git a/testsuite/tests/lib-threads/signal2.ml b/testsuite/tests/lib-threads/signal2.ml deleted file mode 100644 index 23c85d6fd4..0000000000 --- a/testsuite/tests/lib-threads/signal2.ml +++ /dev/null @@ -1,13 +0,0 @@ -let print_message delay c = - while true do - print_char c; flush stdout; Thread.delay delay - done - -let _ = - ignore (Thread.sigmask Unix.SIG_BLOCK [Sys.sigint; Sys.sigterm]); - ignore (Thread.create (print_message 0.6666666666) 'a'); - ignore (Thread.create (print_message 1.0) 'b'); - let s = Thread.wait_signal [Sys.sigint; Sys.sigterm] in - Printf.printf "Got signal %s, exiting...\n" - (if s = Sys.sigint then "INT" else - if s = Sys.sigterm then "TERM" else "unknown") diff --git a/testsuite/tests/lib-threads/signal2.precheck b/testsuite/tests/lib-threads/signal2.precheck deleted file mode 100644 index 72b0054c58..0000000000 --- a/testsuite/tests/lib-threads/signal2.precheck +++ /dev/null @@ -1,16 +0,0 @@ -#************************************************************************** -#* * -#* OCaml * -#* * -#* Damien Doligez, projet Gallium, INRIA Rocquencourt * -#* * -#* Copyright 2013 Institut National de Recherche en Informatique et * -#* en Automatique. * -#* * -#* All rights reserved. This file is distributed under the terms of * -#* the GNU Lesser General Public License version 2.1, with the * -#* special exception on linking described in the file LICENSE. * -#* * -#************************************************************************** - -test "$TOOLCHAIN" != "msvc" -a "$TOOLCHAIN" != "mingw" diff --git a/testsuite/tests/lib-threads/signal2.runner b/testsuite/tests/lib-threads/signal2.runner deleted file mode 100644 index 8369d63664..0000000000 --- a/testsuite/tests/lib-threads/signal2.runner +++ /dev/null @@ -1,21 +0,0 @@ -#************************************************************************** -#* * -#* OCaml * -#* * -#* Xavier Clerc, SED, INRIA Rocquencourt * -#* * -#* Copyright 2010 Institut National de Recherche en Informatique et * -#* en Automatique. * -#* * -#* All rights reserved. This file is distributed under the terms of * -#* the GNU Lesser General Public License version 2.1, with the * -#* special exception on linking described in the file LICENSE. * -#* * -#************************************************************************** - -$RUNTIME ./program >signal2.result & -pid=$! -sleep 2 -kill -INT $pid -sleep 1 -kill -9 $pid 2>&- || true |