GoogleTest: Reports skipped test with gtest_add_tests

Skipped GTests were reported as success when tests where added with gtest_add_tests. This fixes this behaviour.

Fixes: #24130
This commit is contained in:
DavidPerretSN
2022-11-04 03:13:20 -04:00
committed by David Perret
parent 182ef53d3d
commit f54963e60f
4 changed files with 21 additions and 1 deletions

View File

@@ -405,6 +405,12 @@ function(gtest_add_tests)
--gtest_filter=${gtest_test_name}
${ARGS_EXTRA_ARGS}
)
# Makes sure a skipped GTest is reported as so by CTest
set_tests_properties(
${ctest_test_name}
PROPERTIES
SKIP_REGULAR_EXPRESSION "\\[ SKIPPED \\]"
)
list(APPEND testList ${ctest_test_name})
endif()
endforeach()