Skip to content

Commit

Permalink
tests not working #1
Browse files Browse the repository at this point in the history
  • Loading branch information
lberti committed Jan 25, 2022
1 parent f38694d commit 26644f5
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 1 deletion.
11 changes: 11 additions & 0 deletions test/performance/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
add_executable(performance_test run.cpp)
configure_file(configuration.lua configuration.lua COPYONLY)
ADD_CUSTOM_TARGET(performance_test_sync ALL
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/configuration ${CMAKE_CURRENT_BINARY_DIR}/configuration
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/result ${CMAKE_CURRENT_BINARY_DIR}/result
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/module_performance ${CMAKE_CURRENT_BINARY_DIR}/module_performance)
add_dependencies(performance_test performance_test_sync)
target_link_libraries(performance_test verdandi gtest_main)

include(GoogleTest)
gtest_discover_tests(performance_test)
3 changes: 3 additions & 0 deletions test/performance/run.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
#define VERDANDI_WITH_TRAJECTORY_MANAGER

#include "Verdandi.hxx"
#define VERDANDI_GTEST_MODEL Verdandi::QuadraticModel<real>
#define VERDANDI_GTEST_MODEL_PATH "model/QuadraticModel.cxx"
#define VERDANDI_GTEST_CONFIG_PATH "configuration.lua"
#include VERDANDI_GTEST_MODEL_PATH
#include "seldon/computation/optimization/NLoptSolver.cxx"
#include "seldon/SeldonSolver.hxx"
Expand Down
2 changes: 1 addition & 1 deletion test/unit/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#add_subdirectory(method)
add_subdirectory(method)
add_subdirectory(model)
add_subdirectory(tool)
19 changes: 19 additions & 0 deletions test/unit/method/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# add_executable(TestInstantiator TestInstantiator.cxx)
# target_link_libraries(TestInstantiator vtkCommon)
# add_test(NAME TestInstantiator
# COMMAND TestInstantiator)

# set(VERDANDI_GTEST_MODEL "Verdandi::QuadraticModel<real>")
# set(VERDANDI_GTEST_CONFIG_PATH "\'\"configuration.lua\"\'")

add_executable(method_test run.cpp)
configure_file(configuration.lua configuration.lua COPYONLY)
ADD_CUSTOM_TARGET(method_test_sync ALL
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/configuration ${CMAKE_CURRENT_BINARY_DIR}/configuration
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/result ${CMAKE_CURRENT_BINARY_DIR}/result)
add_dependencies(method_test method_test_sync)

target_link_libraries( method_test seldon verdandi gtest_main )

include(GoogleTest)
gtest_discover_tests(method_test)
4 changes: 4 additions & 0 deletions test/unit/method/test_compare.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@
#include "method/ReducedOrderExtendedKalmanFilter.cxx"
#include "method/Nudging.cxx"

#define VERDANDI_GTEST_MODEL Verdandi::QuadraticModel<real>
#define VERDANDI_GTEST_MODEL_PATH "model/QuadraticModel.cxx"
#define VERDANDI_GTEST_CONFIG_PATH "configuration.lua"


using namespace Verdandi;
typedef Verdandi::Vector<double> state;
Expand Down

0 comments on commit 26644f5

Please sign in to comment.