Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
markaren committed Nov 15, 2024
1 parent cde2e48 commit ebb4e4e
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 7 deletions.
7 changes: 7 additions & 0 deletions export/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ if (FMU4CPP_BUILD_TESTS)
)
FetchContent_MakeAvailable(Catch2)

FetchContent_Declare(
fmi4c
GIT_REPOSITORY https://github.com/robbr48/fmi4c.git
GIT_TAG 6f7f449ff03a78b0533a8483cafe1fd9965f4e6e
)
FetchContent_MakeAvailable(fmi4c)

enable_testing()
add_subdirectory(tests)
endif ()
17 changes: 10 additions & 7 deletions export/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@

function(make_test modelIdentifier sources)
add_executable(${modelIdentifier} ${sources} "$<TARGET_OBJECTS:fmu4cpp>")
add_test(NAME ${modelIdentifier} COMMAND ${modelIdentifier})
target_link_libraries(${modelIdentifier} PUBLIC Catch2::Catch2WithMain)
target_compile_definitions(${modelIdentifier}
function(make_test name sources)
add_executable(${name} ${sources} "$<TARGET_OBJECTS:fmu4cpp>")
add_test(NAME ${name} COMMAND ${modelIdentifier})
target_link_libraries(${name} PUBLIC Catch2::Catch2WithMain)
target_compile_definitions(${name}
PRIVATE
FMU4CPP_MODEL_IDENTIFIER="${modelIdentifier}"
FMU4CPP_MODEL_IDENTIFIER="${name}"
TEST_CASE_RESOURCE_LOCATION="${CMAKE_CURRENT_SOURCE_DIR}/resources"
)
target_include_directories(${modelIdentifier}
target_include_directories(${name}
PRIVATE
"${CMAKE_CURRENT_SOURCE_DIR}/../include"
"${CMAKE_CURRENT_SOURCE_DIR}/../src"
Expand All @@ -18,3 +18,6 @@ endfunction()

make_test(basic_test basic_test.cpp)
make_test(test_resource test_resource.cpp)

add_executable(bouncingball_test bouncingball_test.cpp)
target_link_libraries(bouncingball_test PRIVATE Catch2::Catch2WithMain fmi4c)
7 changes: 7 additions & 0 deletions export/tests/bouncingball_test.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

#include <fmi4c.h>
#include <catch2/catch_test_macros.hpp>

TEST_CASE("test bouncingball") {

}

0 comments on commit ebb4e4e

Please sign in to comment.