Attempt to fix 'Attempt to free unreferenced scalar' on 5.8
[dbsrgits/DBIx-Class-Schema-Loader.git] / t / 65dbicdump_invocations.t
1 #!perl
2
3 use strict;
4 use warnings;
5
6 use Test::More;
7 use DBIx::Class::Schema::Loader::Utils 'slurp_file';
8 use File::Path 'rmtree';
9 use lib 't/lib';
10 use make_dbictest_db ();
11 use dbixcsl_test_dir '$tdir';
12
13 plan tests => 3;
14
15 # Test the -I option
16
17 dbicdump(
18     '-I', 't/lib', '-o', 'schema_base_class=TestSchemaBaseClass', 'DBICTest::Schema',
19     $make_dbictest_db::dsn
20 );
21
22 dbicdump(
23     '-It/lib', '-o', 'schema_base_class=TestSchemaBaseClass', 'DBICTest::Schema',
24     $make_dbictest_db::dsn
25 );
26
27 dbicdump(
28     '-I/dummy', '-It/lib', '-o', 'schema_base_class=TestSchemaBaseClass',
29     'DBICTest::Schema',
30     $make_dbictest_db::dsn
31 );
32
33 done_testing;
34
35 sub dbicdump {
36     system $^X, 'script/dbicdump',
37         '-o', "dump_directory=$tdir",
38         '-o', 'quiet=1',
39         @_;
40
41     is $? >> 8, 0,
42         'dbicdump executed successfully';
43 }