Revision: 1165
Author: tim.bunce
Date: Thu Mar 11 09:06:47 2010
Log: Added test t/70-subname using Sub::Name. Tweaked t/61-cputime to be
less verbose.
http://code.google.com/p/perl-devel-nytprof/source/detail?r=1165
Added:
/trunk/t/70-subname.t
Modified:
/trunk/MANIFEST
/trunk/t/61-cputime.t
=======================================
--- /dev/null
+++ /trunk/t/70-subname.t Thu Mar 11 09:06:47 2010
@@ -0,0 +1,42 @@
+# Tests CORE::GLOBAL::foo plus assorted data model methods
+
+use strict;
+use Test::More;
+
+use lib qw(t/lib);
+use NYTProfTest;
+
+eval { use Sub::Name 0.04; 1 }
+ or plan skip_all => "Sub::Name required";
+
+
+use Devel::NYTProf::Run qw(profile_this);
+
+my $src_code = join("", <DATA>);
+
+run_test_group( {
+ extra_options => {
+ start => 'init', compress => 1, leave => 0, stmts => 0, slowops
=> 0,
+ },
+ extra_test_count => 2,
+ extra_test_code => sub {
+ my ($profile, $env) = @_;
+
+ $profile = profile_this(
+ src_code => $src_code,
+ out_file => $env->{file},
+ skip_sitecustomize => 1,
+ #htmlopen => 1,
+ );
+ isa_ok $profile, 'Devel::NYTProf::Data';
+
+ my $subs = $profile->subname_subinfo_map;
+
+ ok $subs->{'main::named'};
+ },
+});
+
+__DATA__
+#!perl
+use Sub::Name;
+(subname 'named' => sub { print "sub called\n" })->();
=======================================
--- /trunk/MANIFEST Mon Mar 1 09:20:41 2010
+++ /trunk/MANIFEST Thu Mar 11 09:06:47 2010
@@ -62,6 +62,7 @@
t/50-errno.t
t/60-forkdepth.t
t/61-cputime.t
+t/70-subname.t
t/80-version.t
t/90-pod.t
t/91-pod_coverage.t
=======================================
--- /trunk/t/61-cputime.t Thu Mar 11 03:02:29 2010
+++ /trunk/t/61-cputime.t Thu Mar 11 09:06:47 2010
@@ -51,7 +51,7 @@
alarm(20); # watchdog timer
-my $trace = ($^O eq 'freebsd') ? 2 : 1; # XXX temp
+my $trace = 0;
my $cpu1;
my $cpu2;
--
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]