]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Testsuite: Remove compiler constraints
authorMatthias Maier <tamiko@43-1.org>
Sun, 30 Aug 2015 02:47:54 +0000 (21:47 -0500)
committerMatthias Maier <tamiko@43-1.org>
Sun, 30 Aug 2015 18:17:00 +0000 (13:17 -0500)
compiler constraints are a failed concept.

They try to provide "variants" for platform dependent and compiler
dependent output by means of awkward constraints that lead to unmanageable
complex conditions. Just imagine a three variant test:

  test.compiler=Intel=false.compiler=GNU=true.output
  test.compiler=Intel=true.compiler=GNU=false.output
  test.compiler=Intel=false.compiler=GNU=false.output

Now, add two more variants (e.g. depending on an compiler version)... it is
much more natural to just have output files like those:

  test.output
  test.output.gnu
  test.output.icc

(or whatever naming convention is imposed)

cmake/macros/macro_deal_ii_pickup_tests.cmake
doc/developers/testsuite.html

index f8730ff37ad72d4839b2d5c84585d6c689e58b11..561fe8d4dd41b466736f5e378f237f51c5b56311 100644 (file)
@@ -147,71 +147,12 @@ MACRO(DEAL_II_PICKUP_TESTS)
       SET(_define_test FALSE)
     ENDIF()
 
-    #
-    # Respect compiler constraints:
-    #
-
-    STRING(REGEX MATCHALL
-      "compiler=[a-zA-Z]*(>=|<=|=|>|<)(on|off|yes|no|true|false|[0-9]+(\\.[0-9]+)*)" _matches ${_test}
-      )
-
-    FOREACH(_match ${_matches})
-      #
-      # Extract compiler name, comparison operator, (a possible) boolean and
-      # (a possible) version number from the feature constraint:
-      #
-      STRING(REGEX REPLACE
-        "^compiler=([a-zA-Z]*)(=|>=|<=|>|<).*$" "\\1" _compiler ${_match}
-        )
-      STRING(REGEX REPLACE "^compiler=[a-zA-Z]*(>=|<=|=|>|<).*$" "\\1"  _operator ${_match})
-      STRING(REGEX MATCH "(on|off|yes|no|true|false)$" _boolean ${_match})
-      STRING(REGEX MATCH "([0-9]+(\\.[0-9]+)*)$" _version ${_match})
-
-      #
-      # First process simple yes/no feature constraints:
-      #
-      IF(NOT "${_boolean}" STREQUAL "")
-        IF(NOT "${_operator}" STREQUAL "=")
-          MESSAGE(FATAL_ERROR "
-Invalid syntax in constraint \"${_match}\" in file
-\"${_comparison}\":
-Comparison operator \"=\" expected for boolean match.\n"
-            )
-        ENDIF()
-
-        # This is why I hate CMake :-/
-        IF( ( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "${_compiler}" AND NOT ${_boolean} ) OR
-            ( NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "${_compiler}" AND ${_boolean} ) )
-          SET(_define_test FALSE)
-        ENDIF()
-      ENDIF()
-
-      #
-      # Process version constraints:
-      #
-      IF(NOT "${_version}" STREQUAL "")
-
-        IF( ( NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "${_compiler}" ) OR
-            ( "${_operator}" STREQUAL "=" AND
-              NOT "${CMAKE_CXX_COMPILER_VERSION}" VERSION_EQUAL "${_version}" ) OR
-            ( "${_operator}" STREQUAL ">" AND
-              NOT "${CMAKE_CXX_COMPILER_VERSION}" VERSION_GREATER "${_version}" ) OR
-            ( "${_operator}" STREQUAL "<" AND
-              NOT "${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS "${_version}" ) OR
-            ( "${_operator}" STREQUAL ">=" AND
-              "${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS "${_version}" ) OR
-            ( "${_operator}" STREQUAL "<=" AND
-                    "${CMAKE_CXX_COMPILER_VERSION}" VERSION_GREATER "${_version}" ) )
-          SET(_define_test FALSE)
-        ENDIF()
-      ENDIF()
-    ENDFOREACH()
-
     # Disable tests using mpirun if MPI is not enabled
     STRING(REGEX MATCH "mpirun=" _matches ${_test})
     IF (_matches AND NOT DEAL_II_WITH_MPI)
       SET(_define_test FALSE)
     ENDIF()
+
     #
     # Query configuration and check whether we support it. Otherwise
     # set _define_test to FALSE:
index 2ef7985f70ac2f5d55e276362f7308b227703895..6e3b527757d887e212885dac39a5c0fe186c249a 100644 (file)
@@ -48,7 +48,6 @@
         <li><a href="#layout">Testsuite development</a></li>
         <ol>
           <li><a href="#layoutgeneral">General layout</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>
@@ -427,8 +426,7 @@ category/test.output
       Comparison file can actually be named in a more complex way than
       just <code>category/test.output</code>. In pseudo code:
 <pre>
-category/test.[compiler=&lt;string&gt;(&lt;=|&gt;=|=|&lt;|&gt;)&lt;yes|no|version&gt;.]*
-              [with_&lt;string&gt;(&lt;=|&gt;=|=|&lt;|&gt;)&lt;on|off|version&gt;.]*
+category/test.[with_&lt;string&gt;(&lt;=|&gt;=|=|&lt;|&gt;)&lt;on|off|version&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
@@ -451,30 +449,6 @@ 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=GNU=no.output, or
-category/test.compiler=Intel&gt;=15.0.3.output
-</pre>
-      The first test will only be set up if the specified compiler string
-      (in this case <code>GNU</code>) is equal to the string
-      <code>${CMAKE_CXX_COMPILER_ID}</code>. Similarly, the second test
-      will be set up if both strings are different. Common compiler names
-      are <code>GNU</code>, <code>Clang</code>, or <code>Intel</code>.
-    </p>
-    <p>
-      The third declaration is an example of how to specify a version
-      constraint: This test will be set up if deal.II is configured with
-      the Intel compiler version 15.0.3 or higher. The operators
-      <code>=</code>, <code>&lt;</code>, <code>&gt;</code>, <code>&lt;=</code>,
-      <code>&gt;</code>= are supported.
-    </p>
-
     <a name="restrictfeature"></a>
     <h3>Restricting tests to feature configurations</h3>
     <p>

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.