From: Matthias Maier
Date: Sun, 30 Aug 2015 02:47:54 +0000 (-0500)
Subject: Testsuite: Remove compiler constraints
X-Git-Tag: v8.4.0-rc2~519^2~4
X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0ee688310463ba5bb491b7694af733f81662e89b;p=dealii.git
Testsuite: Remove compiler constraints
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)
---
diff --git a/cmake/macros/macro_deal_ii_pickup_tests.cmake b/cmake/macros/macro_deal_ii_pickup_tests.cmake
index f8730ff37a..561fe8d4dd 100644
--- a/cmake/macros/macro_deal_ii_pickup_tests.cmake
+++ b/cmake/macros/macro_deal_ii_pickup_tests.cmake
@@ -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:
diff --git a/doc/developers/testsuite.html b/doc/developers/testsuite.html
index 2ef7985f70..6e3b527757 100644
--- a/doc/developers/testsuite.html
+++ b/doc/developers/testsuite.html
@@ -48,7 +48,6 @@
Testsuite development
- General layout
- - Restricting tests to specific compiler and compiler versions
- Restricting tests to build configurations
- Restricting tests to feature configurations
- Running tests with MPI
@@ -427,8 +426,7 @@ category/test.output
Comparison file can actually be named in a more complex way than
just category/test.output
. In pseudo code:
-category/test.[compiler=<string>(<=|>=|=|<|>)<yes|no|version>.]*
- [with_<string>(<=|>=|=|<|>)<on|off|version>.]*
+category/test.[with_<string>(<=|>=|=|<|>)<on|off|version>.]*
[mpirun=<x>.][expect=<y>.][binary.][<debug|release>.]output
Normally, a test will be set up so that it runs twice, once in debug and
@@ -451,30 +449,6 @@ category/test.release.output
-
- Restricting tests to specific compiler and compiler versions
-
- In a similar vain as for build configurations, it is possible to restrict
- tests to specific compiler versions, e.g.:
-
-category/test.compiler=GNU=yes.output, or
-category/test.compiler=GNU=no.output, or
-category/test.compiler=Intel>=15.0.3.output
-
- The first test will only be set up if the specified compiler string
- (in this case GNU
) is equal to the string
- ${CMAKE_CXX_COMPILER_ID}
. Similarly, the second test
- will be set up if both strings are different. Common compiler names
- are GNU
, Clang
, or Intel
.
-
-
- 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
- =
, <
, >
, <=
,
- >
= are supported.
-
-
Restricting tests to feature configurations