summaryrefslogtreecommitdiff
path: root/test/gtest_break_on_failure_unittest.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/gtest_break_on_failure_unittest.py')
-rwxr-xr-xtest/gtest_break_on_failure_unittest.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/test/gtest_break_on_failure_unittest.py b/test/gtest_break_on_failure_unittest.py
index 1b18339..674ef11 100755
--- a/test/gtest_break_on_failure_unittest.py
+++ b/test/gtest_break_on_failure_unittest.py
@@ -74,10 +74,14 @@ def SetEnvVar(env_var, value):
def Run(command):
- """Runs a command; returns 1 if it has a segmentation fault, or 0 otherwise.
+ """Runs a command; returns 1 if it was killed by a signal, or 0 otherwise.
"""
- return os.system(command) == signal.SIGSEGV
+ exit_code = os.system(command)
+ # On Unix-like systems, the lowest 8 bits of the exit code is the
+ # signal number that killed the process (or 0 if it wasn't killed by
+ # a signal).
+ return (exit_code & 255) != 0
# The unit test.