| 1 | # -*- mode: cperl -*- | ||||||||||||||||||||||||||||||
| 2 | 2 | ▶ | use 5.008; | ||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||
| 3 | 2 | ▶ | use strict; | ||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||
| 4 | 2 | ▶ | use warnings; | ||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||||
| 6 | package Benchmark::Perl::Formance::Plugin::Mandelbrot; | ||||||||||||||||||||||||||||||
| 7 | # git description: 9f757a9 | ||||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||||
| 9 | 2 | our $AUTHORITY = 'cpan:SCHWIGON'; | |||||||||||||||||||||||||||||
| 10 | # ABSTRACT: Benchmark::Perl::Formance plugin - more modern mandelbrot | ||||||||||||||||||||||||||||||
| 11 | 2 | $Benchmark::Perl::Formance::Plugin::Mandelbrot::VERSION = '0.001'; | |||||||||||||||||||||||||||||
| 12 | 2 | our @default_subtests = qw( withmce withthreads ); | |||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||||
| 14 | sub run | ||||||||||||||||||||||||||||||
| 15 | 1 | ▶ | { | ||||||||||||||||||||||||||||
|
Subroutine
run: called CC=11 SCAR=26.1
Pod
documented
| |||||||||||||||||||||||||||||||
| 16 | 1 | my ($options) = @_; | |||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||||
| 18 | 2 | ▶ | no strict "refs"; ## no critic | ||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||||
| 20 | 1 | my %results = (); | |||||||||||||||||||||||||||||
| 21 | 1 | my $verbose = $options->{verbose}; | |||||||||||||||||||||||||||||
| 22 | 1 | my $subtests = $options->{subtests}; | |||||||||||||||||||||||||||||
| 23 | 0 | ▶ | my @subtests = scalar(@{$subtests||[]}) ? @{$subtests||[]} : @default_subtests; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition25%1/4
$subtests || []
$subtests || []
MC/DC0%0/1
$subtests || []
$subtests
MC/DC0%0/1
$subtests || []
$subtests
Truth table50%1/2
A
A= $subtests
Truth table0%0/2
A
A= $subtests
| |||||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||||
| 25 | 1 | for my $subtest (@subtests) | |||||||||||||||||||||||||||||
| 26 | { | ||||||||||||||||||||||||||||||
| 27 | 2 | ▶ | print STDERR "# - $subtest...\n" if $options->{verbose} > 2; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 28 | 0 | ▶ | eval "use ".__PACKAGE__."::$subtest"; ## no critic | ||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.2
Subroutine
BEGIN: called CC=1 SCAR=0.2
| |||||||||||||||||||||||||||||||
| 29 | 2 | ▶ | if ($@) { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 30 | 1 | ▶ | print STDERR "# Skip PerlStone plugin '$subtest'" if $verbose; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 31 | 1 | ▶ | print STDERR ":$@" if $verbose >= 2; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 32 | 1 | ▶ | print STDERR "\n" if $verbose; | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 33 | } | ||||||||||||||||||||||||||||||
| 34 | else { | ||||||||||||||||||||||||||||||
| 35 | 1 | eval { | |||||||||||||||||||||||||||||
| 36 | 1 | my $main = __PACKAGE__."::$subtest"."::main"; | |||||||||||||||||||||||||||||
| 37 | 1 | $results{$subtest} = $main->($options); | |||||||||||||||||||||||||||||
| 38 | }; | ||||||||||||||||||||||||||||||
| 39 | 1 | ▶ | if ($@) { | ||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||
| 40 | 0 | $results{$subtest} = { failed => $@ }; | |||||||||||||||||||||||||||||
| 41 | } | ||||||||||||||||||||||||||||||
| 42 | } | ||||||||||||||||||||||||||||||
| 43 | } | ||||||||||||||||||||||||||||||
| 44 | 1 | return \%results; | |||||||||||||||||||||||||||||
| 45 | } | ||||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||||
| 47 | sub main | ||||||||||||||||||||||||||||||
| 48 | 1 | ▶ | { | ||||||||||||||||||||||||||||
|
Subroutine
main: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||
| 49 | 1 | my ($options) = @_; | |||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||||
| 51 | 1 | my $results = run($options); | |||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||||
| 53 | 1 | return $results; | |||||||||||||||||||||||||||||
| 54 | } | ||||||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||||
| 56 | 2 | 1; # End of Benchmark::Perl::Formance::Plugin::PerlStone2015 | |||||||||||||||||||||||||||||
| 57 | |||||||||||||||||||||||||||||||
| 58 | __END__ | ||||||||||||||||||||||||||||||