PrusaSlicer-NonPlainar/tests/sla_print/sla_archive_export_tests.cpp

41 lines
1.2 KiB
C++
Raw Normal View History

2022-02-17 11:48:17 +00:00
#include <catch2/catch.hpp>
#include <test_utils.hpp>
#include "libslic3r/SLAPrint.hpp"
#include "libslic3r/Format/SLAArchiveWriter.hpp"
2022-02-17 11:48:17 +00:00
#include <boost/filesystem.hpp>
using namespace Slic3r;
TEST_CASE("Archive export test", "[sla_archives]") {
constexpr const char *PNAME = "20mm_cube";
for (auto &archname : SLAArchiveWriter::registered_archives()) {
2022-02-17 11:48:17 +00:00
INFO(std::string("Testing archive type: ") + archname);
SLAPrint print;
SLAFullPrintConfig fullcfg;
auto m = Model::read_from_file(TEST_DATA_DIR PATH_SEPARATOR + std::string(PNAME) + ".obj", nullptr);
fullcfg.set("sla_archive_format", archname);
2022-02-18 13:29:09 +00:00
fullcfg.set("supports_enable", false);
fullcfg.set("pad_enable", false);
2022-02-17 11:48:17 +00:00
DynamicPrintConfig cfg;
cfg.apply(fullcfg);
print.set_status_callback([](const PrintBase::SlicingStatus&) {});
2022-02-17 11:48:17 +00:00
print.apply(m, cfg);
print.process();
ThumbnailsList thumbnails;
auto outputfname = std::string("output.") + SLAArchiveWriter::get_extension(archname);
2022-02-17 11:48:17 +00:00
print.export_print(outputfname, thumbnails, PNAME);
// Not much can be checked about the archives...
REQUIRE(boost::filesystem::exists(outputfname));
}
}