Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
googletest
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
googletest
Commits
9ba7946b
Commit
9ba7946b
authored
Aug 30, 2017
by
Herbert Thielen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
create different python based tests for single and multi configuration build generators
parent
47ad2993
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
6 deletions
+18
-6
internal_utils.cmake
googletest/cmake/internal_utils.cmake
+18
-6
No files found.
googletest/cmake/internal_utils.cmake
View file @
9ba7946b
...
@@ -237,20 +237,32 @@ endfunction()
...
@@ -237,20 +237,32 @@ endfunction()
# test/name.py. It does nothing if Python is not installed.
# test/name.py. It does nothing if Python is not installed.
function
(
py_test name
)
function
(
py_test name
)
if
(
PYTHONINTERP_FOUND
)
if
(
PYTHONINTERP_FOUND
)
# ${CMAKE_BINARY_DIR} is known at configuration time, so we can
# directly bind it from cmake. ${CTEST_CONFIGURATION_TYPE} is known
# only at ctest runtime (by calling ctest -c <Configuration>), so
# we have to escape $ to delay variable substitution here.
if
(
${
CMAKE_MAJOR_VERSION
}
.
${
CMAKE_MINOR_VERSION
}
GREATER 3.1
)
if
(
${
CMAKE_MAJOR_VERSION
}
.
${
CMAKE_MINOR_VERSION
}
GREATER 3.1
)
if
(
CMAKE_CONFIGURATION_TYPES
)
# Multi-configuration build generators as for Visual Studio save
# output in a subdirectory of CMAKE_CURRENT_BINARY_DIR (Debug,
# Release etc.), so we have to provide it here.
add_test
(
NAME
${
name
}
COMMAND
${
PYTHON_EXECUTABLE
}
${
CMAKE_CURRENT_SOURCE_DIR
}
/test/
${
name
}
.py
--build_dir=
${
CMAKE_CURRENT_BINARY_DIR
}
/$<CONFIG>
)
else
(
CMAKE_CONFIGURATION_TYPES
)
# Single-configuration build generators like Makefile generators
# don't have subdirs below CMAKE_CURRENT_BINARY_DIR.
add_test
(
add_test
(
NAME
${
name
}
NAME
${
name
}
COMMAND
${
PYTHON_EXECUTABLE
}
${
CMAKE_CURRENT_SOURCE_DIR
}
/test/
${
name
}
.py
COMMAND
${
PYTHON_EXECUTABLE
}
${
CMAKE_CURRENT_SOURCE_DIR
}
/test/
${
name
}
.py
--build_dir=
${
CMAKE_CURRENT_BINARY_DIR
}
/$<CONFIGURATION>
)
--build_dir=
${
CMAKE_CURRENT_BINARY_DIR
}
)
endif
(
CMAKE_CONFIGURATION_TYPES
)
else
(
${
CMAKE_MAJOR_VERSION
}
.
${
CMAKE_MINOR_VERSION
}
GREATER 3.1
)
else
(
${
CMAKE_MAJOR_VERSION
}
.
${
CMAKE_MINOR_VERSION
}
GREATER 3.1
)
# ${CMAKE_CURRENT_BINARY_DIR} is known at configuration time, so we can
# directly bind it from cmake. ${CTEST_CONFIGURATION_TYPE} is known
# only at ctest runtime (by calling ctest -c <Configuration>), so
# we have to escape $ to delay variable substitution here.
add_test
(
add_test
(
${
name
}
${
name
}
${
PYTHON_EXECUTABLE
}
${
CMAKE_CURRENT_SOURCE_DIR
}
/test/
${
name
}
.py
${
PYTHON_EXECUTABLE
}
${
CMAKE_CURRENT_SOURCE_DIR
}
/test/
${
name
}
.py
--build_dir=
${
CMAKE_CURRENT_BINARY_DIR
}
/\
${
CTEST_CONFIGURATION_TYPE
}
)
--build_dir=
${
CMAKE_CURRENT_BINARY_DIR
}
/\
${
CTEST_CONFIGURATION_TYPE
}
)
endif
(
${
CMAKE_MAJOR_VERSION
}
.
${
CMAKE_MINOR_VERSION
}
GREATER 3.1
)
endif
(
${
CMAKE_MAJOR_VERSION
}
.
${
CMAKE_MINOR_VERSION
}
GREATER 3.1
)
endif
()
endif
(
PYTHONINTERP_FOUND
)
endfunction
()
endfunction
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment