30 """Unit test utilities for Google C++ Mocking Framework."""
36 SCRIPT_DIR = os.path.dirname(__file__)
or '.'
39 gtest_tests_util_dir = os.path.join(SCRIPT_DIR,
'../../googletest/test')
40 if os.path.isdir(gtest_tests_util_dir):
41 GTEST_TESTS_UTIL_DIR = gtest_tests_util_dir
43 GTEST_TESTS_UTIL_DIR = os.path.join(SCRIPT_DIR,
'../../googletest/test')
44 sys.path.append(GTEST_TESTS_UTIL_DIR)
47 import gtest_test_utils
51 """Returns the absolute path of the directory where the .py files are."""
57 """Returns the absolute path of the test binary given its name.
59 The function will print a message and abort the program if the resulting file
63 executable_name: name of the test binary that the test script runs.
66 The absolute path of the test binary.
73 """Returns the argument to exit(), or -1 if exit() wasn't called.
76 exit_code: the result value of os.system(command).
86 if os.WIFEXITED(exit_code):
87 return os.WEXITSTATUS(exit_code)
97 TestCase = gtest_test_utils.TestCase
98 environ = gtest_test_utils.environ
99 SetEnvVar = gtest_test_utils.SetEnvVar
100 PREMATURE_EXIT_FILE_ENV_VAR = gtest_test_utils.PREMATURE_EXIT_FILE_ENV_VAR
106 """Runs the unit test."""