30"""Unit test utilities for Google C++ Mocking Framework."""
36SCRIPT_DIR = os.path.dirname(__file__)
or '.'
39gtest_tests_util_dir = os.path.join(SCRIPT_DIR,
'../../googletest/test')
40if 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')
44sys.path.append(GTEST_TESTS_UTIL_DIR)
47import 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)
97TestCase = gtest_test_utils.TestCase
98environ = gtest_test_utils.environ
99SetEnvVar = gtest_test_utils.SetEnvVar
100PREMATURE_EXIT_FILE_ENV_VAR = gtest_test_utils.PREMATURE_EXIT_FILE_ENV_VAR
106 """Runs the unit test."""
def GetExitStatus(exit_code)
def GetTestExecutablePath(executable_name)
def GetTestExecutablePath(executable_name, build_dir=None)