mirror of https://github.com/OpenMW/openmw.git
Add executable to run CS tests
parent
59f2fccc9f
commit
6f6e452dfa
@ -0,0 +1,31 @@
|
|||||||
|
file(GLOB OPENCS_TESTS_SRC_FILES
|
||||||
|
main.cpp
|
||||||
|
)
|
||||||
|
|
||||||
|
source_group(apps\\openmw-cs-tests FILES ${OPENCS_TESTS_SRC_FILES})
|
||||||
|
|
||||||
|
openmw_add_executable(openmw-cs-tests ${OPENCS_TESTS_SRC_FILES})
|
||||||
|
|
||||||
|
target_include_directories(openmw-cs-tests SYSTEM PRIVATE ${GTEST_INCLUDE_DIRS})
|
||||||
|
target_include_directories(openmw-cs-tests SYSTEM PRIVATE ${GMOCK_INCLUDE_DIRS})
|
||||||
|
|
||||||
|
target_link_libraries(openmw-cs-tests PRIVATE
|
||||||
|
openmw-cs-lib
|
||||||
|
GTest::GTest
|
||||||
|
GMock::GMock
|
||||||
|
)
|
||||||
|
|
||||||
|
if (UNIX AND NOT APPLE)
|
||||||
|
target_link_libraries(openmw-cs-tests PRIVATE ${CMAKE_THREAD_LIBS_INIT})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (BUILD_WITH_CODE_COVERAGE)
|
||||||
|
target_compile_options(openmw-cs-tests PRIVATE --coverage)
|
||||||
|
target_link_libraries(openmw-cs-tests PRIVATE gcov)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.16 AND MSVC)
|
||||||
|
target_precompile_headers(openmw-cs-tests PRIVATE
|
||||||
|
<gtest/gtest.h>
|
||||||
|
)
|
||||||
|
endif()
|
@ -0,0 +1,7 @@
|
|||||||
|
#include <gtest/gtest.h>
|
||||||
|
|
||||||
|
int main(int argc, char* argv[])
|
||||||
|
{
|
||||||
|
testing::InitGoogleTest(&argc, argv);
|
||||||
|
return RUN_ALL_TESTS();
|
||||||
|
}
|
Loading…
Reference in New Issue