Skip to content

Commit

Permalink
Add CMake mechanism to disable memory tests: -DENABLE_MEMORY_TESTS=OFF
Browse files Browse the repository at this point in the history
  • Loading branch information
wdeconinck committed Sep 7, 2023
1 parent 39a1bf7 commit f7a9608
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ if( HAVE_TRANSI )
ecbuild_debug_var( EC_HAVE_MALLOC_H )


if( EC_HAVE_MALLOC_H AND NOT CMAKE_Fortran_COMPILER_ID MATCHES "Cray" )
if( EC_HAVE_MALLOC_H )
list( APPEND TEST_DEFINITIONS
TRANSI_HAVE_MEMORY
)
Expand Down Expand Up @@ -178,4 +178,11 @@ if( HAVE_TRANSI )
LIBS ectrans_test
ENVIRONMENT TRANS_USE_MPI=0 )

if( HAVE_TESTS )
ecbuild_add_option( FEATURE MEMORY_TESTS DEFAULT ON DESCRIPTION "Enable memory tests" )
if( NOT HAVE_MEMORY_TESTS )
set_tests_properties( ectrans_test_transi_memory ectrans_test_transi_memory_lonlat PROPERTIES DISABLED ON )
endif()
endif()

endif()

0 comments on commit f7a9608

Please sign in to comment.