sla_archive_export_tests.cpp 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #include <catch2/catch.hpp>
  2. #include <test_utils.hpp>
  3. #include "libslic3r/SLAPrint.hpp"
  4. #include "libslic3r/Format/SLAArchive.hpp"
  5. #include <boost/filesystem.hpp>
  6. using namespace Slic3r;
  7. TEST_CASE("Archive export test", "[sla_archives]") {
  8. constexpr const char *PNAME = "20mm_cube";
  9. for (auto &archname : SLAArchive::registered_archives()) {
  10. INFO(std::string("Testing archive type: ") + archname);
  11. SLAPrint print;
  12. SLAFullPrintConfig fullcfg;
  13. auto m = Model::read_from_file(TEST_DATA_DIR PATH_SEPARATOR + std::string(PNAME) + ".obj", nullptr);
  14. fullcfg.set("sla_archive_format", archname);
  15. fullcfg.set("supports_enable", false);
  16. fullcfg.set("pad_enable", false);
  17. DynamicPrintConfig cfg;
  18. cfg.apply(fullcfg);
  19. print.set_status_callback([](const PrintBase::SlicingStatus&) {});
  20. print.apply(m, cfg);
  21. print.process();
  22. ThumbnailsList thumbnails;
  23. auto outputfname = std::string("output.") + SLAArchive::get_extension(archname);
  24. print.export_print(outputfname, thumbnails, PNAME);
  25. // Not much can be checked about the archives...
  26. REQUIRE(boost::filesystem::exists(outputfname));
  27. }
  28. }