Fix regression in Config->setenv affecting post-processing scripts. Includes regression test

This commit is contained in:
Alessandro Ranellucci 2014-02-09 23:14:32 +01:00
parent bba69ed22f
commit 634ccb33ab
2 changed files with 21 additions and 1 deletions

View File

@ -171,7 +171,7 @@ sub save {
sub setenv { sub setenv {
my $self = shift; my $self = shift;
foreach my $opt_key (sort keys %$Options) { foreach my $opt_key (@{$self->get_keys}) {
$ENV{"SLIC3R_" . uc $opt_key} = $self->serialize($opt_key); $ENV{"SLIC3R_" . uc $opt_key} = $self->serialize($opt_key);
} }
} }

20
t/config.t Normal file
View File

@ -0,0 +1,20 @@
use Test::More tests => 1;
use strict;
use warnings;
BEGIN {
use FindBin;
use lib "$FindBin::Bin/../lib";
}
use Slic3r;
use Slic3r::Test;
{
my $config = Slic3r::Config->new_from_defaults;
$config->set('layer_height', 0.123);
$config->setenv;
is $ENV{SLIC3R_LAYER_HEIGHT}, '0.123', 'setenv';
}
__END__