build: turn tests off by default in catkin and standalone builds

BUILD_ROBOT_TIME_TESTS now defaults to OFF in both build modes instead of following
BUILDING_WITH_CATKIN. Enable the tests with -DBUILD_ROBOT_TIME_TESTS=ON.
This commit is contained in:
2026-11-17 20:36:11 +07:00
parent 8c1abcec64
commit f024d105db

View File

@@ -146,11 +146,8 @@ endif()
# ========================================================
# Test executables
# ========================================================
# Tests are a development-machine concern: a catkin workspace is where they run,
# while the standalone CMake build is the robot deployment path and must not
# produce test executables. Force with -DBUILD_ROBOT_TIME_TESTS=ON to build them
# from a standalone build.
option(BUILD_ROBOT_TIME_TESTS "Build the robot_time unit tests" ${BUILDING_WITH_CATKIN})
# Tests are OFF by default in both build modes; enable with -DBUILD_ROBOT_TIME_TESTS=ON.
option(BUILD_ROBOT_TIME_TESTS "Build the robot_time unit tests" OFF)
if(BUILD_ROBOT_TIME_TESTS AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/test/time.cpp)
add_executable(${PROJECT_NAME}_test test/time.cpp)