Skip to content

Commit 362a0cf

Browse files
author
vladlosev
committed
Renames test script flags.
git-svn-id: http://googletest.googlecode.com/svn/trunk@431 861a406c-534a-0410-8894-cb66d6ee9925
1 parent 20580b4 commit 362a0cf

File tree

5 files changed

+16
-12
lines changed

5 files changed

+16
-12
lines changed

‎cmake/internal_utils.cmake

+8-4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# NOTE: This file can be included both into Google Test's and Google Mock's
2+
# build scripts, so actions and functions defined here need to be
3+
# idempotent.
4+
15
# Defines CMAKE_USE_PTHREADS_INIT and CMAKE_THREAD_LIBS_INIT.
26
find_package(Threads)
37

@@ -174,13 +178,13 @@ endfunction()
174178
function(py_test name)
175179
# We are not supporting Python tests on Linux yet as they consider
176180
# all Linux environments to be google3 and try to use google3 features.
177-
if (PYTHONINTERP_FOUND AND NOT ${CMAKE_SYSTEM_NAME} MATCHES "Linux")
178-
# ${gtest_BINARY_DIR} is known at configuration time, so we can
181+
if (PYTHONINTERP_FOUND)
182+
# ${CMAKE_BINARY_DIR} is known at configuration time, so we can
179183
# directly bind it from cmake. ${CTEST_CONFIGURATION_TYPE} is known
180184
# only at ctest runtime (by calling ctest -c <Configuration>), so
181185
# we have to escape $ to delay variable substitution here.
182186
add_test(${name}
183-
${PYTHON_EXECUTABLE} ${gtest_SOURCE_DIR}/test/${name}.py
184-
--gtest_build_dir=${gtest_BINARY_DIR}/\${CTEST_CONFIGURATION_TYPE})
187+
${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/test/${name}.py
188+
--build_dir=${CMAKE_BINARY_DIR}/\${CTEST_CONFIGURATION_TYPE})
185189
endif()
186190
endfunction()

‎test/gtest_help_test.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"""Tests the --help flag of Google C++ Testing Framework.
3333
3434
SYNOPSIS
35-
gtest_help_test.py --gtest_build_dir=BUILD/DIR
35+
gtest_help_test.py --build_dir=BUILD/DIR
3636
# where BUILD/DIR contains the built gtest_help_test_ file.
3737
gtest_help_test.py
3838
"""

‎test/gtest_output_test.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"""Tests the text output of Google C++ Testing Framework.
3333
3434
SYNOPSIS
35-
gtest_output_test.py --gtest_build_dir=BUILD/DIR --gengolden
35+
gtest_output_test.py --build_dir=BUILD/DIR --gengolden
3636
# where BUILD/DIR contains the built gtest_output_test_ file.
3737
gtest_output_test.py --gengolden
3838
gtest_output_test.py

‎test/gtest_test_utils.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@
6363

6464
# Initially maps a flag to its default value. After
6565
# _ParseAndStripGTestFlags() is called, maps a flag to its actual value.
66-
_flag_map = {'gtest_source_dir': os.path.dirname(sys.argv[0]),
67-
'gtest_build_dir': os.path.dirname(sys.argv[0])}
66+
_flag_map = {'source_dir': os.path.dirname(sys.argv[0]),
67+
'build_dir': os.path.dirname(sys.argv[0])}
6868
_gtest_flags_are_parsed = False
6969

7070

@@ -111,13 +111,13 @@ def GetFlag(flag):
111111
def GetSourceDir():
112112
"""Returns the absolute path of the directory where the .py files are."""
113113

114-
return os.path.abspath(GetFlag('gtest_source_dir'))
114+
return os.path.abspath(GetFlag('source_dir'))
115115

116116

117117
def GetBuildDir():
118118
"""Returns the absolute path of the directory where the test binaries are."""
119119

120-
return os.path.abspath(GetFlag('gtest_build_dir'))
120+
return os.path.abspath(GetFlag('build_dir'))
121121

122122

123123
_temp_dir = None
@@ -161,7 +161,7 @@ def GetTestExecutablePath(executable_name, build_dir=None):
161161
if not os.path.exists(path):
162162
message = (
163163
'Unable to find the test binary. Please make sure to provide path\n'
164-
'to the binary via the --gtest_build_dir flag or the GTEST_BUILD_DIR\n'
164+
'to the binary via the --build_dir flag or the BUILD_DIR\n'
165165
'environment variable. For convenient use, invoke this script via\n'
166166
'mk_test.py.\n'
167167
# TODO(vladl@google.com): change mk_test.py to test.py after renaming

‎test/run_tests_util.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ class TestRunner(object):
171171

172172
def __init__(self,
173173
script_dir,
174-
build_dir_var_name='GTEST_BUILD_DIR',
174+
build_dir_var_name='BUILD_DIR',
175175
injected_os=os,
176176
injected_subprocess=subprocess,
177177
injected_build_dir_finder=_GetGtestBuildDir):

0 commit comments

Comments
 (0)