diff --git a/CMakeLists.txt b/CMakeLists.txt index 5b43982..9ec7b57 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -81,36 +81,36 @@ target_include_directories(${AppExec} PUBLIC src) add_subdirectory(src/OpDefs) # tests -# Include(FetchContent) +Include(FetchContent) -# FetchContent_Declare( -# Catch2 -# GIT_REPOSITORY https://github.com/catchorg/Catch2.git -# GIT_TAG v3.8.1 # or a later release -# ) +FetchContent_Declare( + Catch2 + GIT_REPOSITORY https://github.com/catchorg/Catch2.git + GIT_TAG v3.8.1 # or a later release +) -# FetchContent_MakeAvailable(Catch2) +FetchContent_MakeAvailable(Catch2) -# add_executable(${TestExec} -# ${ENGINE_SOURCES} -# tests/main-tests.cpp -# tests/OperatorTests.cpp -# tests/NetworkTests.cpp -# ) -# target_link_libraries(${TestExec} PRIVATE Catch2::Catch2WithMain Eigen3::Eigen Qt6::Core TBB::tbb Boost::filesystem Boost::system) -# target_compile_definitions(${TestExec} PRIVATE UNIT_TEST) -# target_include_directories(${TestExec} PUBLIC -# src -# ${BOOST_INCLUDE_DIRS} -# ) +add_executable(${TestExec} + ${ENGINE_SOURCES} + tests/main-tests.cpp + tests/OperatorTests.cpp + tests/NetworkTests.cpp +) +target_link_libraries(${TestExec} PRIVATE Catch2::Catch2WithMain Eigen3::Eigen Qt6::Core TBB::tbb Boost::filesystem Boost::system) +target_compile_definitions(${TestExec} PRIVATE UNIT_TEST) +target_include_directories(${TestExec} PUBLIC + src + ${BOOST_INCLUDE_DIRS} +) -# # benchmarks -# add_executable(${BenchExec} -# ${ENGINE_SOURCES} +# benchmarks +add_executable(${BenchExec} + ${ENGINE_SOURCES} -# tests/Benchmarks.cpp -# ) -# target_link_libraries(${BenchExec} PRIVATE Catch2::Catch2WithMain Eigen3::Eigen Qt6::Core TBB::tbb Boost::filesystem Boost::system) -# target_compile_definitions(${BenchExec} PRIVATE UNIT_TEST) -# target_include_directories(${BenchExec} PUBLIC src) + tests/Benchmarks.cpp +) +target_link_libraries(${BenchExec} PRIVATE Catch2::Catch2WithMain Eigen3::Eigen Qt6::Core TBB::tbb Boost::filesystem Boost::system) +target_compile_definitions(${BenchExec} PRIVATE UNIT_TEST) +target_include_directories(${BenchExec} PUBLIC src) diff --git a/src/Engine/Parameter/Type.h b/src/Engine/Parameter/Type.h index 3c858fb..332015f 100644 --- a/src/Engine/Parameter/Type.h +++ b/src/Engine/Parameter/Type.h @@ -4,12 +4,12 @@ namespace enzo::prm { -enum class Type -{ - STRING, - FLOAT, - INT, -}; +// enum class Type +// { +// STRING, +// FLOAT, +// INT, +// }; // class Type diff --git a/src/Engine/Types.h b/src/Engine/Types.h index ac835b8..91aa852 100644 --- a/src/Engine/Types.h +++ b/src/Engine/Types.h @@ -31,6 +31,16 @@ namespace enzo using Vector3 = Eigen::Vector3d; using Vector4 = Eigen::Vector4d; } + namespace prm + { + enum class Type + { + STRING, + FLOAT, + INT, + TOGGLE + }; + } namespace nt { using OpId = uint64_t; diff --git a/tests/Benchmarks.cpp b/tests/Benchmarks.cpp index 3562a66..9c4cdc5 100644 --- a/tests/Benchmarks.cpp +++ b/tests/Benchmarks.cpp @@ -26,7 +26,7 @@ struct OperatorTableInit OperatorTableInit() { enzo::op::OperatorTable::initPlugins(); } }; static OperatorTableInit _operatorTableInit; -auto testOpCtor = enzo::op::OperatorTable::getOpConstructor("house"); +auto testOpInfo = enzo::op::OperatorTable::getOpInfo("house").value(); TEST_CASE_METHOD(NMReset, "Network Manager") { @@ -34,7 +34,7 @@ TEST_CASE_METHOD(NMReset, "Network Manager") auto& nm = nt::nm(); - nt::OpId startOp = nm.addOperator(testOpCtor); + nt::OpId startOp = nm.addOperator(testOpInfo); nt::OpId prevOp = startOp; std::vector prevOps; @@ -42,7 +42,7 @@ TEST_CASE_METHOD(NMReset, "Network Manager") { for(int i=0; i<4; ++i) { - nt::OpId newOp = nm.addOperator(testOpCtor); + nt::OpId newOp = nm.addOperator(testOpInfo); prevOps.push_back(newOp); nt::connectOperators(newOp, i, prevOp, 0); } @@ -52,7 +52,7 @@ TEST_CASE_METHOD(NMReset, "Network Manager") for(int i=0; i