Revision: 1371
Author: [email protected]
Date: Wed Sep 29 14:05:42 2010
Log: Updates tests for new functionality in Sub::Name 0.06 (assuming the
relevant Sub::Name patch is applied)
http://code.google.com/p/perl-devel-nytprof/source/detail?r=1371
Modified:
/trunk/Changes
/trunk/t/70-subname.t
=======================================
--- /trunk/Changes Fri Sep 24 07:28:35 2010
+++ /trunk/Changes Wed Sep 29 14:05:42 2010
@@ -10,6 +10,7 @@
Added note to the docs re profiling applications that use Coro.
Clarified usecputime=1 docs.
+ Updates tests for new functionality in Sub::Name 0.06.
=head2 Changes in Devel::NYTProf 4.05 (svn 1359) 15th Sept 2010
=======================================
--- /trunk/t/70-subname.t Fri Mar 12 17:42:55 2010
+++ /trunk/t/70-subname.t Wed Sep 29 14:05:42 2010
@@ -7,8 +7,9 @@
use NYTProfTest;
eval "use Sub::Name 0.04; 1"
- or plan skip_all => "Sub::Name required";
-
+ or plan skip_all => "Sub::Name 0.04 required (0.06+ preferred)";
+
+print "Sub::Name $Sub::Name::VERSION $INC{'Sub/Name.pm'}\n";
use Devel::NYTProf::Run qw(profile_this);
@@ -16,8 +17,8 @@
run_test_group( {
extra_options => {
- start => 'init', compress => 1, leave => 0, stmts => 0, slowops
=> 0,
- },
+ start => 'init', compress => 1, leave => 0, stmts => 0, slowops =>
0,
+ },
extra_test_count => 2,
extra_test_code => sub {
my ($profile, $env) = @_;
@@ -26,13 +27,23 @@
src_code => $src_code,
out_file => $env->{file},
skip_sitecustomize => 1,
- #htmlopen => 1,
+ #htmlopen => 1,
);
isa_ok $profile, 'Devel::NYTProf::Data';
my $subs = $profile->subname_subinfo_map;
- ok $subs->{'main::named'};
+ my $sub = $subs->{'main::named'};
+ ok $sub;
+ is $sub->calls, 1;
+ is $sub->subname, 'main::named';
+
+ SKIP: {
+ skip "Sub::Name 0.06 required for subname line numbers", 2
+ if $Sub::Name::VERSION <= 0.06;
+ is $sub->first_line, 3;
+ is $sub->last_line, 3;
+ }
},
});
--
You've received this message because you are subscribed to
the Devel::NYTProf Development User group.
Group hosted at: http://groups.google.com/group/develnytprof-dev
Project hosted at: http://perl-devel-nytprof.googlecode.com
CPAN distribution: http://search.cpan.org/dist/Devel-NYTProf
To post, email: [email protected]
To unsubscribe, email: [email protected]