From: Peter Rabbitson Date: Tue, 20 Mar 2012 03:14:53 +0000 (+0100) Subject: Run the sybase C subtest *after* the main test X-Git-Tag: v0.08197~77 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=72933b1563291bf292106112ee991fb3581fe68a;p=dbsrgits%2FDBIx-Class.git Run the sybase C subtest *after* the main test --- diff --git a/t/746sybase.t b/t/746sybase.t index b59fe70..5936e47 100644 --- a/t/746sybase.t +++ b/t/746sybase.t @@ -20,29 +20,6 @@ if (not ($dsn && $user)) { plan skip_all => 'Test needs ' . DBIx::Class::Optional::Dependencies->req_missing_for ('test_rdbms_ase') unless DBIx::Class::Optional::Dependencies->req_ok_for ('test_rdbms_ase'); -# first run the test without the lang variable set -# it is important to do this before module load, hence -# the subprocess before the optdep check -if ($ENV{LANG} and $ENV{LANG} ne 'C') { - my $oldlang = $ENV{LANG}; - local $ENV{LANG} = 'C'; - - pass ("Your lang is set to $oldlang - testing with C first"); - - my @cmd = ($^X, __FILE__); - - # this is cheating, and may even hang here and there (testing on windows passed fine) - # will be replaced with Test::SubExec::Noninteractive in due course - require IPC::Open2; - IPC::Open2::open2(my $out, my $in, @cmd); - while (my $ln = <$out>) { - print " $ln"; - } - - wait; - ok (! $?, "Wstat $? from: @cmd"); -} - my @storage_types = ( 'DBI::Sybase::ASE', 'DBI::Sybase::ASE::NoBindVars', @@ -630,6 +607,27 @@ SQL is $ping_count, 0, 'no pings'; +# if tests passed and did so under a non-C lang - let's rerun the test +if (Test::Builder->new->is_passing and $ENV{LANG} and $ENV{LANG} ne 'C') { + my $oldlang = $ENV{LANG}; + local $ENV{LANG} = 'C'; + + pass ("Your lang is set to $oldlang - retesting with C"); + + my @cmd = ($^X, __FILE__); + + # this is cheating, and may even hang here and there (testing on windows passed fine) + # will be replaced with Test::SubExec::Noninteractive in due course + require IPC::Open2; + IPC::Open2::open2(my $out, undef, @cmd); + while (my $ln = <$out>) { + print " $ln"; + } + + wait; + ok (! $?, "Wstat $? from: @cmd"); +} + done_testing; # clean up our mess