Branch Coverage

blib/lib/Metabrik/Brik/Tool.pm
Criterion Covered Total %
branch 0 308 0.0


line true false branch
91 0 0 unless (defined $self->context)
100 0 0 if (defined $brik)
106 0 0 if $this =~ /^core::/
107 0 0 if (defined $available->{$this} and exists $available->{$this}->brik_properties->{'require_modules'})
111 0 0 unless $m =~ /^Metabrik::/
130 0 0 unless $self->brik_help_run_undef_arg("get_require_briks_recursive", $brik)
132 0 0 unless my $hierarchy = $self->get_brik_hierarchy_recursive($brik)
136 0 0 unless my $require_briks = $self->get_require_briks($this)
153 0 0 unless (defined $self->context)
161 0 0 if (defined $brik)
167 0 0 if $this =~ /^core::/
168 0 0 if (defined $available->{$this} and exists $available->{$this}->brik_properties->{'require_modules'})
172 0 0 if $m =~ /^Metabrik::/
189 0 0 unless $self->brik_help_run_undef_arg("get_require_modules_recursive", $brik)
191 0 0 unless my $hierarchy = $self->get_brik_hierarchy_recursive($brik)
195 0 0 unless my $require_modules = $self->get_require_modules($this)
212 0 0 unless (defined $self->context)
220 0 0 if (defined $brik)
224 0 0 unless my $sp = "Metabrik::System::Package"->new_from_brik_init($self)
225 0 0 unless my $os = $sp->my_os
229 0 0 if $this =~ /^core::/
230 0 0 if (defined $available->{$this} and exists $available->{$this}->brik_properties->{'need_packages'})
232 0 0 unless my $list = $available->{$this}->brik_properties->{'need_packages'}{$os}
250 0 0 unless $self->brik_help_run_undef_arg("get_require_packages_recursive", $brik)
252 0 0 unless my $hierarchy = $self->get_brik_hierarchy_recursive($brik)
256 0 0 unless my $need_packages = $self->get_need_packages($this)
272 0 0 unless $self->brik_help_run_undef_arg("get_brik_hierarchy", $brik)
289 0 0 unless /^Metabrik::/
293 0 0 unless my $list = $self->get_brik_hierarchy($name)
309 0 0 unless $self->brik_help_run_undef_arg("get_brik_hierarchy_recursive", $brik)
314 0 0 unless my $provided = $self->get_brik_hierarchy($brik)
321 0 0 unless my $required = $self->get_require_briks($brik)
329 0 0 if $this eq $brik
330 0 0 if exists $hierarchy->{$this}
331 0 0 unless my $new = $self->get_brik_hierarchy_recursive($this)
344 0 0 unless $self->brik_help_run_undef_arg("install_packages", $packages)
345 0 0 unless $self->brik_help_run_invalid_arg("install_packages", $packages, "ARRAY")
347 0 0 unless my $sp = "Metabrik::System::Package"->new_from_brik_init($self)
355 0 0 unless $self->brik_help_run_undef_arg("install_modules", $modules)
356 0 0 unless $self->brik_help_run_invalid_arg("install_modules", $modules, "ARRAY")
358 0 0 unless my $pm = "Metabrik::Perl::Module"->new_from_brik_init($self)
365 0 0 unless (defined $self->context)
380 0 0 if $brik =~ /^log::/
382 0 0 if $brik =~ /^system::.*(?:::)?package$/
385 0 0 unless (defined $r)
390 0 0 if (@missing > 0)
401 0 0 unless my $modules = $self->get_require_modules
403 0 0 unless my $pm = "Metabrik::Perl::Module"->new_from_brik_init($self)
411 0 0 unless $self->brik_help_run_undef_arg("install_needed_packages", $brik)
413 0 0 unless my $packages = $self->get_need_packages_recursive($brik)
414 0 0 if (@$packages == 0)
418 0 0 unless my $sp = "Metabrik::System::Package"->new_from_brik_init($self)
429 0 0 unless $self->brik_help_run_undef_arg("install_required_modules", $brik)
431 0 0 unless my $modules = $self->get_require_modules_recursive($brik)
432 0 0 if (@$modules == 0)
436 0 0 unless my $pm = "Metabrik::Perl::Module"->new_from_brik_init($self)
447 0 0 unless $self->brik_help_run_undef_arg("install_required_briks", $brik)
449 0 0 unless my $briks = $self->get_require_briks_recursive($brik)
450 0 0 if (@$briks == 0)
457 0 0 unless my $this_packages = $self->get_need_packages_recursive($brik)
458 0 0 unless my $this_modules = $self->get_require_modules_recursive($brik)
480 0 0 unless $self->brik_help_run_undef_arg("install", $briks)
481 0 0 unless my $ref = $self->brik_help_run_invalid_arg("install", $briks, "ARRAY", "SCALAR")
484 0 0 if ($ref eq "SCALAR")
491 0 0 unless my $this_packages = $self->get_need_packages_recursive($brik)
492 0 0 unless my $this_modules = $self->get_require_modules_recursive($brik)
493 0 0 unless my $this_briks = $self->get_require_briks_recursive($brik)
498 0 0 unless my $this_sub_packages = $self->get_need_packages_recursive($this_brik)
499 0 0 unless my $this_sub_modules = $self->get_require_modules_recursive($this_brik)
512 0 0 if (@$packages)
513 0 0 unless $self->install_packages($packages)
515 0 0 if (@$modules)
516 0 0 unless $self->install_modules($modules)
527 0 0 unless my $new = $module->new_from_brik_no_checks($self)
528 0 0 if ($new->can("install"))
529 0 0 unless $new->install
540 0 0 unless $self->brik_help_run_undef_arg("get_dependencies", $brik_list)
541 0 0 unless my $ref = $self->brik_help_run_invalid_arg("get_dependencies", $brik_list, "ARRAY", "SCALAR")
544 0 0 if ($ref eq "SCALAR")
552 0 0 unless my $this_packages = $self->get_need_packages_recursive($brik)
553 0 0 unless my $this_modules = $self->get_require_modules_recursive($brik)
554 0 0 unless my $this_briks = $self->get_require_briks_recursive($brik)
555 0 0 unless my $this_hierarchy = $self->get_brik_hierarchy($brik)
562 0 0 unless my $this_sub_packages = $self->get_need_packages_recursive($this_brik)
564 0 0 unless my $this_sub_modules = $self->get_require_modules_recursive($this_brik)
566 0 0 unless my $this_sub_briks = $self->get_require_briks_recursive($this_brik)
568 0 0 unless my $this_sub_hierarchy = $self->get_brik_hierarchy($this_brik)
599 0 0 unless $self->brik_help_run_undef_arg("create_tool", $filename)
601 0 0 unless my $ft = "Metabrik::File::Text"->new_from_brik_init($self)
631 0 0 unless $ft->write($data, $filename)
641 0 0 unless $self->brik_help_run_undef_arg("create_brik", $brik)
642 0 0 unless $self->brik_help_run_undef_arg("create_brik", $repository)
645 0 0 unless ($brik =~ /^\w+::\w+(::\w+)*$/)
650 0 0 if (@toks < 2)
658 0 0 if (@toks > 2) { }
667 0 0 unless my $sf = "Metabrik::System::File"->new_from_brik_init($self)
668 0 0 unless $sf->mkdir($directory)
670 0 0 unless my $ft = "Metabrik::File::Text"->new_from_brik_init($self)
784 0 0 unless $ft->write($data, $filename)
796 0 0 unless my $dg = "Metabrik::Devel::Git"->new_from_brik_init($self)
798 0 0 unless my $pm = "Metabrik::Perl::Module"->new_from_brik_init($self)
801 0 0 if (not -d $datadir . '/core') { }
802 0 0 unless $dg->clone($url, $datadir . "/core")
805 0 0 unless $dg->update($datadir . "/core")
808 0 0 unless $pm->build($datadir . "/core")
809 0 0 unless $pm->clean($datadir . "/core")
810 0 0 unless $pm->build($datadir . "/core")
811 0 0 unless $pm->test($datadir . "/core")
812 0 0 unless $pm->install($datadir . "/core")
827 0 0 unless my $dg = "Metabrik::Devel::Git"->new_from_brik_init($self)
829 0 0 unless my $pm = "Metabrik::Perl::Module"->new_from_brik_init($self)
832 0 0 if (not -d $repository) { }
833 0 0 unless $dg->clone($url, $repository)
836 0 0 unless $dg->update($repository)
839 0 0 unless $pm->build($repository)
840 0 0 unless $pm->clean($repository)
841 0 0 unless $pm->build($repository)
842 0 0 unless $pm->test($repository)
843 0 0 unless $pm->install($repository)
857 0 0 unless $self->update_core
858 0 0 unless $self->update_repository
868 0 0 unless $self->brik_help_run_undef_arg("test_repository", $repository)
870 0 0 unless my $pm = "Metabrik::Perl::Module"->new_from_brik_init($self)
873 0 0 unless $pm->test($repository)
882 0 0 unless $self->brik_help_run_undef_arg("view_brik_source", $brik)
885 0 0 if (@toks < 2 and $brik ne "metabrik")
890 0 0 if ($brik eq "metabrik")
908 0 0 if (-f "$_/$pm")
914 0 0 if (length $cmd == 0)
925 0 0 unless $self->brik_help_run_undef_arg("get_brik_module_file", $brik)
927 0 0 if (@toks < 2 or @toks > 3)
932 0 0 unless (defined $inc)
943 0 0 unless my $ff = "Metabrik::File::Find"->new_from_brik_init($self)
945 0 0 unless -d $directory
947 0 0 unless my $list = $ff->files($directory, "^$name\$")
954 0 0 if ($this_brik eq $brik)
960 0 0 if ($file ne "undef")
972 0 0 unless (defined $self->context)
977 0 0 unless $self->brik_help_run_undef_arg("clone", $brik)
981 0 0 if $_ eq $repository
985 0 0 unless my $module_file = $self->get_brik_module_file($brik, \@directories)
986 0 0 if ($module_file eq "undef")
1007 0 0 if (-f $dst_file)
1011 0 0 unless my $sf = "Metabrik::System::File"->new_from_brik_init($self)
1012 0 0 unless $sf->mkdir($dst_mkdir)
1013 0 0 unless $sf->copy($src_file, $dst_file)
1014 0 0 unless $sf->chmod($dst_file, 644)
1016 0 0 unless $self->context->update_available
1029 0 0 unless (defined $self->context)
1037 0 0 if (defined $brik)
1041 0 0 unless my $sp = "Metabrik::System::Package"->new_from_brik_init($self)
1042 0 0 unless my $os = $sp->my_os
1046 0 0 if $this =~ /^core::/
1047 0 0 if (defined $available->{$this} and exists $available->{$this}->brik_properties->{'require_binaries'})