summaryrefslogtreecommitdiffstats
path: root/googletest/test/gtest_test_utils.py
diff options
context:
space:
mode:
authorAbseil Team <absl-team@google.com>2020-12-02 19:08:58 (GMT)
committervslashg <gfalcon@google.com>2020-12-02 23:23:46 (GMT)
commit73979ee1b9892c6fe11c7f4ab5358040c3108622 (patch)
treedd79cc772500fdfbe79b3a87ddc287143109ddde /googletest/test/gtest_test_utils.py
parentb8c4edf95ba3dd9ee6577b13d9b3cc903809c492 (diff)
downloadgoogletest-73979ee1b9892c6fe11c7f4ab5358040c3108622.zip
googletest-73979ee1b9892c6fe11c7f4ab5358040c3108622.tar.gz
googletest-73979ee1b9892c6fe11c7f4ab5358040c3108622.tar.bz2
Googletest export
Check for a high bit to see if a return value is a signal or an error code in googletest/test. This is needed because for subprocess under python3 windows, a return value representing a C signal (such as 0x80000003) is represented as a large positive integer rather than a negative one. PiperOrigin-RevId: 345270460
Diffstat (limited to 'googletest/test/gtest_test_utils.py')
-rwxr-xr-xgoogletest/test/gtest_test_utils.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/googletest/test/gtest_test_utils.py b/googletest/test/gtest_test_utils.py
index ef9363c..7a829fb 100755
--- a/googletest/test/gtest_test_utils.py
+++ b/googletest/test/gtest_test_utils.py
@@ -289,10 +289,10 @@ class Subprocess:
else: # os.WIFEXITED(ret_code) should return True here.
self._return_code = os.WEXITSTATUS(ret_code)
- if self._return_code < 0:
+ if bool(self._return_code & 0x80000000):
self.terminated_by_signal = True
self.exited = False
- self.signal = -self._return_code
+ self.signal = (~self._return_code & 0x7fffffff) + 1
else:
self.terminated_by_signal = False
self.exited = True