X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fadmin%2F10script.t;h=abcd2f944fba9c45e768cde722ca428ee2588452;hb=386c61f65520dc5c1b6f3d4710e865eeff9f26a8;hp=20e884b3d6653f534f1173dd22e601559a9886c2;hpb=20c48bc466a8f3fffb84833002d5932d861c8d61;p=dbsrgits%2FDBIx-Class.git diff --git a/t/admin/10script.t b/t/admin/10script.t index 20e884b..abcd2f9 100644 --- a/t/admin/10script.t +++ b/t/admin/10script.t @@ -17,26 +17,25 @@ BEGIN { my @json_backends = qw/XS JSON DWIW/; my $tests_per_run = 5; - plan tests => ($tests_per_run * @json_backends) + 1; + +# test the script is setting @INC properly +test_exec (qw| -It/lib/testinclude --schema=DBICTestAdminInc --insert --connect=[] |); +cmp_ok ( $? >> 8, '==', 70, 'Correct exit code from connecting a custom INC schema' ); + for my $js (@json_backends) { eval {JSON::Any->import ($js) }; SKIP: { - skip ("Json backend $js is not available, skip testing", $tests_per_run) if $@; + skip ("JSON backend $js is not available, skip testing", $tests_per_run) if $@; $ENV{JSON_ANY_ORDER} = $js; eval { test_dbicadmin () }; diag $@ if $@; - } } -# test the script is setting @INC properly -test_exec (qw| -It/lib/testinclude --schema=DBICTestAdminInc --op=deploy --connect=[] |); -cmp_ok ( $? >> 8, '==', 70, 'Correct exit code from deploying a custom INC schema' ); - sub test_dbicadmin { my $schema = DBICTest->init_schema( sqlite_use_file => 1 ); # reinit a fresh db for every run @@ -57,7 +56,7 @@ sub test_dbicadmin { SKIP: { skip ("MSWin32 doesn't support -| either", 1) if $^O eq 'MSWin32'; - open(my $fh, "-|", ( 'script/dbicadmin', default_args(), qw|--op=select --attrs={"order_by":"name"}| ) ) or die $!; + open(my $fh, "-|", ( $^X, 'script/dbicadmin', default_args(), qw|--op=select --attrs={"order_by":"name"}| ) ) or die $!; my $data = do { local $/; <$fh> }; close($fh); if (!ok( ($data=~/Aran.*Trout/s), "$ENV{JSON_ANY_ORDER}: select with attrs" )) { @@ -73,7 +72,7 @@ sub default_args { return ( qw|--quiet --schema=DBICTest::Schema --class=Employee|, q|--connect=["dbi:SQLite:dbname=t/var/DBIxClass.db","","",{"AutoCommit":1}]|, - qw|--force|, + qw|--force -I testincludenoniterference|, ); }