Branch Coverage

blib/lib/Test/mysqld.pm
Criterion Covered Total %
branch 10 98 10.2


line true false branch
38 0 6 @_ == 1 ? :
44 0 6 if (defined $self->base_dir) { }
45 0 0 unless $self->base_dir =~ m[^/]
50 0 6 $ENV{'TEST_MYSQLD_PRESERVE'} ? :
58 6 0 unless (defined $self->mysqld)
59 6 0 unless my $prog = _find_program(('mysqld', 'bin', 'libexec', 'sbin'))
63 0 0 unless (defined $self->use_mysqld_initialize)
66 0 0 if ($self->auto_start)
68 0 0 if -e $self->my_cnf->{'pid-file'}
69 0 0 if $self->auto_start >= 2
78 0 6 if defined $self->pid and $$ == $self->_owner_pid
85 0 0 if $self->my_cnf->{'port'}
86 0 0 if (defined $args{'port'}) { }
99 0 0 if defined $self->pid
107 0 0 if defined $self->pid
108 0 0 unless open my $logfh, '>>', $self->base_dir . '/tmp/mysqld.log'
112 0 0 unless defined $pid
114 0 0 if ($pid == 0)
115 0 0 unless open STDOUT, '>&', $logfh
117 0 0 unless open STDERR, '>&', $logfh
133 0 0 unless defined $self->pid
136 0 0 if (waitpid($pid, 1) > 0)
142 0 0 unless ($self->copy_data_from)
143 0 0 unless my $dbh = 'DBI'->connect($self->dsn('dbname', 'mysql'))
145 0 0 unless $dbh->do('CREATE DATABASE IF NOT EXISTS test')
155 0 0 unless defined $self->pid
164 0 0 unless defined $self->pid
188 0 0 if ($self->copy_data_from)
190 0 0 unless dircopy($self->copy_data_from, $self->my_cnf->{'datadir'})
194 0 0 unless open my $fh, '>', $self->base_dir . '/etc/my.cnf'
199 0 0 defined $v && length $v ? :
205 0 0 if (not -d $self->base_dir . '/var/mysql')
206 0 0 $self->use_mysqld_initialize ? :
207 0 0 unless (defined $self->mysql_install_db)
208 0 0 unless my $prog = _find_program(('mysql_install_db', 'bin', 'scripts'))
218 0 0 if ($self->use_mysqld_initialize) { }
220 0 0 if ($self->copy_data_from)
221 0 0 unless opendir my $dh, $self->copy_data_from
224 0 0 unless -d $self->copy_data_from . "/$entry"
225 0 0 if $entry =~ /^\.\.?$/
232 0 0 if ($mysql_base_dir =~ s[/(?:bin|extra|scripts)/mysql_install_db$][])
237 0 0 unless open $fh, '-|', $cmd
243 0 0 unless close $fh
250 0 0 unless open my $logfh, '<', $self->base_dir . '/tmp/mysqld.log'
259 0 6 if $path
263 0 11 if (-x $mysql)
266 0 0 if ($path =~ s[/bin/mysql$][/$subdir/$prog] and -x $path)
293 0 12 if $path
295 12 0 unless -x $path