mirror of
https://github.com/google/googletest.git
synced 2025-01-14 08:27:56 +08:00
Adding test/gtest_uninitialized_test.py missing from the previous check-in
This commit is contained in:
parent
95536ab53b
commit
957ed9fb52
@ -67,24 +67,14 @@ def AssertEq(expected, actual):
|
|||||||
raise AssertionError
|
raise AssertionError
|
||||||
|
|
||||||
|
|
||||||
def GetOutput(command):
|
|
||||||
"""Runs the given command and returns its output."""
|
|
||||||
|
|
||||||
stdin, stdout = os.popen2(command, 't')
|
|
||||||
stdin.close()
|
|
||||||
output = stdout.read()
|
|
||||||
stdout.close()
|
|
||||||
return output
|
|
||||||
|
|
||||||
|
|
||||||
def TestExitCodeAndOutput(command):
|
def TestExitCodeAndOutput(command):
|
||||||
"""Runs the given command and verifies its exit code and output."""
|
"""Runs the given command and verifies its exit code and output."""
|
||||||
|
|
||||||
# Verifies that 'command' exits with code 1.
|
# Verifies that 'command' exits with code 1.
|
||||||
AssertEq(1, gtest_test_utils.GetExitStatus(os.system(command)))
|
p = gtest_test_utils.Subprocess(command)
|
||||||
|
Assert(p.exited)
|
||||||
output = GetOutput(command)
|
AssertEq(1, p.exit_code)
|
||||||
Assert('InitGoogleTest' in output)
|
Assert('InitGoogleTest' in p.output)
|
||||||
|
|
||||||
|
|
||||||
if IS_WINDOWS:
|
if IS_WINDOWS:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user