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();
99LA_TESTING_API fs::path get_test_output_dir();
109LA_TESTING_API fs::path get_data_path(
const fs::path& relative_path);
119LA_TESTING_API fs::path get_data_folder(
const fs::path& relative_path);
129LA_TESTING_API fs::path get_test_output_path(
const fs::path& relative_path);
140template <
typename MeshType>
141std::unique_ptr<MeshType> load_mesh(
const fs::path& relative_path)
147extern template LA_TESTING_API std::unique_ptr<TriangleMesh3D> load_mesh(
const fs::path&);
148extern template LA_TESTING_API std::unique_ptr<QuadMesh3D> load_mesh(
const fs::path&);
162template <
typename Scalar,
typename Index>
163SurfaceMesh<Scalar, Index> load_surface_mesh(
const fs::path& relative_path)
165 auto full_path = get_data_path(relative_path);
166 REQUIRE(lagrange::fs::exists(full_path));
179LA_TESTING_API
void setup_mkl_reproducibility();
MeshType load_mesh(std::istream &input_stream, const LoadOptions &options={})
Load a mesh from a stream.
Definition load_mesh.cpp:38
Main namespace for Lagrange.