mirror of
https://github.com/latentPrion/cppbessot.git
synced 2026-04-17 18:44:23 +00:00
Only build tests if BUILD_TESTING is set
This commit is contained in:
@@ -11,8 +11,12 @@ endif()
|
|||||||
|
|
||||||
include("${CMAKE_CURRENT_SOURCE_DIR}/cmake/CppBeSSOT.cmake")
|
include("${CMAKE_CURRENT_SOURCE_DIR}/cmake/CppBeSSOT.cmake")
|
||||||
|
|
||||||
|
if(NOT DEFINED BUILD_TESTING)
|
||||||
|
set(BUILD_TESTING OFF CACHE BOOL "Build cppbessot tests" FORCE)
|
||||||
|
endif()
|
||||||
|
|
||||||
include(CTest)
|
include(CTest)
|
||||||
|
|
||||||
if(BUILD_TESTING)
|
if(BUILD_TESTING)
|
||||||
add_subdirectory(tests EXCLUDE_FROM_ALL)
|
add_subdirectory(tests)
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ These tests validate that checked-in generated C++ model code can be compiled an
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
git submodule update --init --recursive tests/googletest
|
git submodule update --init --recursive tests/googletest
|
||||||
cmake -S . -B build-tests -DDB_SCHEMA_DIR_TO_GENERATE=test-schema-v1.2
|
cmake -S . -B build-tests -DBUILD_TESTING=ON -DDB_SCHEMA_DIR_TO_GENERATE=test-schema-v1.2
|
||||||
cmake --build build-tests --target cpp_serdes_test_schema_v1_2
|
cmake --build build-tests --target cpp_serdes_test_schema_v1_2
|
||||||
ctest --test-dir build-tests --output-on-failure
|
ctest --test-dir build-tests --output-on-failure
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -3,5 +3,5 @@ if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/googletest/CMakeLists.txt")
|
|||||||
"GoogleTest submodule is missing. Run `git submodule update --init --recursive tests/googletest` from the cppbessot repo root.")
|
"GoogleTest submodule is missing. Run `git submodule update --init --recursive tests/googletest` from the cppbessot repo root.")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_subdirectory(googletest EXCLUDE_FROM_ALL)
|
add_subdirectory(googletest)
|
||||||
add_subdirectory(cpp-serdes EXCLUDE_FROM_ALL)
|
add_subdirectory(cpp-serdes)
|
||||||
|
|||||||
Reference in New Issue
Block a user