Remove invalid usage of std::filesystem in tests.

The std::filesystem::path methods cannot be compiled for
macOS 10.12. It did not manifest because we compile the
tests only on arm where the target is 11.0.
This commit is contained in:
Martin Šach 2025-01-06 16:12:06 +01:00
parent 936e203294
commit 5be84c56b3
2 changed files with 5 additions and 7 deletions

View File

@ -14,7 +14,7 @@
#include "libslic3r/GCode/SeamPlacer.hpp" #include "libslic3r/GCode/SeamPlacer.hpp"
#include "libslic3r/GCode/SeamAligned.hpp" #include "libslic3r/GCode/SeamAligned.hpp"
#include <filesystem> #include <boost/filesystem.hpp>
#include <unordered_map> #include <unordered_map>
namespace Slic3r { namespace Test { namespace Slic3r { namespace Test {
@ -159,7 +159,7 @@ std::string slice(
bool contains(const std::string &data, const std::string &pattern); bool contains(const std::string &data, const std::string &pattern);
bool contains_regex(const std::string &data, const std::string &pattern); bool contains_regex(const std::string &data, const std::string &pattern);
inline std::unique_ptr<Print> process_3mf(const std::filesystem::path &path) { inline std::unique_ptr<Print> process_3mf(const boost::filesystem::path &path) {
DynamicPrintConfig config; DynamicPrintConfig config;
auto print{std::make_unique<Print>()}; auto print{std::make_unique<Print>()};
Model model; Model model;
@ -176,7 +176,7 @@ inline std::unique_ptr<Print> process_3mf(const std::filesystem::path &path) {
static std::map<std::string, std::unique_ptr<Print>> prints_3mfs; static std::map<std::string, std::unique_ptr<Print>> prints_3mfs;
// Lazy getter, to avoid processing the 3mf multiple times, it already takes ages. // Lazy getter, to avoid processing the 3mf multiple times, it already takes ages.
inline Print *get_print(const std::filesystem::path &file_path) { inline Print *get_print(const boost::filesystem::path &file_path) {
if (!prints_3mfs.count(file_path.string())) { if (!prints_3mfs.count(file_path.string())) {
prints_3mfs[file_path.string()] = process_3mf(file_path.string()); prints_3mfs[file_path.string()] = process_3mf(file_path.string());
} }
@ -204,8 +204,8 @@ inline void serialize_seam(std::ostream &output, const std::vector<std::vector<S
struct SeamsFixture struct SeamsFixture
{ {
const std::filesystem::path file_3mf{ const boost::filesystem::path file_3mf{
std::filesystem::path{TEST_DATA_DIR} / std::filesystem::path{"seam_test_object.3mf"}}; boost::filesystem::path{TEST_DATA_DIR} / boost::filesystem::path{"seam_test_object.3mf"}};
const Print *print{Test::get_print(file_3mf)}; const Print *print{Test::get_print(file_3mf)};
const PrintObject *print_object{print->objects()[0]}; const PrintObject *print_object{print->objects()[0]};

View File

@ -89,8 +89,6 @@ TEST_CASE("Perimeter constructs KD trees", "[Seams][SeamPerimeters]") {
CHECK(perimeter.common_points.embedded_points); CHECK(perimeter.common_points.embedded_points);
} }
using std::filesystem::path;
constexpr const char *to_string(Perimeters::PointType point_type) { constexpr const char *to_string(Perimeters::PointType point_type) {
using Perimeters::PointType; using Perimeters::PointType;