1 #include <catch2/catch_test_macros.hpp>
2 #include <nlohmann/json.hpp>
12 const std::filesystem::path
data_dir = WMTK_DATA_DIR;
17 SECTION(
"should pass")
19 const std::filesystem::path input_file =
data_dir /
"small.msh";
25 json component_json = {
26 {
"file", input_file.string()},
29 {
"tetrahedron_attributes", json::array()}};
31 CHECK(opts.file == input_file);
32 CHECK(opts.ignore_z_if_zero ==
false);
33 CHECK(opts.old_mode ==
true);
34 CHECK(opts.old_mode ==
true);
35 REQUIRE(opts.imported_attributes.has_value());
36 CHECK(opts.imported_attributes.value().size() == 4);
38 for (
const auto& v : opts.imported_attributes.value()) {
42 CHECK(js2 == component_json);
46 CHECK(*a == b.root());
51 REQUIRE(js.is_string());
53 CHECK(opts.file.string() ==
"path");
56 SECTION(
"should throw")
70 TEST_CASE(
"component_input_point",
"[components][input][.]")
72 const std::filesystem::path input_path =
data_dir /
"point_clouds" /
"bunny_pts.msh";
76 TEST_CASE(
"mesh_with_tag_from_image",
"[components][input]")
79 io::Cache cache(
"wmtk_cache", std::filesystem::current_path());
81 std::filesystem::path img_path =
data_dir /
"images/half_white_half_black.png";
83 const std::string tag_name =
"img_tag";
85 std::shared_ptr<TriMesh> m;
std::filesystem::path get_cache_path() const
Get the path of the cache folder.
const std::filesystem::path data_dir