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:
authorEnrico Turri <enricoturri@seznam.cz>2020-03-02 17:13:23 +0300
committerEnrico Turri <enricoturri@seznam.cz>2020-03-02 17:13:23 +0300
commit3b6d334d7bb0331e372cde14c69e153810fc0cbe (patch)
tree42e01c5e99bb9e8f92870b1461e6edded77f712e /tests
parentebbebe3727f2fe4e049203d0914eb8244e545213 (diff)
ENABLE_GCODE_VIEWER - Basic framework for new gcode viewer
Diffstat (limited to 'tests')
-rw-r--r--tests/fff_print/test_data.cpp6
-rw-r--r--tests/fff_print/test_model.cpp4
2 files changed, 9 insertions, 1 deletions
diff --git a/tests/fff_print/test_data.cpp b/tests/fff_print/test_data.cpp
index b3c16f4b0..50b338325 100644
--- a/tests/fff_print/test_data.cpp
+++ b/tests/fff_print/test_data.cpp
@@ -244,8 +244,12 @@ std::string gcode(Print & print)
boost::filesystem::path temp = boost::filesystem::unique_path();
print.set_status_silent();
print.process();
+#if ENABLE_GCODE_VIEWER
+ print.export_gcode(temp.string(), nullptr, nullptr);
+#else
print.export_gcode(temp.string(), nullptr);
- std::ifstream t(temp.string());
+#endif // ENABLE_GCODE_VIEWER
+ std::ifstream t(temp.string());
std::string str((std::istreambuf_iterator<char>(t)), std::istreambuf_iterator<char>());
boost::nowide::remove(temp.string().c_str());
return str;
diff --git a/tests/fff_print/test_model.cpp b/tests/fff_print/test_model.cpp
index 3378a8363..3d3b54ef0 100644
--- a/tests/fff_print/test_model.cpp
+++ b/tests/fff_print/test_model.cpp
@@ -50,7 +50,11 @@ SCENARIO("Model construction", "[Model]") {
print.apply(model, config);
print.process();
boost::filesystem::path temp = boost::filesystem::unique_path();
+#if ENABLE_GCODE_VIEWER
+ print.export_gcode(temp.string(), nullptr, nullptr);
+#else
print.export_gcode(temp.string(), nullptr);
+#endif // ENABLE_GCODE_VIEWER
REQUIRE(boost::filesystem::exists(temp));
REQUIRE(boost::filesystem::is_regular_file(temp));
REQUIRE(boost::filesystem::file_size(temp) > 0);