Skip to content

Commit

Permalink
Update test suite
Browse files Browse the repository at this point in the history
  • Loading branch information
tbeu committed Aug 18, 2024
1 parent 15a46ff commit 133dbe1
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 4 deletions.
30 changes: 27 additions & 3 deletions ModelicaTableAdditions/Resources/BuildProjects/CMake/test.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,30 @@ endif()

set(ZLIB_INCLUDE_DIR ${zlib_SOURCE_DIR} ${zlib_BINARY_DIR})

set_target_properties(gtest gtest_main zlib zlibstatic PROPERTIES FOLDER "Test/Third-party")
FetchContent_Declare(
hdf5
GIT_REPOSITORY https://github.com/HDFGroup/hdf5.git
GIT_TAG hdf5-1_14_3
)

set(HDF5_EXTERNALLY_CONFIGURED 1)
set(HDF5_ENABLE_DEPRECATED_SYMBOLS OFF CACHE BOOL "" FORCE)
set(HDF5_ENABLE_SZIP_SUPPORT OFF CACHE BOOL "" FORCE)
set(HDF5_ENABLE_Z_LIB_SUPPORT ON CACHE BOOL "" FORCE)
set(HDF5_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
set(HDF5_BUILD_TOOLS OFF CACHE BOOL "" FORCE)
set(HDF5_BUILD_UTILS OFF CACHE BOOL "" FORCE)
set(HDF5_BUILD_HL_LIB OFF CACHE BOOL "" FORCE)
set(HDF5_TEST_CPP OFF CACHE BOOL "" FORCE)
set(HDF5_TEST_EXAMPLES OFF CACHE BOOL "" FORCE)
set(HDF5_TEST_SWMR OFF CACHE BOOL "" FORCE)
set(BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE)

FetchContent_MakeAvailable(hdf5)

set(HDF5_INCLUDE_DIR "${hdf5_SOURCE_DIR}/src" "${hdf5_BINARY_DIR}/src")

set_target_properties(gtest gtest_main hdf5-static zlib zlibstatic PROPERTIES FOLDER "Test/Third-party")

set(MODELICA_TABLE_ADDITIONS_TEST_DIR "${MODELICA_TABLE_ADDITIONS_RESOURCES_DIR}/Test")
if(EXISTS "${MODELICA_TABLE_ADDITIONS_TEST_DIR}")
Expand Down Expand Up @@ -82,8 +105,8 @@ if(EXISTS "${MODELICA_TABLE_ADDITIONS_TEST_DIR}")
if(MSVC)
target_compile_options(ModelicaTableAdditionsTestCommon PRIVATE /wd4267)
endif()
target_compile_definitions(ModelicaTableAdditionsTestCommon PRIVATE -DHAVE_ZLIB=1)
target_include_directories(ModelicaTableAdditionsTestCommon PRIVATE ${ZLIB_INCLUDE_DIR})
target_compile_definitions(ModelicaTableAdditionsTestCommon PRIVATE -DHAVE_ZLIB=1 -DHAVE_HDF5=1)
target_include_directories(ModelicaTableAdditionsTestCommon PRIVATE ${ZLIB_INCLUDE_DIR} ${HDF5_INCLUDE_DIR})

set(MODELICA_TESTS
Tables
Expand All @@ -106,6 +129,7 @@ if(EXISTS "${MODELICA_TABLE_ADDITIONS_TEST_DIR}")
ModelicaTableAdditionsTestCommon
parson
gtest
hdf5-static
zlibstatic
)
if(UNIX)
Expand Down
3 changes: 2 additions & 1 deletion ModelicaTableAdditions/Resources/Test/TablesFromMatFile.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ INSTANTIATE_TEST_SUITE_P(
::testing::Values(
std::make_pair("../Data/Tables/test_v4.mat", "tab1"),
std::make_pair("../Data/Tables/test_v6.mat", "tab1"),
std::make_pair("../Data/Tables/test_v7.mat", "tab1"))
std::make_pair("../Data/Tables/test_v7.mat", "tab1"),
std::make_pair("../Data/Tables/test_v7.3.mat", "tab1"))
);

} // namespace
Expand Down

0 comments on commit 133dbe1

Please sign in to comment.