Branch Coverage

blib/lib/Test/mysqld.pm
Criterion Covered Total %
branch 10 110 9.0


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')
154 0 0 unless defined $self->pid
163 0 0 unless defined $self->pid
187 0 0 if ($self->copy_data_from)
189 0 0 unless dircopy($self->copy_data_from, $self->my_cnf->{'datadir'})
191 0 0 if (not $self->_is_maria and ($self->_mysql_major_version || 0) >= 8)
193 0 0 unless (-d $mysql_db_dir)
194 0 0 unless mkdir $mysql_db_dir
199 0 0 unless open my $fh, '>', $self->base_dir . '/etc/my.cnf'
204 0 0 defined $v && length $v ? :
210 0 0 if (not -d $self->base_dir . '/var/mysql')
211 0 0 $self->use_mysqld_initialize ? :
212 0 0 unless (defined $self->mysql_install_db)
213 0 0 unless my $prog = _find_program(('mysql_install_db', 'bin', 'scripts'))
223 0 0 if ($self->use_mysqld_initialize) { }
225 0 0 if ($self->copy_data_from and not !$self->_is_maria && ($self->_mysql_major_version || 0) >= 8)
228 0 0 unless opendir my $dh, $self->copy_data_from
231 0 0 unless -d $self->copy_data_from . "/$entry"
232 0 0 if $entry =~ /^\.\.?$/
239 0 0 if ($mysql_base_dir =~ s[/(?:bin|extra|scripts)/mysql_install_db$][])
244 0 0 unless open $fh, '-|', $cmd
250 0 0 unless close $fh
257 0 0 unless open my $logfh, '<', $self->base_dir . '/tmp/mysqld.log'
266 0 6 if $path
270 0 11 if (-x $mysql)
273 0 0 if ($path =~ s[/bin/mysql$][/$subdir/$prog] and -x $path)
299 0 0 unless (exists $self->{'_is_maria'})
307 0 0 unless (exists $self->{'_mysql_version'})
316 0 0 unless $ver
323 0 12 if $path
325 12 0 unless -x $path