test our tests

This commit is contained in:
Joseph Lenox 2018-07-21 22:07:37 -05:00
parent d4191a96b8
commit 4a62c75c11

View 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);
}
}
}
}