Branch Coverage

blib/lib/DBR/Sandbox.pm
Criterion Covered Total %
branch 24 44 54.5


line true false branch
20 0 18 if ($params{'schema'})
30 17 0 if blessed($_[0]) or $_[0] eq 'DBR::Sandbox'
32 0 17 unless my $schema = $params{'schema'}
37 0 0 if $params{'reuse'} and -e $dbrconf and -d $sandbox
39 0 17 unless $params{'quiet'}
55 0 17 unless my $logger = 'DBR::Util::Logger'->new(-'logpath', '_sandbox/sandbox_setup.log', -'logLevel', 'debug3')
56 0 17 unless my $dbr = 'DBR'->new(-'logger', $logger, -'conf', $dbrconf, -'admin', 1, -'fudge_tz', 1)
63 0 17 unless my $conf_instance = $dbr->get_instance('dbrconf')
65 0 17 unless my $loader = 'DBR::Config::SpecLoader'->new('session', $dbr->session, 'conf_instance', $conf_instance, 'dbr', $dbr)
71 0 17 unless my $spec = $loader->parse_file("$CONFDIR/$schema/spec")
73 0 17 unless $loader->process_spec($spec)
75 0 17 unless $params{'quiet'}
84 8 9 if -e $sandbox
85 0 17 unless mkpath($sandbox)
92 0 34 if (%$attr)
104 0 34 unless open $fh, "<$file"
111 33 438 unless $part =~ /\S+/
112 2 436 if $part =~ /^\s*--/
113 0 436 unless $dbh->do($part)
124 0 17 unless $dbh->do("INSERT INTO dbr_schemas (schema_id,handle) values (1,'${schema}')")
125 0 17 unless $dbh->do("INSERT INTO dbr_instances (schema_id,handle,class,dbfile,module) values (1,'${schema}','master','$sandbox/db.sqlite','SQLite')")
134 0 17 unless open $fh, "> $dbrconf"