Author: tim.bunce
Date: Wed Nov 19 05:23:52 2008
New Revision: 612
Added:
trunk/t/test21-streval3.p
Modified:
trunk/MANIFEST
trunk/t/20.runtests.t
Log:
Add new test for nested string evals. Currently fails because we don't yet
propagate inner evals times to the outermost eval statement.
Tidied up timing test failure messages.
Modified: trunk/MANIFEST
==============================================================================
--- trunk/MANIFEST (original)
+++ trunk/MANIFEST Wed Nov 19 05:23:52 2008
@@ -86,6 +86,8 @@
t/test20-streval.p
t/test20-streval.rdt
t/test20-streval.x
+t/test21-streval3.x
+t/test21-streval3.p
t/test30-fork.0.p
t/test30-fork.0.rdt
t/test30-fork.0.x
Modified: trunk/t/20.runtests.t
==============================================================================
--- trunk/t/20.runtests.t (original)
+++ trunk/t/20.runtests.t Wed Nov 19 05:23:52 2008
@@ -313,11 +313,11 @@
)
{
my $expected = $1;
- my $percent = ($t0 / $expected) * 100; # <100 if faster,
>100 if slower
+ my $percent = int(($t0 / $expected) * 100); # <100 if
faster, >100 if slower
# Test aproximate times
push @accuracy_errors,
- "$test line $index: got $t0 expected approx $expected for
time ($percent%%)"
+ "$test line $index: got $t0 expected approx $expected for
time ($percent%)"
# if it was faster than expected then it should only be
slightly faster
if ($percent < 95)
@@ -345,7 +345,7 @@
spit_file("$test.new", join("", @got));
diff_files($test, "$test.new");
};
- is(join("\n", @accuracy_errors), '', "$test has no accuracy errors");
+ is(join("\n", @accuracy_errors), '', "$test times should be
reasonable");
}
Added: trunk/t/test21-streval3.p
==============================================================================
--- (empty file)
+++ trunk/t/test21-streval3.p Wed Nov 19 05:23:52 2008
@@ -0,0 +1,17 @@
+# test nested string evals
+# inner time should propagate to outermost eval
+# statement counts currently don't - debatable value
+sub foo { 1 }
+my $code = q{
+ select(undef,undef,undef,0.2);
+ foo();
+ eval q{
+ select(undef,undef,undef,0.2);
+ foo();
+ eval q{
+ select(undef,undef,undef,0.2);
+ foo();
+ }
+ }
+};
+eval $code;
--~--~---------~--~----~------------~-------~--~----~
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]
-~----------~----~----~----~------~----~------~--~---