Makes the Python tests more portable by calling standard functions to interpret the result of os.system(). This could fix the broken Python tests on some users' machines.
This commit is contained in:
@@ -81,13 +81,7 @@ def TestExitCodeAndOutput(command):
|
||||
"""Runs the given command and verifies its exit code and output."""
|
||||
|
||||
# Verifies that 'command' exits with code 1.
|
||||
if IS_WINDOWS:
|
||||
# On Windows, os.system(command) returns the exit code of 'command'.
|
||||
AssertEq(1, os.system(command))
|
||||
else:
|
||||
# On Unix-like system, os.system(command) returns 256 times the
|
||||
# exit code of 'command'.
|
||||
AssertEq(256, os.system(command))
|
||||
AssertEq(1, gtest_test_utils.GetExitStatus(os.system(command)))
|
||||
|
||||
output = GetOutput(command)
|
||||
Assert('InitGoogleTest' in output)
|
||||
|
||||
Reference in New Issue
Block a user