瀏覽代碼

GoogleTest: Add support for skipped tests

Skipped tests are currently reported as successful. Using
SKIP_REGULAR_EXPRESSION on googletest's output prefix, skipped tests can
be detected and accounted accordingly.
Using SKIP_RETURN_CODE is not possible, googletests exit code is not
affected by skipped tests.

Fixes: #19669
Alexander Stein 5 年之前
父節點
當前提交
98868dad1c
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      Modules/GoogleTestAddTests.cmake

+ 1 - 0
Modules/GoogleTestAddTests.cmake

@@ -134,6 +134,7 @@ function(gtest_discover_tests_impl)
           "${prefix}${pretty_suite}.${pretty_test}${suffix}"
           PROPERTIES
           WORKING_DIRECTORY "${_TEST_WORKING_DIR}"
+          SKIP_REGULAR_EXPRESSION "\\\\[  SKIPPED \\\\]"
           ${properties}
         )
         list(APPEND tests_buffer "${prefix}${pretty_suite}.${pretty_test}${suffix}")