Fixing perl unit tests
This commit is contained in:
parent
542d95a593
commit
c013b73308
2
t/flow.t
2
t/flow.t
@ -21,7 +21,7 @@ use Slic3r::Test;
|
|||||||
$config->set('fill_density', 0.4);
|
$config->set('fill_density', 0.4);
|
||||||
$config->set('bottom_solid_layers', 1);
|
$config->set('bottom_solid_layers', 1);
|
||||||
$config->set('first_layer_extrusion_width', 2);
|
$config->set('first_layer_extrusion_width', 2);
|
||||||
$config->set('first_layer_height', '100%');
|
$config->set('first_layer_height', $config->layer_height);
|
||||||
$config->set('filament_diameter', [ 3.0 ]);
|
$config->set('filament_diameter', [ 3.0 ]);
|
||||||
$config->set('nozzle_diameter', [ 0.5 ]);
|
$config->set('nozzle_diameter', [ 0.5 ]);
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ use Slic3r::Test qw(_eq);
|
|||||||
$config->set('first_layer_height', 0.2);
|
$config->set('first_layer_height', 0.2);
|
||||||
ok $test->(), "absolute first layer height";
|
ok $test->(), "absolute first layer height";
|
||||||
|
|
||||||
$config->set('first_layer_height', '60%');
|
$config->set('first_layer_height', 0.6 * $config->layer_height);
|
||||||
ok $test->(), "relative first layer height";
|
ok $test->(), "relative first layer height";
|
||||||
|
|
||||||
$config->set('z_offset', 0.9);
|
$config->set('z_offset', 0.9);
|
||||||
|
@ -181,7 +181,7 @@ use Slic3r::Test;
|
|||||||
my $config = Slic3r::Config::new_from_defaults;
|
my $config = Slic3r::Config::new_from_defaults;
|
||||||
$config->set('nozzle_diameter', [0.6,0.6,0.6,0.6]);
|
$config->set('nozzle_diameter', [0.6,0.6,0.6,0.6]);
|
||||||
$config->set('layer_height', 0.4);
|
$config->set('layer_height', 0.4);
|
||||||
$config->set('first_layer_height', '100%');
|
$config->set('first_layer_height', $config->layer_height);
|
||||||
$config->set('skirts', 0);
|
$config->set('skirts', 0);
|
||||||
my $print = Slic3r::Test::init_print($model, config => $config);
|
my $print = Slic3r::Test::init_print($model, config => $config);
|
||||||
|
|
||||||
|
12
t/shells.t
12
t/shells.t
@ -84,7 +84,7 @@ use Slic3r::Test;
|
|||||||
{
|
{
|
||||||
my $config = Slic3r::Config::new_from_defaults;
|
my $config = Slic3r::Config::new_from_defaults;
|
||||||
$config->set('layer_height', 0.3);
|
$config->set('layer_height', 0.3);
|
||||||
$config->set('first_layer_height', '100%');
|
$config->set('first_layer_height', $config->layer_height);
|
||||||
$config->set('bottom_solid_layers', 0);
|
$config->set('bottom_solid_layers', 0);
|
||||||
$config->set('top_solid_layers', 3);
|
$config->set('top_solid_layers', 3);
|
||||||
$config->set('cooling', [ 0 ]);
|
$config->set('cooling', [ 0 ]);
|
||||||
@ -119,7 +119,7 @@ use Slic3r::Test;
|
|||||||
$config->set('cooling', [ 0 ]); # prevent speed alteration
|
$config->set('cooling', [ 0 ]); # prevent speed alteration
|
||||||
$config->set('first_layer_speed', '100%'); # prevent speed alteration
|
$config->set('first_layer_speed', '100%'); # prevent speed alteration
|
||||||
$config->set('layer_height', 0.4);
|
$config->set('layer_height', 0.4);
|
||||||
$config->set('first_layer_height', '100%');
|
$config->set('first_layer_height', $config->layer_height);
|
||||||
$config->set('extrusion_width', 0.55);
|
$config->set('extrusion_width', 0.55);
|
||||||
$config->set('bottom_solid_layers', 3);
|
$config->set('bottom_solid_layers', 3);
|
||||||
$config->set('top_solid_layers', 0);
|
$config->set('top_solid_layers', 0);
|
||||||
@ -142,7 +142,7 @@ use Slic3r::Test;
|
|||||||
$config->set('cooling', [ 0 ]); # prevent speed alteration
|
$config->set('cooling', [ 0 ]); # prevent speed alteration
|
||||||
$config->set('first_layer_speed', '100%'); # prevent speed alteration
|
$config->set('first_layer_speed', '100%'); # prevent speed alteration
|
||||||
$config->set('layer_height', 0.4);
|
$config->set('layer_height', 0.4);
|
||||||
$config->set('first_layer_height', '100%');
|
$config->set('first_layer_height', $config->layer_height);
|
||||||
$config->set('bottom_solid_layers', 3);
|
$config->set('bottom_solid_layers', 3);
|
||||||
$config->set('top_solid_layers', 3);
|
$config->set('top_solid_layers', 3);
|
||||||
$config->set('solid_infill_speed', 99);
|
$config->set('solid_infill_speed', 99);
|
||||||
@ -170,7 +170,7 @@ use Slic3r::Test;
|
|||||||
$config->set('spiral_vase', 1);
|
$config->set('spiral_vase', 1);
|
||||||
$config->set('bottom_solid_layers', 0);
|
$config->set('bottom_solid_layers', 0);
|
||||||
$config->set('skirts', 0);
|
$config->set('skirts', 0);
|
||||||
$config->set('first_layer_height', '100%');
|
$config->set('first_layer_height', $config->layer_height);
|
||||||
$config->set('start_gcode', '');
|
$config->set('start_gcode', '');
|
||||||
$config->set('temperature', [200]);
|
$config->set('temperature', [200]);
|
||||||
$config->set('first_layer_temperature', [205]);
|
$config->set('first_layer_temperature', [205]);
|
||||||
@ -231,7 +231,7 @@ use Slic3r::Test;
|
|||||||
$config->set('bottom_solid_layers', 0);
|
$config->set('bottom_solid_layers', 0);
|
||||||
$config->set('retract_layer_change', [0]);
|
$config->set('retract_layer_change', [0]);
|
||||||
$config->set('skirts', 0);
|
$config->set('skirts', 0);
|
||||||
$config->set('first_layer_height', '100%');
|
$config->set('first_layer_height', $config->layer_height);
|
||||||
$config->set('layer_height', 0.4);
|
$config->set('layer_height', 0.4);
|
||||||
$config->set('start_gcode', '');
|
$config->set('start_gcode', '');
|
||||||
# $config->set('use_relative_e_distances', 1);
|
# $config->set('use_relative_e_distances', 1);
|
||||||
@ -310,7 +310,7 @@ use Slic3r::Test;
|
|||||||
# $config->set('spiral_vase', 1);
|
# $config->set('spiral_vase', 1);
|
||||||
# $config->set('bottom_solid_layers', 0);
|
# $config->set('bottom_solid_layers', 0);
|
||||||
# $config->set('skirts', 0);
|
# $config->set('skirts', 0);
|
||||||
# $config->set('first_layer_height', '100%');
|
# $config->set('first_layer_height', $config->layer_height);
|
||||||
# $config->set('start_gcode', '');
|
# $config->set('start_gcode', '');
|
||||||
#
|
#
|
||||||
# my $print = Slic3r::Test::init_print('two_hollow_squares', config => $config);
|
# my $print = Slic3r::Test::init_print('two_hollow_squares', config => $config);
|
||||||
|
2
t/thin.t
2
t/thin.t
@ -18,7 +18,7 @@ use Slic3r::Test;
|
|||||||
if (0) {
|
if (0) {
|
||||||
my $config = Slic3r::Config::new_from_defaults;
|
my $config = Slic3r::Config::new_from_defaults;
|
||||||
$config->set('layer_height', 0.2);
|
$config->set('layer_height', 0.2);
|
||||||
$config->set('first_layer_height', '100%');
|
$config->set('first_layer_height', $config->layer_height);
|
||||||
$config->set('extrusion_width', 0.5);
|
$config->set('extrusion_width', 0.5);
|
||||||
$config->set('first_layer_extrusion_width', '200%'); # check this one too
|
$config->set('first_layer_extrusion_width', '200%'); # check this one too
|
||||||
$config->set('skirts', 0);
|
$config->set('skirts', 0);
|
||||||
|
@ -4,7 +4,7 @@ use strict;
|
|||||||
use warnings;
|
use warnings;
|
||||||
|
|
||||||
use Slic3r::XS;
|
use Slic3r::XS;
|
||||||
use Test::More tests => 147;
|
use Test::More tests => 146;
|
||||||
|
|
||||||
foreach my $config (Slic3r::Config->new, Slic3r::Config::Static::new_FullPrintConfig) {
|
foreach my $config (Slic3r::Config->new, Slic3r::Config::Static::new_FullPrintConfig) {
|
||||||
$config->set('layer_height', 0.3);
|
$config->set('layer_height', 0.3);
|
||||||
@ -70,10 +70,10 @@ foreach my $config (Slic3r::Config->new, Slic3r::Config::Static::new_FullPrintCo
|
|||||||
ok abs($config->get('first_layer_height') - 0.3) < 1e-4, 'set/get absolute floatOrPercent';
|
ok abs($config->get('first_layer_height') - 0.3) < 1e-4, 'set/get absolute floatOrPercent';
|
||||||
is $config->opt_serialize('first_layer_height'), '0.3', 'serialize absolute floatOrPercent';
|
is $config->opt_serialize('first_layer_height'), '0.3', 'serialize absolute floatOrPercent';
|
||||||
|
|
||||||
$config->set('first_layer_height', '50%');
|
$config->set('first_layer_height', $config->layer_height);
|
||||||
$config->get_abs_value('first_layer_height');
|
$config->get_abs_value('first_layer_height');
|
||||||
ok abs($config->get_abs_value('first_layer_height') - 0.15) < 1e-4, 'set/get relative floatOrPercent';
|
ok abs($config->get_abs_value('first_layer_height') - 0.15) < 1e-4, 'set/get relative floatOrPercent';
|
||||||
is $config->opt_serialize('first_layer_height'), '50%', 'serialize relative floatOrPercent';
|
# is $config->opt_serialize('first_layer_height'), '50%', 'serialize relative floatOrPercent';
|
||||||
|
|
||||||
# Uh-oh, we have no point option to test at the moment
|
# Uh-oh, we have no point option to test at the moment
|
||||||
#ok $config->set('print_center', [50,80]), 'valid point coordinates';
|
#ok $config->set('print_center', [50,80]), 'valid point coordinates';
|
||||||
|
Loading…
Reference in New Issue
Block a user