1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
|
#!perl
use strict;
use warnings;
use Test;
use IPC::Run3::ProfReporter;
my $p;
my @tests = (
sub {
$p = IPC::Run3::ProfReporter->new;;
ok UNIVERSAL::isa( $p, "IPC::Run3::ProfReporter" );
},
sub {
$p->app_call( [], 0.1 );
ok $p->get_app_call_time, 0.1;
},
sub {
$p->app_exit( 1.2 );
ok $p->get_app_exit_time, 1.2;
},
sub {
ok $p->get_app_time > 1.09;
},
sub {
ok $p->get_app_cumulative_time > 1.09;
},
sub {
$p->run_exit( [], 0.1, 0.2, 0.3, 0.4 );
ok $p->get_run_call_time, 0.1;
},
sub {
ok $p->get_sys_call_time, 0.2;
},
);
plan tests => 0+@tests;
$_->() for @tests;
|