From d210b0956ecd6486a7bb2c03bf6e46c5cd68d637 Mon Sep 17 00:00:00 2001 From: Dhanya Thattil Date: Wed, 9 Jul 2025 11:18:13 +0200 Subject: [PATCH] hdf5 definitions in test when not compiled with hdf5 --- slsDetectorSoftware/tests/CMakeLists.txt | 11 ++++++++--- slsDetectorSoftware/tests/Caller/test-Caller-rx.cpp | 2 ++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/slsDetectorSoftware/tests/CMakeLists.txt b/slsDetectorSoftware/tests/CMakeLists.txt index d87f17ed0..6a4c03855 100755 --- a/slsDetectorSoftware/tests/CMakeLists.txt +++ b/slsDetectorSoftware/tests/CMakeLists.txt @@ -24,11 +24,16 @@ target_sources(tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/test-Module.cpp ${CMAKE_CURRENT_SOURCE_DIR}/test-Pattern.cpp ${CMAKE_CURRENT_SOURCE_DIR}/test-CtbConfig.cpp - - - ) +# HDF5 file +if (SLS_USE_HDF5) + target_compile_definitions(tests + PUBLIC + -DHDF5C ${HDF5_DEFINITIONS} + ) +endif (SLS_USE_HDF5) + target_include_directories(tests PUBLIC "$" diff --git a/slsDetectorSoftware/tests/Caller/test-Caller-rx.cpp b/slsDetectorSoftware/tests/Caller/test-Caller-rx.cpp index 76462e3c4..51fe04899 100644 --- a/slsDetectorSoftware/tests/Caller/test-Caller-rx.cpp +++ b/slsDetectorSoftware/tests/Caller/test-Caller-rx.cpp @@ -759,6 +759,7 @@ TEST_CASE("rx_roi", "[.cmdcall]") { std::string file_path = "/tmp/test_master_0.json"; REQUIRE(std::filesystem::exists(file_path) == true); +#ifdef HDF5C det.setAcquisitionIndex(0); det.setFileFormat(defs::HDF5); REQUIRE_NOTHROW(caller.call("acquire", {}, -1, PUT)); @@ -766,6 +767,7 @@ TEST_CASE("rx_roi", "[.cmdcall]") { REQUIRE(std::filesystem::exists(file_path) == true); file_path = "/tmp/test_virtual_0.h5"; REQUIRE(std::filesystem::exists(file_path) == true); +#endif det.setFileWrite(prev_write); if (!prev_path.empty())