mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-15 08:56:07 +08:00
wrong line endings.
This commit is contained in:
parent
f2206be78b
commit
7f7eb70dc9
@ -1,5 +1,6 @@
|
|||||||
#include <catch.hpp>
|
#include <catch.hpp>
|
||||||
#include "test_data.hpp" // get access to init_print, etc
|
#include "test_data.hpp" // get access to init_print, etc
|
||||||
|
#include "GCodeReader.hpp"
|
||||||
|
|
||||||
using namespace Slic3r::Test;
|
using namespace Slic3r::Test;
|
||||||
using namespace Slic3r;
|
using namespace Slic3r;
|
||||||
@ -17,8 +18,22 @@ SCENARIO("Original Slic3r Skirt/Brim tests", "[!mayfail]") {
|
|||||||
config->set("first_layer_speed", "100%");
|
config->set("first_layer_speed", "100%");
|
||||||
|
|
||||||
WHEN("multiple objects are printed") {
|
WHEN("multiple objects are printed") {
|
||||||
|
auto gcode {std::stringstream("")};
|
||||||
|
auto print {Slic3r::Test::init_print({TestMesh::cube_20x20x20, TestMesh::cube_20x20x20}, config)};
|
||||||
|
std::map<double, bool> layers_with_skirt;
|
||||||
|
Slic3r::Test::gcode(gcode, print);
|
||||||
|
auto parser {Slic3r::GCodeReader()};
|
||||||
|
parser.parse_stream(gcode, [&layers_with_skirt, &config] (Slic3r::GCodeReader& self, const Slic3r::GCodeReader::GCodeLine& line)
|
||||||
|
{
|
||||||
|
if (self.Z > 0) {
|
||||||
|
if (line.extruding() && line.new_F() == config->getFloat("support_material_speed") * 60.0) {
|
||||||
|
layers_with_skirt[self.Z] = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
THEN("skirt_height is honored") {
|
THEN("skirt_height is honored") {
|
||||||
REQUIRE(false);
|
REQUIRE(layers_with_skirt.size() == (size_t)config->getInt("skirt_height"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -81,7 +96,7 @@ SCENARIO("Original Slic3r Skirt/Brim tests", "[!mayfail]") {
|
|||||||
config->set("cooling", 0); // to prevent speeds to be altered
|
config->set("cooling", 0); // to prevent speeds to be altered
|
||||||
config->set("first_layer_speed", "100%"); // to prevent speeds to be altered
|
config->set("first_layer_speed", "100%"); // to prevent speeds to be altered
|
||||||
|
|
||||||
auto print {Slic3r::Test::init_print(TestMesh::overhang, config)};
|
auto print {Slic3r::Test::init_print({TestMesh::overhang}, config)};
|
||||||
print.process();
|
print.process();
|
||||||
|
|
||||||
config->set("support_material", true); // to prevent speeds to be altered
|
config->set("support_material", true); // to prevent speeds to be altered
|
||||||
@ -92,11 +107,13 @@ SCENARIO("Original Slic3r Skirt/Brim tests", "[!mayfail]") {
|
|||||||
}
|
}
|
||||||
WHEN("Large minimum skirt length is used.") {
|
WHEN("Large minimum skirt length is used.") {
|
||||||
config->set("min_skirt_length", 20);
|
config->set("min_skirt_length", 20);
|
||||||
|
auto gcode {std::stringstream("")};
|
||||||
auto print {Slic3r::Test::init_print(std::make_tuple<int,int,int>(20,20,20), config)};
|
auto print {Slic3r::Test::init_print(std::make_tuple<int,int,int>(20,20,20), config)};
|
||||||
THEN("Gcode generation doesn't crash") {
|
THEN("Gcode generation doesn't crash") {
|
||||||
Slic3r::Test::gcode(gcode, print);
|
Slic3r::Test::gcode(gcode, print);
|
||||||
auto exported {gcode.str()};
|
auto exported {gcode.str()};
|
||||||
REQUIRE(exported.size() > 0);
|
REQUIRE(exported.size() > 0);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user