From: Peter Rabbitson Date: Wed, 8 Sep 2010 15:03:20 +0000 (+0200) Subject: Don't assume a loader run will die right away, it may very well X-Git-Tag: 0.07002~7 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=74f213a5b308eb7b7d1fb9f980740801d5a8bf1e;p=dbsrgits%2FDBIx-Class-Schema-Loader.git Don't assume a loader run will die right away, it may very well warn before that --- diff --git a/t/lib/dbixcsl_dumper_tests.pm b/t/lib/dbixcsl_dumper_tests.pm index ff0cd06..a778b03 100644 --- a/t/lib/dbixcsl_dumper_tests.pm +++ b/t/lib/dbixcsl_dumper_tests.pm @@ -51,6 +51,7 @@ sub _dump_directly { $schema_class->connect(_get_dsn(\%tdata)); }; my $err = $@; + $schema_class->storage->disconnect if !$err && $schema_class->storage; undef *{$schema_class}; @@ -63,7 +64,7 @@ sub _dump_dbicdump { my %tdata = @_; # use $^X so we execute ./script/dbicdump with the same perl binary that the tests were executed with - my @cmd = ($^X, qw(./script/dbicdump)); + my @cmd = ($^X, qw(script/dbicdump)); while (my ($opt, $val) = each(%{ $tdata{options} })) { $val = dumper_squashed $val if ref $val; @@ -82,17 +83,12 @@ sub _dump_dbicdump { my @out = <$out>; waitpid($pid, 0); - my ($error, @warns); - if ($? >> 8 != 0) { - $error = $out[0]; + my $error = pop @out; _check_error($error, $tdata{error}); } - else { - @warns = @out; - } - return @warns; + return @out; } sub _get_dsn {