From 7c463b3d3d714ff951afbd5d6df3183161c0c986 Mon Sep 17 00:00:00 2001
From: maier
Date: Sat, 30 Nov 2013 14:03:23 +0000
Subject: [PATCH] Testsuite: Add a possiblity to specify compiler and compiler
version restrictions
git-svn-id: https://svn.dealii.org/trunk@31834 0785d39b-7218-0410-832d-ea1e28bc413d
---
deal.II/cmake/macros/macro_pickup_tests.cmake | 24 +++++++++++++++++
deal.II/doc/developers/testsuite.html | 26 +++++++++++++++----
2 files changed, 45 insertions(+), 5 deletions(-)
diff --git a/deal.II/cmake/macros/macro_pickup_tests.cmake b/deal.II/cmake/macros/macro_pickup_tests.cmake
index 5db7a1a1b1..69a3950b97 100644
--- a/deal.II/cmake/macros/macro_pickup_tests.cmake
+++ b/deal.II/cmake/macros/macro_pickup_tests.cmake
@@ -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:
diff --git a/deal.II/doc/developers/testsuite.html b/deal.II/doc/developers/testsuite.html
index 88a52cce34..3c55dae252 100644
--- a/deal.II/doc/developers/testsuite.html
+++ b/deal.II/doc/developers/testsuite.html
@@ -60,8 +60,9 @@
Testsuite development
- General layout
- - Restricting tests for build configurations
- - Restricting tests for feature configurations
+ - Restricting tests to specific compiler and compiler versions
+ - Restricting tests to build configurations
+ - Restricting tests to feature configurations
- Running tests with MPI
- Tests with binary output
- Changing condition for success
@@ -422,13 +423,13 @@ category/test.output
- Restricting tests for build configurations
+ Restricting tests to build configurations
Comparison file can actually be named in a more complex way than
just category/test.output
:
-category/test.[with_<feature>=<on|off>.]*[mpirun=<x>.][expect=<y>.][binary.][<debug|release>.]output
+category/test.[compiler=<regex>=<yes|no>.]*[with_<feature>=<on|off>.]*[mpirun=<x>.][expect=<y>.][binary.][<debug|release>.]output
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
+
+ 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=ICC-14=no.output
+
+ These tests will only be set up if the specified regular expression
+ matches (in case of =yes
), or doesn't match
+ (=no
) the string
+ ${CMAKE_CXX_COMPILER_ID}-${CMAKE_CXX_COMPILER_VERSION}
.
+ Common compiler names are GNU
, Clang
or
+ Intel
.
- Restricting tests for feature configurations
+ Restricting tests to feature configurations
In a similar vain as for build configurations, it is possible to restrict
tests to specific feature configurations, e.g.:
--
2.39.5