Add option to disable usage of Python in the tests
This commit is contained in:
@@ -213,6 +213,7 @@ jobs:
|
||||
-D BUILD_TESTING:BOOL=ON
|
||||
-D LAPACKE_WITH_TMG:BOOL=ON
|
||||
-D BUILD_SHARED_LIBS:BOOL=ON
|
||||
-D LAPACK_TESTING_USE_PYTHON:BOOL=OFF
|
||||
|
||||
- name: Build
|
||||
run: cmake --build build --config ${{env.BUILD_TYPE}}
|
||||
@@ -220,5 +221,11 @@ jobs:
|
||||
- name: Test
|
||||
working-directory: ${{github.workspace}}/build
|
||||
run: |
|
||||
ctest -C ${{env.BUILD_TYPE}} --schedule-random -j2 -T memcheck
|
||||
cat valgrind-out.txt
|
||||
ctest -C ${{env.BUILD_TYPE}} --schedule-random -j2 -T memcheck > memcheck.out
|
||||
if tail -n 1 memcheck.out | grep -q "Memory checking results:"; then
|
||||
cat memcheck.out
|
||||
exit 0
|
||||
else
|
||||
cat memcheck.out
|
||||
exit 1
|
||||
fi
|
||||
+2
-1
@@ -46,10 +46,11 @@ if(_is_coverage_build)
|
||||
endif()
|
||||
|
||||
# Use valgrind if it is found
|
||||
option( LAPACK_TESTING_USE_PYTHON "Use Python for testing. Disable it on memory checks." ON )
|
||||
find_program( MEMORYCHECK_COMMAND valgrind )
|
||||
if( MEMORYCHECK_COMMAND )
|
||||
message( STATUS "Found valgrind: ${MEMORYCHECK_COMMAND}" )
|
||||
set( MEMORYCHECK_COMMAND_OPTIONS "--leak-check=full --show-leak-kinds=all --log-file=valgrind-out.txt --track-origins=yes" )
|
||||
set( MEMORYCHECK_COMMAND_OPTIONS "--leak-check=full --show-leak-kinds=all --track-origins=yes" )
|
||||
endif()
|
||||
|
||||
# By default test Fortran compiler complex abs and complex division
|
||||
|
||||
@@ -48,7 +48,8 @@ set(CTEST_CUSTOM_WARNING_EXCEPTION
|
||||
|
||||
# Only run post test if suitable python interpreter was found
|
||||
set(PYTHON_EXECUTABLE @PYTHON_EXECUTABLE@)
|
||||
if(PYTHON_EXECUTABLE)
|
||||
set(LAPACK_TESTING_USE_PYTHON @LAPACK_TESTING_USE_PYTHON@)
|
||||
if(PYTHON_EXECUTABLE AND LAPACK_TESTING_USE_PYTHON)
|
||||
set(CTEST_CUSTOM_POST_TEST "${PYTHON_EXECUTABLE} ./lapack_testing.py -s -d TESTING")
|
||||
endif()
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ add_subdirectory(EIG)
|
||||
|
||||
|
||||
# Only run this test if python 3 is found
|
||||
if(PYTHON_EXECUTABLE)
|
||||
if(PYTHON_EXECUTABLE AND LAPACK_TESTING_USE_PYTHON)
|
||||
message(STATUS "Enabling LAPACK test summary (see TESTING/testing_results.txt)")
|
||||
file(COPY ${LAPACK_SOURCE_DIR}/lapack_testing.py DESTINATION ${LAPACK_BINARY_DIR})
|
||||
add_test(
|
||||
@@ -38,7 +38,7 @@ function(add_lapack_test output input target)
|
||||
-DINTDIR=${CMAKE_CFG_INTDIR}
|
||||
-P "${LAPACK_SOURCE_DIR}/TESTING/runtest.cmake")
|
||||
|
||||
if(PYTHON_EXECUTABLE)
|
||||
if(PYTHON_EXECUTABLE AND LAPACK_TESTING_USE_PYTHON)
|
||||
set_property(
|
||||
TEST LAPACK_Test_Summary
|
||||
APPEND PROPERTY DEPENDS LAPACK-${testName}
|
||||
|
||||
Reference in New Issue
Block a user