From c6e24106168f718376372fb85e8ef4b232412903 Mon Sep 17 00:00:00 2001 From: Hans Johnson Date: Fri, 29 Jul 2016 06:06:50 -0500 Subject: [PATCH] ENH: Only run python summary tests with compatible versions The summary tests python script requires features that are only available in python 2.7 and greater. If the python version is insufficient, simply disable the summary tests. This was identified on a nightly dashboard build zoot.icl.utk.edu where the python version found is 2.4. --- CMakeLists.txt | 8 +++++--- CTestCustom.cmake.in | 8 +++++++- TESTING/CMakeLists.txt | 17 ++++++++++------- 3 files changed, 22 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ae2bd2d3..b542f1af 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -37,7 +37,7 @@ set( configure_file( "${LAPACK_SOURCE_DIR}/CTestCustom.cmake.in" "${LAPACK_BINARY_DIR}/CTestCustom.cmake" - COPYONLY + @ONLY ) # Add the CMake directory for custon CMake modules @@ -85,10 +85,12 @@ if ( CMAKE_Fortran_COMPILER_ID STREQUAL "Compaq" ) endif() # Get Python -find_package(PythonInterp) -message(STATUS "Looking for Python found - ${PYTHONINTERP_FOUND}") +message(STATUS "Looking for Python greater than 2.6 - ${PYTHONINTERP_FOUND}") +find_package(PythonInterp 2.7) # lapack_testing.py uses features from python 2.7 and greater if (PYTHONINTERP_FOUND) message(STATUS "Using Python version ${PYTHON_VERSION_STRING}") +else() + message(STATUS "No suitable Python version found, so skipping summary tests.") endif() # -------------------------------------------------- diff --git a/CTestCustom.cmake.in b/CTestCustom.cmake.in index 19469afe..5fc823a7 100644 --- a/CTestCustom.cmake.in +++ b/CTestCustom.cmake.in @@ -43,4 +43,10 @@ set(CTEST_CUSTOM_WARNING_EXCEPTION "Character string truncated to length 1 on assignment" ) -set(CTEST_CUSTOM_POST_TEST "./lapack_testing.py -s -d TESTING") \ No newline at end of file +# Only rung post test if suitable python interpreter was found +set(PYTHONINTERP_FOUND @PYTHONINTERP_FOUND@) +set(PYTHON_EXECUTABLE @PYTHON_EXECUTABLE@) +if(PYTHONINTERP_FOUND) + set(CTEST_CUSTOM_POST_TEST "${PYTHON_EXECUTABLE} ./lapack_testing.py -s -d TESTING") +endif() + diff --git a/TESTING/CMakeLists.txt b/TESTING/CMakeLists.txt index 2d587376..cf710ee7 100644 --- a/TESTING/CMakeLists.txt +++ b/TESTING/CMakeLists.txt @@ -307,10 +307,13 @@ if (BUILD_COMPLEX) endif() # ============================================================================== - -execute_process(COMMAND ${CMAKE_COMMAND} -E copy ${LAPACK_SOURCE_DIR}/lapack_testing.py ${LAPACK_BINARY_DIR}) - add_test( - NAME LAPACK_Test_Summary - WORKING_DIRECTORY ${LAPACK_BINARY_DIR} - COMMAND ${PYTHON_EXECUTABLE} "lapack_testing.py" - ) +# Only run this test if python 2.7 or greater is found +if(PYTHONINTERP_FOUND) + message(STATUS "Running Summary") + execute_process(COMMAND ${CMAKE_COMMAND} -E copy ${LAPACK_SOURCE_DIR}/lapack_testing.py ${LAPACK_BINARY_DIR}) + add_test( + NAME LAPACK_Test_Summary + WORKING_DIRECTORY ${LAPACK_BINARY_DIR} + COMMAND ${PYTHON_EXECUTABLE} "lapack_testing.py" + ) +endif() -- 2.34.1