Skip to content

Commit

Permalink
gtest cmake: fix unit test filter
Browse files Browse the repository at this point in the history
  • Loading branch information
MaEtUgR authored and dagar committed Nov 20, 2024
1 parent 129c0f1 commit 1aadbf8
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -408,14 +408,15 @@ include(px4_add_gtest)
if(BUILD_TESTING)
include(gtest)

set(TESTFILTERARG "")

# Ensure there's no -R without any filter expression since that trips newer ctest versions
if(TESTFILTER)
set(TESTFILTERARG "-R ${TESTFILTER}")
set(TESTFILTERARG "-R")
else()
set(TESTFILTERARG "")
endif()

add_custom_target(test_results
COMMAND GTEST_COLOR=1 ${CMAKE_CTEST_COMMAND} --output-on-failure -T Test ${TESTFILTERARG}
COMMAND GTEST_COLOR=1 ${CMAKE_CTEST_COMMAND} --output-on-failure -T Test ${TESTFILTERARG} ${TESTFILTER}
DEPENDS
px4
examples__dyn_hello
Expand Down

0 comments on commit 1aadbf8

Please sign in to comment.