]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Testsuite: Add a possiblity to specify compiler and compiler version restrictions
authormaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Sat, 30 Nov 2013 14:03:23 +0000 (14:03 +0000)
committermaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Sat, 30 Nov 2013 14:03:23 +0000 (14:03 +0000)
git-svn-id: https://svn.dealii.org/trunk@31834 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/cmake/macros/macro_pickup_tests.cmake
deal.II/doc/developers/testsuite.html

index 5db7a1a1b177af48cdd3e029f83b1513aed467c4..69a3950b976a5b176f10305586bb15cd1ef29004 100644 (file)
@@ -51,6 +51,30 @@ MACRO(DEAL_II_PICKUP_TESTS)
       SET(_define_test FALSE)
     ENDIF()
 
+    #
+    # Respect compiler constraint:
+    #
+
+    STRING(REGEX MATCHALL
+      "compiler=[^=]*=(on|off|yes|no|true|false)" _matches ${_test}
+      )
+    FOREACH(_match ${_matches})
+      STRING(REGEX REPLACE
+        "^compiler=([^=]*)=(on|off|yes|no|true|false)$" "\\1"
+        _compiler ${_match}
+        )
+      STRING(REGEX MATCH "(on|off|yes|no|true|false)$" _boolean ${_match})
+
+      IF( ( "${CMAKE_CXX_COMPILER_ID}-${CMAKE_CXX_COMPILER_VERSION}"
+              MATCHES "^${_compiler}"
+            AND NOT ${_boolean} )
+          OR ( NOT "${CMAKE_CXX_COMPILER_ID}-${CMAKE_CXX_COMPILER_VERSION}"
+                   MATCHES "^${_compiler}"
+               AND ${_boolean} ) )
+        SET(_define_test FALSE)
+      ENDIF()
+    ENDFOREACH()
+
     #
     # Query configuration and check whether we support it. Otherwise
     # set _define_test to FALSE:
index 88a52cce3401a136332810961491f8632876766f..3c55dae252026d2d98ab12fab6135d4aa9f5fb6b 100644 (file)
@@ -60,8 +60,9 @@
         <li><a href="#layout">Testsuite development</a></li>
         <ol>
           <li><a href="#layoutgeneral">General layout</a></li>
-          <li><a href="#restrictbuild">Restricting tests for build configurations</a></li>
-          <li><a href="#restrictfeature">Restricting tests for feature configurations</a></li>
+          <li><a href="#restrictcompiler">Restricting tests to specific compiler and compiler versions</a></li>
+          <li><a href="#restrictbuild">Restricting tests to build configurations</a></li>
+          <li><a href="#restrictfeature">Restricting tests to feature configurations</a></li>
           <li><a href="#mpi">Running tests with MPI</a></li>
           <li><a href="#binary">Tests with binary output</a></li>
           <li><a href="#expect">Changing condition for success</a></li>
@@ -422,13 +423,13 @@ category/test.output
 
 
     <a name="restrictbuild"></a>
-    <h3>Restricting tests for build configurations</h3>
+    <h3>Restricting tests to build configurations</h3>
 
     <p>
       Comparison file can actually be named in a more complex way than
       just <code>category/test.output</code>:
 <pre>
-category/test.[with_&lt;feature&gt;=&lt;on|off&gt;.]*[mpirun=&lt;x&gt;.][expect=&lt;y&gt;.][binary.][&lt;debug|release&gt;.]output
+category/test.[compiler=&lt;regex&gt;=&lt;yes|no&gt;.]*[with_&lt;feature&gt;=&lt;on|off&gt;.]*[mpirun=&lt;x&gt;.][expect=&lt;y&gt;.][binary.][&lt;debug|release&gt;.]output
 </pre>
       Normally, a test will be set up so that it runs twice, once in debug and
       once in release configuration.
@@ -450,9 +451,24 @@ category/test.release.output
 </pre>
     </p>
 
+    <a name="restrictcompiler"></a>
+    <h3>Restricting tests to specific compiler and compiler versions</h3>
+    <p>
+      In a similar vain as for build configurations, it is possible to restrict
+      tests to specific compiler versions, e.g.:
+<pre>
+category/test.compiler=GNU=yes.output, or
+category/test.compiler=ICC-14=no.output
+</pre>
+      These tests will only be set up if the specified regular expression
+      matches (in case of <code>=yes</code>), or doesn't match
+      (<code>=no</code>) the string
+      <code>${CMAKE_CXX_COMPILER_ID}-${CMAKE_CXX_COMPILER_VERSION}</code>.
+      Common compiler names are <code>GNU</code>, <code>Clang</code> or
+      <code>Intel</code>.
 
     <a name="restrictfeature"></a>
-    <h3>Restricting tests for feature configurations</h3>
+    <h3>Restricting tests to feature configurations</h3>
     <p>
       In a similar vain as for build configurations, it is possible to restrict
       tests to specific feature configurations, e.g.:

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.