mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-07-31 14:02:03 +08:00
test our tests
This commit is contained in:
parent
d4191a96b8
commit
4a62c75c11
29
src/test/libslic3r/test_test_data.cpp
Normal file
29
src/test/libslic3r/test_test_data.cpp
Normal file
@ -0,0 +1,29 @@
|
||||
#include <catch.hpp>
|
||||
#include <sstream>
|
||||
|
||||
#include "test_data.hpp"
|
||||
|
||||
using namespace Slic3r::Test;
|
||||
|
||||
SCENARIO("init_print functionality") {
|
||||
GIVEN("A default config") {
|
||||
config_ptr config {Slic3r::Config::new_from_defaults()};
|
||||
std::stringstream gcode;
|
||||
WHEN("init_print is called with a single mesh.") {
|
||||
Slic3r::Model model;
|
||||
auto print = init_print({TestMesh::cube_20x20x20}, model, config, true);
|
||||
gcode.clear();
|
||||
THEN("One mesh/printobject is in the resulting Print object.") {
|
||||
REQUIRE(print->objects.size() == 1);
|
||||
}
|
||||
THEN("print->process() doesn't crash.") {
|
||||
REQUIRE_NOTHROW(print->process());
|
||||
}
|
||||
THEN("Export gcode functions outputs text.") {
|
||||
print->process();
|
||||
print->export_gcode(gcode, true);
|
||||
REQUIRE(gcode.str().size() > 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user