Skip to content

Commit

Permalink
tests: add them to cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
jcelerier committed Dec 13, 2024
1 parent df572f5 commit 4bffe71
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 81 deletions.
2 changes: 2 additions & 0 deletions cmake/avendish.tests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
81 changes: 0 additions & 81 deletions examples/Advanced/Utilities/ArrayRecombiner.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,87 +26,6 @@ struct ArrayRecombiner
halp::spinbox_i32<"Grouping", halp::irange{1, 128, 3}> elements;
} inputs;

struct do_process_one
{
std::vector<ossia::value>& 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<ossia::value>& v) const noexcept
{
for(auto& val : v)
out.emplace_back(std::move(val));
}
void operator()(std::vector<std::pair<std::string, ossia::value>>& 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<ossia::value>& 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<ossia::value>& 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<std::pair<std::string, ossia::value>>& 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<ossia::value> operator()(ossia::value in)
{
Expand Down

0 comments on commit 4bffe71

Please sign in to comment.