commit 2c20f06d256bda8316faa6ff36f86e52bc7603ea
Author: Scott Kostyshak <skost...@lyx.org>
Date:   Mon Jan 15 16:25:44 2018 -0500

    ctests: allow excluding patterns
    
    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.
    
    (cherry picked from commit 10cd5dd223402e96c2d58a1f4b32d45abccd36ee)
---
 development/autotests/ExportTests.cmake |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/development/autotests/ExportTests.cmake 
b/development/autotests/ExportTests.cmake
index 3aa5767..3b52058 100644
--- a/development/autotests/ExportTests.cmake
+++ b/development/autotests/ExportTests.cmake
@@ -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()

Reply via email to