-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Re #5767. Move creation of unit test targets into new CMakeLists
...in test directory. This means that any include paths needed for the unit tests are not also added to the main library build command. The unit test files are still declared in the same place so that people only need to edit one file when adding a class.
- Loading branch information
1 parent
cb2d95b
commit 86d69df
Showing
31 changed files
with
1,067 additions
and
1,039 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
if ( CXXTEST_FOUND ) | ||
include_directories ( ../../TestHelpers/inc ) | ||
# This variable is used within the cxxtest_add_test macro to build these helper classes into the test executable. | ||
# It will go out of scope at the end of this file so doesn't need un-setting | ||
set ( TESTHELPER_SRCS ../../TestHelpers/src/ComponentCreationHelper.cpp ) | ||
|
||
if ( GMOCK_FOUND AND GTEST_FOUND ) | ||
cxxtest_add_test ( APITest ${TEST_FILES} ${GMOCK_TEST_FILES}) | ||
target_link_libraries( APITest API ${GMOCK_LIBRARIES} ${GTEST_LIBRARIES} ) | ||
else () | ||
cxxtest_add_test ( APITest ${TEST_FILES} ) | ||
target_link_libraries( APITest API ) | ||
endif() | ||
add_dependencies ( FrameworkTests APITest ) | ||
# Add to the 'FrameworkTests' group in VS | ||
set_property ( TARGET APITest PROPERTY FOLDER "UnitTests" ) | ||
endif () |
Oops, something went wrong.