ENH: Only run python summary tests with compatible versions
authorHans Johnson <hans-johnson@uiowa.edu>
Fri, 29 Jul 2016 11:06:50 +0000 (06:06 -0500)
committerHans Johnson <hans-johnson@uiowa.edu>
Fri, 29 Jul 2016 11:10:08 +0000 (06:10 -0500)
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
CTestCustom.cmake.in
TESTING/CMakeLists.txt

index ae2bd2d..b542f1a 100644 (file)
@@ -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()
 # --------------------------------------------------
 
index 19469af..5fc823a 100644 (file)
@@ -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()
+
index 2d58737..cf710ee 100644 (file)
@@ -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()