mirror of
https://github.com/etlegacy/Update-Installer.git
synced 2025-02-22 11:01:10 +00:00
Register unit tests with CMake
Use add_tests() to register the test binaries with CMake so they can be executed with 'make test'/CTest. MD-19678 #time 10m
This commit is contained in:
parent
39b8ada727
commit
5cd4484f8b
2 changed files with 14 additions and 23 deletions
|
@ -1,6 +1,7 @@
|
|||
project(updater)
|
||||
|
||||
cmake_minimum_required(VERSION 2.6)
|
||||
enable_testing()
|
||||
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules")
|
||||
|
||||
# If the SIGN_UPDATER option is enabled, the updater.exe
|
||||
|
|
|
@ -30,27 +30,17 @@ foreach(TEST_FILE ${TEST_FILES})
|
|||
endforeach()
|
||||
|
||||
# Add unit test binaries
|
||||
add_executable(TestUpdateScript
|
||||
TestUpdateScript.cpp
|
||||
)
|
||||
target_link_libraries(TestUpdateScript
|
||||
updatershared
|
||||
)
|
||||
add_executable(TestUpdaterOptions
|
||||
TestUpdaterOptions.cpp
|
||||
)
|
||||
target_link_libraries(TestUpdaterOptions
|
||||
updatershared
|
||||
)
|
||||
add_executable(TestFileUtils
|
||||
TestFileUtils.cpp
|
||||
)
|
||||
target_link_libraries(TestFileUtils
|
||||
updatershared
|
||||
)
|
||||
|
||||
if (APPLE)
|
||||
set_target_properties(TestUpdateScript PROPERTIES LINK_FLAGS "-framework Security -framework Cocoa")
|
||||
set_target_properties(TestUpdaterOptions PROPERTIES LINK_FLAGS "-framework Security -framework Cocoa")
|
||||
endif()
|
||||
macro(ADD_UPDATER_TEST CLASS)
|
||||
set(TEST_TARGET ${CLASS})
|
||||
add_executable(${TEST_TARGET} ${CLASS}.cpp)
|
||||
target_link_libraries(${TEST_TARGET} updatershared)
|
||||
add_test(${TEST_TARGET} ${TEST_TARGET})
|
||||
if (APPLE)
|
||||
set_target_properties(${TEST_TARGET} PROPERTIES LINK_FLAGS "-framework Security -framework Cocoa")
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
add_updater_test(TestUpdateScript)
|
||||
add_updater_test(TestUpdaterOptions)
|
||||
add_updater_test(TestFileUtils)
|
||||
|
||||
|
|
Loading…
Reference in a new issue