16#ifdef LA_TESTING_USE_CONFIG
17 #include <lagrange/testing/public_config.h>
20#include <lagrange/SurfaceMesh.h>
21#include <lagrange/fs/filesystem.h>
22#include <lagrange/io/legacy/load_mesh.h>
23#include <lagrange/io/load_mesh.h>
24#include <lagrange/testing/api.h>
25#include <lagrange/utils/assert.h>
27#include <catch2/catch_test_macros.hpp>
38#define LA_REQUIRE_THROWS(...) \
40 bool __was_enabled = lagrange::is_breakpoint_enabled(); \
41 lagrange::set_breakpoint_enabled(false); \
42 REQUIRE_THROWS(__VA_ARGS__); \
43 lagrange::set_breakpoint_enabled(__was_enabled); \
56#define LA_REQUIRE_THROWS_WITH(x, y) \
58 bool __was_enabled = lagrange::is_breakpoint_enabled(); \
59 lagrange::set_breakpoint_enabled(false); \
60 REQUIRE_THROWS_WITH(x, y); \
61 lagrange::set_breakpoint_enabled(__was_enabled); \
73#define LA_CHECK_THROWS(...) \
75 bool __was_enabled = lagrange::is_breakpoint_enabled(); \
76 lagrange::set_breakpoint_enabled(false); \
77 CHECK_THROWS(__VA_ARGS__); \
78 lagrange::set_breakpoint_enabled(__was_enabled); \
90LA_TESTING_API fs::path get_data_dir();
100LA_TESTING_API fs::path get_data_path(
const fs::path& relative_path);
111template <
typename MeshType>
112std::unique_ptr<MeshType> load_mesh(
const fs::path& relative_path)
114 auto result = lagrange::io::load_mesh<MeshType>(get_data_path(relative_path));
118extern template LA_TESTING_API std::unique_ptr<TriangleMesh3D> load_mesh(
const fs::path&);
119extern template LA_TESTING_API std::unique_ptr<QuadMesh3D> load_mesh(
const fs::path&);
133template <
typename Scalar,
typename Index>
136 auto full_path = get_data_path(relative_path);
137 REQUIRE(lagrange::fs::exists(full_path));
138 return lagrange::io::load_mesh<SurfaceMesh<Scalar, Index>>(full_path);
150LA_TESTING_API
void setup_mkl_reproducibility();
A general purpose polygonal mesh class.
Definition: SurfaceMesh.h:66
Main namespace for Lagrange.
Definition: AABBIGL.h:30