Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authortamasmeszaros <meszaros.q@gmail.com>2022-02-17 14:48:17 +0300
committertamasmeszaros <meszaros.q@gmail.com>2022-02-17 14:50:40 +0300
commit66f60de5560ba0bc9577c0ed85565e03f865b7ac (patch)
tree73d3ce6bfe1a9a0cd13858fcebd2d56b142445b8 /tests
parent6c397e291cc199d4da8d9ffc23dff1384584049d (diff)
SLAArchive framework refactor
Diffstat (limited to 'tests')
-rw-r--r--tests/libnest2d/CMakeLists.txt4
-rw-r--r--tests/sla_print/CMakeLists.txt3
-rw-r--r--tests/sla_print/sla_archive_export_tests.cpp37
-rw-r--r--tests/slic3rutils/CMakeLists.txt4
4 files changed, 45 insertions, 3 deletions
diff --git a/tests/libnest2d/CMakeLists.txt b/tests/libnest2d/CMakeLists.txt
index bcb759452..9bafe84a0 100644
--- a/tests/libnest2d/CMakeLists.txt
+++ b/tests/libnest2d/CMakeLists.txt
@@ -4,4 +4,6 @@ target_link_libraries(${_TEST_NAME}_tests test_common libnest2d )
set_property(TARGET ${_TEST_NAME}_tests PROPERTY FOLDER "tests")
# catch_discover_tests(${_TEST_NAME}_tests TEST_PREFIX "${_TEST_NAME}: ")
-add_test(${_TEST_NAME}_tests ${_TEST_NAME}_tests "${CATCH_EXTRA_ARGS} exclude:[NotWorking]")
+set(_catch_args "exclude:[NotWorking]")
+list(APPEND _catch_args "${CATCH_EXTRA_ARGS}")
+add_test(${_TEST_NAME}_tests ${_TEST_NAME}_tests ${_catch_args})
diff --git a/tests/sla_print/CMakeLists.txt b/tests/sla_print/CMakeLists.txt
index dc583f1a1..26d576549 100644
--- a/tests/sla_print/CMakeLists.txt
+++ b/tests/sla_print/CMakeLists.txt
@@ -3,7 +3,8 @@ add_executable(${_TEST_NAME}_tests ${_TEST_NAME}_tests_main.cpp
sla_print_tests.cpp
sla_test_utils.hpp sla_test_utils.cpp
sla_supptgen_tests.cpp
- sla_raycast_tests.cpp)
+ sla_raycast_tests.cpp
+ sla_archive_export_tests.cpp)
target_link_libraries(${_TEST_NAME}_tests test_common libslic3r)
set_property(TARGET ${_TEST_NAME}_tests PROPERTY FOLDER "tests")
diff --git a/tests/sla_print/sla_archive_export_tests.cpp b/tests/sla_print/sla_archive_export_tests.cpp
new file mode 100644
index 000000000..586b0eb67
--- /dev/null
+++ b/tests/sla_print/sla_archive_export_tests.cpp
@@ -0,0 +1,37 @@
+#include <catch2/catch.hpp>
+#include <test_utils.hpp>
+
+#include "libslic3r/SLAPrint.hpp"
+#include "libslic3r/Format/SLAArchive.hpp"
+
+#include <boost/filesystem.hpp>
+
+using namespace Slic3r;
+
+TEST_CASE("Archive export test", "[sla_archives]") {
+ constexpr const char *PNAME = "20mm_cube";
+
+ for (auto &archname : SLAArchive::registered_archives()) {
+ 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);
+
+ DynamicPrintConfig cfg;
+ cfg.apply(fullcfg);
+
+ print.apply(m, cfg);
+ print.process();
+
+ ThumbnailsList thumbnails;
+ auto outputfname = std::string("output.") + SLAArchive::get_extension(archname);
+
+ print.export_print(outputfname, thumbnails, PNAME);
+
+ // Not much can be checked about the archives...
+ REQUIRE(boost::filesystem::exists(outputfname));
+ }
+}
diff --git a/tests/slic3rutils/CMakeLists.txt b/tests/slic3rutils/CMakeLists.txt
index be1b645d7..256e6efd6 100644
--- a/tests/slic3rutils/CMakeLists.txt
+++ b/tests/slic3rutils/CMakeLists.txt
@@ -15,4 +15,6 @@ if (WIN32)
endif()
# catch_discover_tests(${_TEST_NAME}_tests TEST_PREFIX "${_TEST_NAME}: ")
-add_test(${_TEST_NAME}_tests ${_TEST_NAME}_tests "${CATCH_EXTRA_ARGS} exclude:[NotWorking]")
+set(_catch_args "exclude:[NotWorking]")
+list(APPEND _catch_args "${CATCH_EXTRA_ARGS}")
+add_test(${_TEST_NAME}_tests ${_TEST_NAME}_tests ${_catch_args})