Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include CTest for BUILD_TESTING option #1819

Merged
merged 2 commits into from
Jun 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -379,11 +379,13 @@ set(DART_IN_SOURCE_BUILD TRUE)
if(TARGET dart)

# Add a "tests" target to build unit tests.
enable_testing()
if(MSVC)
add_subdirectory(tests)
else()
add_subdirectory(tests EXCLUDE_FROM_ALL)
include(CTest)
if (BUILD_TESTING)
if(MSVC)
add_subdirectory(tests)
else()
add_subdirectory(tests EXCLUDE_FROM_ALL)
endif()
endif()

# Add example subdirectories and an "examples" target.
Expand Down Expand Up @@ -431,7 +433,10 @@ endif()
add_subdirectory(python)

# Add 'ALL' target that builds everything
set(all_target_candidates tests_and_run dartpy pytest)
set(all_target_candidates dartpy)
if (BUILD_TESTING)
list(APPEND all_target_candidates tests_and_run pytest)
endif()
foreach(target_candidate ${all_target_candidates})
if(TARGET ${target_candidate})
list(APPEND all_targets ${target_candidate})
Expand Down Expand Up @@ -687,7 +692,9 @@ endif()
#===============================================================================
message(STATUS "")
message(STATUS "Run 'make' to build all the components")
message(STATUS "Run 'make tests' to build all the tests")
if (BUILD_TESTING)
message(STATUS "Run 'make tests' to build all the tests")
endif()
message(STATUS "Run 'make examples' to build all the examples")
message(STATUS "Run 'make tutorials' to build all the tutorials")
message(STATUS "Run 'make view_docs' to see the API documentation")
Expand Down
Loading