Fixes to complete_objects to make t/gcode.t pass

This commit is contained in:
Alessandro Ranellucci 2013-12-24 01:13:02 +01:00
parent c5ead0f2a6
commit 7ddf4f3ddf
5 changed files with 15 additions and 11 deletions

View file

@ -48,13 +48,13 @@ use Slic3r::Test;
# - no hard-coded "E" are generated
# - Z moves are correctly generated for both objects
my $config = Slic3r::Config->new_from_defaults;
$config->set('gcode_comments', 1);
$config->set('complete_objects', 1);
$config->set('duplicate', 2);
$config->set('extrusion_axis', 'A');
$config->set('start_gcode', ''); # prevent any default extra Z move
$config->set('layer_height', 0.4);
$config->set('first_layer_height', 0.4);
my $print = Slic3r::Test::init_print('20mm_cube', config => $config);
my $print = Slic3r::Test::init_print('20mm_cube', config => $config, duplicate => 2);
ok my $gcode = Slic3r::Test::gcode($print), "complete_objects";
my @z_moves = ();
Slic3r::GCode::Reader->new->parse($gcode, sub {

View file

@ -11,12 +11,13 @@ use Slic3r;
use Slic3r::Test qw(_eq);
my $config = Slic3r::Config->new_from_defaults;
my $duplicate = 1;
my $test = sub {
my ($conf) = @_;
$conf ||= $config;
my $print = Slic3r::Test::init_print('20mm_cube', config => $conf);
my $print = Slic3r::Test::init_print('20mm_cube', config => $conf, duplicate => $duplicate);
my $tool = 0;
my @toolchange_count = (); # track first usages so that we don't expect retract_length_toolchange when extruders are used for the first time
@ -115,13 +116,13 @@ my $retract_tests = sub {
$retract_tests->('');
$config->set('duplicate', 2);
$duplicate = 2;
$retract_tests->(' (duplicate)');
$config->set('g0', 1);
$retract_tests->(' (G0 and duplicate)');
$config->set('duplicate', 1);
$duplicate = 1;
$config->set('g0', 0);
$config->set('infill_extruder', 2);
$config->set('skirts', 4);