123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- """Verifies that Google Test warns the user when not initialized properly."""
- import gtest_test_utils
- binary_name = 'googletest-param-test-invalid-name1-test_'
- COMMAND = gtest_test_utils.GetTestExecutablePath(binary_name)
- def Assert(condition):
- if not condition:
- raise AssertionError
- def TestExitCodeAndOutput(command):
- """Runs the given command and verifies its exit code and output."""
- err = ('Parameterized test name \'"InvalidWithQuotes"\' is invalid')
- p = gtest_test_utils.Subprocess(command)
- Assert(p.terminated_by_signal)
-
- Assert(err in p.output)
- class GTestParamTestInvalidName1Test(gtest_test_utils.TestCase):
- def testExitCodeAndOutput(self):
- TestExitCodeAndOutput(COMMAND)
- if __name__ == '__main__':
- gtest_test_utils.Main()
|