Allow automatic tests discovery
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -44,6 +44,7 @@ install_manifest.txt
|
||||
OpenSCAD_rc.py
|
||||
tags
|
||||
/CMakeUserPresets.json
|
||||
Testing
|
||||
|
||||
# crowdin file
|
||||
src/Tools/freecad.zip
|
||||
|
||||
@@ -107,6 +107,8 @@ if(MSVC AND FREECAD_LIBPACK_USE AND LIBPACK_FOUND)
|
||||
endif()
|
||||
|
||||
if (ENABLE_DEVELOPER_TESTS)
|
||||
include(CTest)
|
||||
enable_testing()
|
||||
add_subdirectory(tests)
|
||||
endif()
|
||||
|
||||
|
||||
@@ -77,8 +77,10 @@ add_executable(Mesh_tests_run)
|
||||
add_executable(Part_tests_run)
|
||||
add_executable(Points_tests_run)
|
||||
add_executable(Sketcher_tests_run)
|
||||
|
||||
add_subdirectory(lib)
|
||||
add_subdirectory(src)
|
||||
|
||||
target_include_directories(Tests_run PUBLIC
|
||||
${Python3_INCLUDE_DIRS}
|
||||
${XercesC_INCLUDE_DIRS}
|
||||
@@ -89,3 +91,13 @@ target_link_libraries(Tests_run
|
||||
${Google_Tests_LIBS}
|
||||
FreeCADApp
|
||||
)
|
||||
|
||||
include(GoogleTest)
|
||||
# discovers tests by asking the compiled test executable to enumerate its tests
|
||||
set(CMAKE_GTEST_DISCOVER_TESTS_DISCOVERY_MODE PRE_TEST)
|
||||
gtest_discover_tests(Tests_run)
|
||||
gtest_discover_tests(Material_tests_run)
|
||||
gtest_discover_tests(Mesh_tests_run)
|
||||
gtest_discover_tests(Part_tests_run)
|
||||
gtest_discover_tests(Points_tests_run)
|
||||
gtest_discover_tests(Sketcher_tests_run)
|
||||
Reference in New Issue
Block a user