diff --git a/CMakeLists.txt b/CMakeLists.txt index 6e6be184ab..ee42c30777 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -415,6 +415,9 @@ endif() # optionally enable cmake testing (supported only on posix) option(CMAKE_TESTING "Configure test targets" OFF) +if (${PX4_CONFIG} STREQUAL "px4_sitl_test") + set(CMAKE_TESTING ON) +endif() if(CMAKE_TESTING) include(CTest) # sets BUILD_TESTING variable endif() diff --git a/Makefile b/Makefile index 0c378cffe0..d88572e7af 100644 --- a/Makefile +++ b/Makefile @@ -344,7 +344,6 @@ format: .PHONY: rostest python_coverage tests: - $(eval CMAKE_ARGS += -DCMAKE_TESTING=ON) $(eval CMAKE_ARGS += -DCONFIG=px4_sitl_test) $(eval CMAKE_ARGS += -DTESTFILTER=$(TESTFILTER)) $(eval ARGS += test_results)