From 4bffe71d3477cefc562be3e7de70c73f6e4942cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Micha=C3=ABl=20Celerier?= Date: Fri, 13 Dec 2024 15:13:50 -0500 Subject: [PATCH] tests: add them to cmake --- cmake/avendish.tests.cmake | 2 + .../Advanced/Utilities/ArrayRecombiner.hpp | 81 ------------------- 2 files changed, 2 insertions(+), 81 deletions(-) diff --git a/cmake/avendish.tests.cmake b/cmake/avendish.tests.cmake index 57314fc3..9c5e3478 100644 --- a/cmake/avendish.tests.cmake +++ b/cmake/avendish.tests.cmake @@ -7,11 +7,13 @@ endfunction() function(avnd_add_executable_test theTarget theFile) add_executable("${theTarget}" "${theFile}") + add_test(NAME "${theTarget}" COMMAND "${theTarget}") avnd_common_setup("" "${theTarget}") endfunction() function(avnd_add_catch_test theTarget theFile) add_executable("${theTarget}" "${theFile}") + add_test(NAME "${theTarget}" COMMAND "${theTarget}") avnd_common_setup("" "${theTarget}") target_link_libraries("${theTarget}" PRIVATE Catch2::Catch2WithMain) endfunction() diff --git a/examples/Advanced/Utilities/ArrayRecombiner.hpp b/examples/Advanced/Utilities/ArrayRecombiner.hpp index da2b35cb..7054fc3f 100644 --- a/examples/Advanced/Utilities/ArrayRecombiner.hpp +++ b/examples/Advanced/Utilities/ArrayRecombiner.hpp @@ -26,87 +26,6 @@ struct ArrayRecombiner halp::spinbox_i32<"Grouping", halp::irange{1, 128, 3}> elements; } inputs; - struct do_process_one - { - std::vector& out; - void operator()(ossia::impulse& v) const noexcept { out.emplace_back(v); } - void operator()(int& v) const noexcept { out.emplace_back(v); } - void operator()(float& v) const noexcept { out.emplace_back(v); } - void operator()(bool& v) const noexcept { out.emplace_back(v); } - void operator()(std::string& v) const noexcept { out.emplace_back(std::move(v)); } - void operator()(ossia::vec2f& v) const noexcept - { - for(auto& val : v) - out.emplace_back(val); - } - void operator()(ossia::vec3f& v) const noexcept - { - for(auto& val : v) - out.emplace_back(val); - } - void operator()(ossia::vec4f& v) const noexcept - { - for(auto& val : v) - out.emplace_back(val); - } - void operator()(std::vector& v) const noexcept - { - for(auto& val : v) - out.emplace_back(std::move(val)); - } - void operator()(std::vector>& v) const noexcept - { - for(auto& val : v) - out.emplace_back(std::move(val.second)); - } - void operator()() const noexcept { out.push_back(ossia::value{}); } - }; - - struct do_process_rec - { - std::vector& out; - bool recursive{}; - void operator()(ossia::impulse& v) const noexcept { out.emplace_back(v); } - void operator()(int& v) const noexcept { out.emplace_back(v); } - void operator()(float& v) const noexcept { out.emplace_back(v); } - void operator()(bool& v) const noexcept { out.emplace_back(v); } - void operator()(std::string& v) const noexcept { out.emplace_back(std::move(v)); } - void operator()(ossia::vec2f& v) const noexcept - { - for(auto& val : v) - out.emplace_back(val); - } - void operator()(ossia::vec3f& v) const noexcept - { - for(auto& val : v) - out.emplace_back(val); - } - void operator()(ossia::vec4f& v) const noexcept - { - for(auto& val : v) - out.emplace_back(val); - } - void operator()(std::vector& v) const noexcept - { - if(recursive) - for(auto& val : v) - std::move(val).apply(*this); - else - for(auto& val : v) - std::move(val).apply(do_process_one{out}); - } - void operator()(std::vector>& v) const noexcept - { - if(recursive) - for(auto& val : v) - std::move(val.second).apply(*this); - else - for(auto& val : v) - std::move(val.second).apply(do_process_one{out}); - } - void operator()() const noexcept { out.push_back(ossia::value{}); } - }; - std::vector operator()(ossia::value in) {