From: maier Date: Sat, 30 Nov 2013 14:03:23 +0000 (+0000) Subject: Testsuite: Add a possiblity to specify compiler and compiler version restrictions X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7c463b3d3d714ff951afbd5d6df3183161c0c986;p=dealii-svn.git 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 --- 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
    1. General layout
    2. -
    3. Restricting tests for build configurations
    4. -
    5. Restricting tests for feature configurations
    6. +
    7. Restricting tests to specific compiler and compiler versions
    8. +
    9. Restricting tests to build configurations
    10. +
    11. Restricting tests to feature configurations
    12. Running tests with MPI
    13. Tests with binary output
    14. Changing condition for success
    15. @@ -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.: