upm/tests/unit/CMakeLists.txt
Noel Eck 7254d5f75e gtest: Added custom target for all unit tests
Create a target which depends on all unit test executables for ease of
building/running.

Signed-off-by: Noel Eck <noel.eck@intel.com>
2018-03-13 15:08:15 -07:00

28 lines
847 B
CMake

# For now, Google Test is NOT required */
find_package(GTest)
# If not found, print a status message and return
if(NOT GTEST_FOUND)
message(STATUS "Install Google Test to enable additional unit testing")
return ()
endif()
# Unit tests - utilities library
add_executable(utilities_tests utilities/utilities_tests.cxx)
target_link_libraries(utilities_tests utilities GTest::GTest GTest::Main)
gtest_add_tests(utilities_tests "" AUTO)
# Unit tests - Json header
add_executable(json_tests json/json_tests.cxx)
target_link_libraries(json_tests GTest::GTest GTest::Main)
target_include_directories(json_tests PRIVATE "${UPM_COMMON_HEADER_DIRS}/")
gtest_add_tests(json_tests "" AUTO)
# Add a custom target for unit tests
add_custom_target(tests-unit ALL
DEPENDS
utilities_tests
json_tests
COMMENT "UPM unit test collection")