Revision: 1080
Author: tim.bunce
Date: Tue Feb 23 01:40:54 2010
Log: Make t/61-cputime more verbose, especially on freebsd
re http://www.cpantesters.org/cpan/report/6854616

http://code.google.com/p/perl-devel-nytprof/source/detail?r=1080

Modified:
 /trunk/HACKING
 /trunk/lib/Devel/NYTProf/Run.pm
 /trunk/t/61-cputime.t

=======================================
--- /trunk/HACKING      Sat Feb 20 05:21:47 2010
+++ /trunk/HACKING      Tue Feb 23 01:40:54 2010
@@ -396,6 +396,3 @@
 http://developers.sun.com/solaris/articles/time_stamp.html
 http://www.informit.com/guides/content.aspx?g=cplusplus&seqNum=332

-Use clock_gettime clone on OS X?
-http://developer.apple.com/mac/library/qa/qa2004/qa1398.html
-http://le-depotoir.googlecode.com/svn/trunk/misc/clock_gettime_stub.c
=======================================
--- /trunk/lib/Devel/NYTProf/Run.pm     Sat Feb 20 04:41:18 2010
+++ /trunk/lib/Devel/NYTProf/Run.pm     Tue Feb 23 01:40:54 2010
@@ -51,9 +51,9 @@
     my $out_file = $opt{out_file} || 'nytprof.out';

     my @perl = ($this_perl, '-d:NYTProf');
-    warn sprintf "profile_this using %s with NYTPROF=%s\n",
+    warn sprintf "profile_this() using %s with NYTPROF=%s\n",
             join(" ", @perl), $ENV{NYTPROF} || ''
-        if 0;
+        if $opt{verbose};

# ensure child has same libs as us (e.g., if we were run with perl -Mblib)
     local $ENV{PERL5LIB} = join($Config{path_sep}, @INC);
=======================================
--- /trunk/t/61-cputime.t       Sun Feb 21 08:22:38 2010
+++ /trunk/t/61-cputime.t       Tue Feb 23 01:40:54 2010
@@ -26,15 +26,16 @@
             src_code => $src_code,
             out_file => $env->{file},
             #htmlopen => 1,
+            verbose => ($^O eq 'freebsd' or 1), # XXX temp
         );
         isa_ok $profile, 'Devel::NYTProf::Data';

         my $subs = $profile->subname_subinfo_map;
         my $sub = $subs->{'main::foo'};
         ok $sub;
-        is $sub->calls, 1, 'main::foo should be called 1 times';
- cmp_ok $sub->incl_time, '>', 0.4, 'cputime of foo() should be at least ~0.5'; - cmp_ok $sub->incl_time, '<', 1.0, 'cputime of foo() should be around 0.5';
+        is $sub->calls, 1, 'main::foo should be called 1 time';
+ cmp_ok $sub->incl_time, '>', 0.4, 'cputime of foo() should be at least 0.4'; + cmp_ok $sub->incl_time, '<', 1.0, 'cputime of foo() should be not much more than 0.4'; is $sub->incl_time, $sub->excl_time, 'incl_time and excl_time should be the same';
     },
 });
@@ -44,7 +45,7 @@

 alarm(20); # watchdog timer

-my $trace = 0;
+my $trace = ($^O eq 'freebsd' or 1) ? 2 : 1; # XXX temp
 my $cpu1 = (times)[0];
 my $cpu2;

@@ -60,7 +61,7 @@
     while (++$loops) {

         my $crnt = (times)[0];
-        warn "tick $crnt ".time()."\n"
+        warn "tick $crnt\t".time()."\n"
             if $crnt != $prev and $trace >= 2;
         $prev = $crnt;

--
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]

Reply via email to