From 7a8e1e778a1871bd031aa27e5328ca727d5254c6 Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Fri, 7 Jun 2013 13:38:29 +0200 Subject: [PATCH] New test to ensure brim and raft are extruded with the support material extruder. #123 --- t/support.t | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/t/support.t b/t/support.t index 1e9a24a6e..bee1987f1 100644 --- a/t/support.t +++ b/t/support.t @@ -14,8 +14,24 @@ use Slic3r::Test; my $config = Slic3r::Config->new_from_defaults; $config->set('raft_layers', 3); $config->set('brim_width', 6); + $config->set('skirts', 0); + $config->set('support_material_extruder', 2); + $config->set('layer_height', 0.4); + $config->set('first_layer_height', '100%'); my $print = Slic3r::Test::init_print('20mm_cube', config => $config); - ok Slic3r::Test::gcode($print), 'no conflict between raft/support and brim'; + ok my $gcode = Slic3r::Test::gcode($print), 'no conflict between raft/support and brim'; + + my $tool = 0; + Slic3r::GCode::Reader->new(gcode => $gcode)->parse(sub { + my ($self, $cmd, $args, $info) = @_; + + if ($cmd =~ /^T(\d+)/) { + $tool = $1; + } elsif ($info->{extruding} && $self->Z <= ($config->raft_layers * $config->layer_height)) { + fail 'not extruding raft/brim with support material extruder' + if $tool != ($config->support_material_extruder-1); + } + }); } __END__