From 2ec1c834ca1129b69f4dd3e2586d9f318cbb3fa6 Mon Sep 17 00:00:00 2001 From: Phil Ruffwind Date: Mon, 30 Jan 2017 11:49:58 -0500 Subject: Fix broken tests 1. DoParamM requires the FlexibleContexts pragma now. 2. topHandler02 and topHandler03 were broken as timeout.py failed to translate signals to exit codes. 3. topHandler03 does not produce a consistent stderr, as it depends on what the user has /bin/sh set to. dash writes "Terminated" whereas bash and zsh produce nothing in non-interactive mode. 4. The remaining tests are broken due to changes in the error message formatting. Test Plan: validate Reviewers: thomie, dfeuer, austin, hvr, bgamari Reviewed By: bgamari Subscribers: Phyx, dfeuer Differential Revision: https://phabricator.haskell.org/D2807 --- testsuite/timeout/timeout.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'testsuite/timeout') diff --git a/testsuite/timeout/timeout.py b/testsuite/timeout/timeout.py index 51fb63c179..f3468ad9fb 100644 --- a/testsuite/timeout/timeout.py +++ b/testsuite/timeout/timeout.py @@ -42,8 +42,12 @@ try: (pid2, res) = os.waitpid(pid, 0) if (os.WIFEXITED(res)): sys.exit(os.WEXITSTATUS(res)) - else: - sys.exit(res) + elif os.WIFSIGNALED(res): + # represent signals using the Bourne shell convention + sys.exit(128 + os.WTERMSIG(res)) + else: # WIFCONTINUED or WIFSTOPPED + killProcess(pid) + sys.exit(99) # unexpected except KeyboardInterrupt: sys.exit(98) -- cgit v1.2.1