Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Project_Phoenix
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LuFG VR VIS
VR-Group
Project_Phoenix
Commits
e2f69000
Commit
e2f69000
authored
Mar 22, 2018
by
Thomas Vierjahn
Browse files
Options
Downloads
Patches
Plain Diff
Move add_mock_lib to add_mock into Testing.cmake, use named params
#250, #251
parent
c549d3f3
No related branches found
No related tags found
1 merge request
!128
Feature/#251 make sure tests cpp is compiled once
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
cmake/Testing.cmake
+20
-1
20 additions, 1 deletion
cmake/Testing.cmake
tests/CMakeLists.txt
+13
-15
13 additions, 15 deletions
tests/CMakeLists.txt
with
33 additions
and
16 deletions
cmake/Testing.cmake
+
20
−
1
View file @
e2f69000
...
...
@@ -155,7 +155,6 @@ function(CONFIGURE_TEST_)
endfunction
()
function
(
TESTING__SET_TIMEOUT_ TARGET
)
if
(
NOT
${
TARGET
}
MATCHES
"integration"
)
set_tests_properties
(
${
TARGET
}
PROPERTIES TIMEOUT 10.0
)
...
...
@@ -165,6 +164,26 @@ function(TESTING__SET_TIMEOUT_ TARGET)
endfunction
()
macro
(
ADD_MOCK
)
#mock_name mock_src_path)
set
(
options
)
set
(
oneValueArgs NAME
)
set
(
multiValueArgs SOURCES HEADERS
)
cmake_parse_arguments
(
ADD_MOCK_
"
${
options
}
"
"
${
oneValueArgs
}
"
"
${
multiValueArgs
}
"
${
ARGN
}
)
add_library
(
${
ADD_MOCK__NAME
}
SHARED
${
ADD_MOCK__SOURCES
}
${
ADD_MOCK__HEADERS
}
)
target_link_libraries
(
${
ADD_MOCK__NAME
}
${
CONAN_OR_CMAKE_trompeloeil
}
)
#phx include dirs needed for suppress_warnings.hpp
target_include_directories
(
${
ADD_MOCK__NAME
}
PRIVATE
${
phoenix_include_directories
}
)
set_property
(
TARGET
${
ADD_MOCK__NAME
}
PROPERTY FOLDER
"Tests"
)
set_warning_levels_rwth
(
${
ADD_MOCK__NAME
}
)
endmacro
()
#-------------------------------------------------------------------------------
...
...
This diff is collapsed.
Click to expand it.
tests/CMakeLists.txt
+
13
−
15
View file @
e2f69000
...
...
@@ -56,19 +56,7 @@ get_target_property(gl_include_directories
${
CONAN_OR_CMAKE_gl
}
INTERFACE_INCLUDE_DIRECTORIES
)
macro
(
add_mock_lib mock_name mock_src_path
)
add_library
(
${
mock_name
}
SHARED
${
mock_src_path
}
/
${
mock_name
}
.cpp
${
mock_src_path
}
/
${
mock_name
}
.hpp
)
target_link_libraries
(
${
mock_name
}
${
CONAN_OR_CMAKE_trompeloeil
}
)
#phx include dirs needed for suppress_warnings.hpp
target_include_directories
(
${
mock_name
}
PRIVATE
${
phoenix_include_directories
}
)
set_property
(
TARGET
${
mock_name
}
PROPERTY FOLDER
"Tests"
)
set_warning_levels_rwth
(
${
mock_name
}
)
endmacro
()
# generate opengl_mock
set
(
OPENGL_MOCK_SOURCE
${
CMAKE_CURRENT_BINARY_DIR
}
/mocks
)
...
...
@@ -84,7 +72,12 @@ if( NOT EXISTS ${OPENGL_MOCK_SOURCE}/opengl_mock.cpp OR
-t
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/src/mocks/generation/"
)
endif
()
add_mock_lib
(
opengl_mock
${
OPENGL_MOCK_SOURCE
}
)
add_mock
(
NAME opengl_mock
SOURCES
${
CMAKE_CURRENT_BINARY_DIR
}
/mocks/opengl_mock.cpp
HEADERS
${
CMAKE_CURRENT_BINARY_DIR
}
/mocks/opengl_mock.hpp
)
#add_mock_lib(opengl_mock ${OPENGL_MOCK_SOURCE})
target_include_directories
(
opengl_mock
PUBLIC
${
OPENGL_MOCK_SOURCE
}
PUBLIC
${
glew_include_directories
}
)
...
...
@@ -95,7 +88,12 @@ generate_export_header(opengl_mock
)
# generate openvr_mock
add_mock_lib
(
openvr_mock
${
CMAKE_CURRENT_SOURCE_DIR
}
/src/mocks
)
add_mock
(
NAME openvr_mock
SOURCES
${
CMAKE_CURRENT_SOURCE_DIR
}
/src/mocks/openvr_mock.cpp
HEADERS
${
CMAKE_CURRENT_SOURCE_DIR
}
/src/mocks/openvr_mock.hpp
)
#add_mock_lib(openvr_mock ${CMAKE_CURRENT_SOURCE_DIR}/src/mocks)
target_include_directories
(
openvr_mock
PUBLIC
${
CMAKE_CURRENT_SOURCE_DIR
}
/src
PUBLIC
${
CMAKE_CURRENT_BINARY_DIR
}
/mocks
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment