Skip to content

Commit

Permalink
Added test build for the nexus contrib
Browse files Browse the repository at this point in the history
Update #548
  • Loading branch information
eugenwintersberger committed Dec 27, 2021
1 parent 7e40f27 commit 8857cd6
Show file tree
Hide file tree
Showing 13 changed files with 69 additions and 289 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ endif()
#=============================================================================
# contrib extensions
#=============================================================================
set(H5CPP_ENABLE_NEXUS "false" CACHE BOOL "enable support or Nexus types")
set(H5CPP_ENABLE_NEXUS "true" CACHE BOOL "enable support or Nexus types")
set(H5CPP_ENABLE_STL "true" CACHE BOOL "enable STL support for H5CPP")

#=============================================================================
Expand Down
8 changes: 7 additions & 1 deletion src/h5cpp/contrib/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
set(CONTRIB_SOURCES)
set(CONTRIB_HEADERS)

if(H5CPP_ENABLE_STL)
add_subdirectory(stl)
endif()

if(H5CPP_ENABLE_NEXUS)
add_subdirectory(nexus)
endif()
endif()

set(h5cpp_sources ${h5cpp_sources} ${CONTRIB_SOURCES} PARENT_SCOPE)
set(h5cpp_headers ${h5cpp_headers} ${CONTRIB_HEADERS} PARENT_SCOPE)
4 changes: 2 additions & 2 deletions src/h5cpp/contrib/nexus/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ set(HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/ebool.hpp)
install(FILES ${HEADERS}
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/h5cpp/contrib/nexus)

set(h5cpp_sources ${h5cpp_sources} ${SOURCES} PARENT_SCOPE)
set(h5cpp_headers ${h5cpp_headers} ${HEADERS} PARENT_SCOPE)
set(CONTRIB_SOURCES ${CONTRIB_SOURCES} ${SOURCES} PARENT_SCOPE)
set(CONTRIB_HEADERS ${CONTROB_HEADERS} ${HEADERS} PARENT_SCOPE)
2 changes: 1 addition & 1 deletion src/h5cpp/contrib/nexus/ebool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

#include <sstream>
#include <h5cpp/datatype/enum.hpp>
#include <h5cpp/datatype/ebool.hpp>
#include <h5cpp/contrib/nexus/ebool.hpp>
#include <h5cpp/error/error.hpp>

namespace hdf5
Expand Down
4 changes: 4 additions & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,7 @@ add_subdirectory(filter)
add_subdirectory(node)
add_subdirectory(file)
add_subdirectory(utilities)

if(H5CPP_ENABLE_NEXUS)
add_subdirectory(contrib/nexus)
endif()
12 changes: 12 additions & 0 deletions test/contrib/nexus/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
set(SOURCES attribute_h5py_bool_test.cpp
attribute_pniio_bool_test.cpp
dataset_h5py_bool_test.cpp
dataset_pniio_bool_test.cpp
ebool_test.cpp)

add_executable(ebool_test ${SOURCES})
target_link_libraries(ebool_test h5cpp $<$<AND:$<CXX_COMPILER_ID:GNU>,$<VERSION_LESS:$<CXX_COMPILER_VERSION>,11.0>>:stdc++fs>)

catch_discover_tests(ebool_test
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
add_test(NAME ebool_test WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND ebool_test)
2 changes: 1 addition & 1 deletion test/contrib/nexus/attribute_h5py_bool_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
// Created on: Jul 2, 2018
//
#include <catch2/catch.hpp>
#include <h5cpp/datatype/ebool.hpp>
#include <h5cpp/contrib/nexus/ebool.hpp>
#include <h5cpp/hdf5.hpp>

using namespace hdf5;
Expand Down
2 changes: 1 addition & 1 deletion test/contrib/nexus/attribute_pniio_bool_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
// Created on: Jul 2, 2018
//
#include <catch2/catch.hpp>
#include <h5cpp/datatype/ebool.hpp>
#include <h5cpp/contrib/nexus/ebool.hpp>
#include <h5cpp/datatype/enum.hpp>
#include <h5cpp/hdf5.hpp>

Expand Down
3 changes: 2 additions & 1 deletion test/contrib/nexus/dataset_h5py_bool_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
//
#include <catch2/catch.hpp>
#include <h5cpp/hdf5.hpp>
#include "../utilities.hpp"
#include "../../utilities.hpp"
#include "utilities.hpp"

using namespace hdf5;

Expand Down
3 changes: 2 additions & 1 deletion test/contrib/nexus/dataset_pniio_bool_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
//
#include <catch2/catch.hpp>
#include <h5cpp/hdf5.hpp>
#include "../utilities.hpp"
#include "utilities.hpp"
#include "../../utilities.hpp"

using namespace hdf5;

Expand Down
Loading

0 comments on commit 8857cd6

Please sign in to comment.