From d6ef405b484a6ca4cc354f776311141dcab20f22 Mon Sep 17 00:00:00 2001 From: Eugen Betke Date: Fri, 29 Jul 2022 08:37:20 +0000 Subject: [PATCH] ECC-1431: Test language changed from .c to .cpp --- tests/CMakeLists.txt | 23 +++++++++++++++----- tests/{grib_ecc-1431.c => grib_ecc-1431.cpp} | 0 2 files changed, 17 insertions(+), 6 deletions(-) rename tests/{grib_ecc-1431.c => grib_ecc-1431.cpp} (100%) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index ca3307366..ef2f56683 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -8,7 +8,7 @@ execute_process( COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_S # Build the executables used by test scripts ################################################ -list(APPEND test_bins +list(APPEND test_c_bins list_codetable_flagtable_keys grib_bpv_limit grib_double_cmp @@ -49,11 +49,7 @@ list(APPEND test_bins grib_lam_bf grib_lam_gp) -if( HAVE_AEC AND ENABLE_EXTRA_TESTS ) - list(APPEND test_bins grib_ecc-1431) -endif() - -foreach( tool ${test_bins} ) +foreach( tool ${test_c_bins} ) # here we use the fact that each tool has only one C file that matches its name ecbuild_add_executable( TARGET ${tool} NOINSTALL @@ -61,6 +57,21 @@ foreach( tool ${test_bins} ) LIBS eccodes ) endforeach() +if( HAVE_EXPERIMENTAL_BUILD_WITH_CXX ) + if( HAVE_AEC AND ENABLE_EXTRA_TESTS ) + list(APPEND test_cpp_bins grib_ecc-1431) + endif() + + foreach( tool ${test_cpp_bins} ) + # here we use the fact that each tool has only one C file that matches its name + ecbuild_add_executable( TARGET ${tool} + NOINSTALL + SOURCES ${tool}.cpp + LIBS eccodes ) + endforeach() +endif() + + # Now add each test (shell scripts) ################################################# if( HAVE_BUILD_TOOLS ) diff --git a/tests/grib_ecc-1431.c b/tests/grib_ecc-1431.cpp similarity index 100% rename from tests/grib_ecc-1431.c rename to tests/grib_ecc-1431.cpp