]> git.lyx.org Git - features.git/commitdiff
ctests: allow excluding patterns
authorScott Kostyshak <skostysh@lyx.org>
Mon, 15 Jan 2018 21:25:44 +0000 (16:25 -0500)
committerScott Kostyshak <skostysh@lyx.org>
Mon, 15 Jan 2018 21:32:05 +0000 (16:32 -0500)
This allows us to exclude matches of certain patterns in
invertedTests, ignoredTests, unreliableTests, and suspendedTests.

To use this new functionality, prefix "!" to the pattern.

This functionality serves as a workaround in some cases to not being
able to use advanced regular expression techniques, such as
"negative lookahead", with CMake's regular expression engine.

Output of "ctest -N" is unchanged by this commit.

This functionality will be used soon (see next commits).

Patch from Kornel Benko.

development/autotests/ExportTests.cmake

index 0a94e16dbb37a2f0852795ce62f656ea0ffb91ff..fb7a01e48aae6ab098c52b6adc564f3056982bce 100644 (file)
@@ -98,9 +98,15 @@ macro(findexpr found testname listname rsublabel)
       # remove doubles in sublabel
       list(REMOVE_DUPLICATES tmpsublabel)
     else()
-      set(_itr "^${_itrx}$")
+      if (_itrx MATCHES "^!\(.*\)$")
+        set(_itr "^${CMAKE_MATCH_1}$")
+        set(_foundval 0)
+      else()
+        set(_itr "^${_itrx}$")
+        set(_foundval 1)
+      endif()
       if (${testname} MATCHES "${_itr}")
-        set(_found 1)
+        set(_found ${_foundval})
         break()
       endif()
     endif()