Author: tim.bunce
Date: Wed Jul 15 14:22:57 2009
New Revision: 830
Added:
trunk/t/test17-goto.p
trunk/t/test17-goto.rdt
trunk/t/test17-goto.t
Modified:
trunk/MANIFEST
Log:
Added test for goto. (Its time to bite that bulleat as it's distoring the
call graph, e.g, when Exporter delegates to Exporter::Heavy)
Modified: trunk/MANIFEST
==============================================================================
--- trunk/MANIFEST (original)
+++ trunk/MANIFEST Wed Jul 15 14:22:57 2009
@@ -103,6 +103,9 @@
t/test16.rdt
t/test16.t
t/test16.x
+t/test17-goto.p
+t/test17-goto.rdt
+t/test17-goto.t
t/test20-streval.p
t/test20-streval.rdt
t/test20-streval.t
Added: trunk/t/test17-goto.p
==============================================================================
--- (empty file)
+++ trunk/t/test17-goto.p Wed Jul 15 14:22:57 2009
@@ -0,0 +1,35 @@
+# test various forms of goto
+
+# simple in-line goto
+
+goto main_label;
+die "should not get here";
+main_label:;
+
+sub other { } # stub for checking sub caller info
+
+# goto &sub
+
+sub origin {
+ other();
+ goto &destination;
+}
+
+sub destination {
+ other();
+}
+
+origin();
+
+# goto out of a sub
+
+sub bar {
+ goto foo_label;
+}
+
+sub foo {
+ bar();
+ foo_label:;
+}
+
+foo();
Added: trunk/t/test17-goto.rdt
==============================================================================
--- (empty file)
+++ trunk/t/test17-goto.rdt Wed Jul 15 14:22:57 2009
@@ -0,0 +1,69 @@
+attribute application test17-goto.p
+attribute basetime 0
+attribute clock_id 0
+attribute nv_size 0
+attribute perl_version 0
+attribute profiler_duration 0
+attribute profiler_end_time 0
+attribute profiler_start_time 0
+attribute ticks_per_sec 0
+attribute total_stmts_discounted 0
+attribute total_stmts_duration 0
+attribute total_stmts_measured 0
+attribute total_sub_calls 0
+attribute xs_version 0
+fid_block_time 1 5 [ 0 1 ]
+fid_block_time 1 7 [ 0 1 ]
+fid_block_time 1 9 [ 0 2 ]
+fid_block_time 1 14 [ 0 2 ]
+fid_block_time 1 19 [ 0 1 ]
+fid_block_time 1 22 [ 0 1 ]
+fid_block_time 1 27 [ 0 1 ]
+fid_block_time 1 31 [ 0 2 ]
+fid_block_time 1 35 [ 0 1 ]
+fid_fileinfo 1 [ test17-goto.p 1 2 0 0 ]
+fid_fileinfo 1 sub main::BEGIN 0-0
+fid_fileinfo 1 sub main::bar 26-28
+fid_fileinfo 1 sub main::destination 18-20
+fid_fileinfo 1 sub main::foo 30-33
+fid_fileinfo 1 sub main::origin 13-16
+fid_fileinfo 1 sub main::other 9-9
+fid_fileinfo 1 call 14 main::other [ 1 0 0 0 0 0 0
main::origin ]
+fid_fileinfo 1 call 19 main::other [ 1 0 0 0 0 0 0
main::destination ]
+fid_fileinfo 1 call 22 main::origin [ 1 0 0 0 0 0 0
main::BEGIN ]
+fid_fileinfo 1 call 31 main::bar [ 1 0 0 0 0 0 0
main::foo ]
+fid_fileinfo 1 call 35 main::foo [ 1 0 0 0 0 0 0
main::BEGIN ]
+fid_line_time 1 5 [ 0 1 ]
+fid_line_time 1 7 [ 0 1 ]
+fid_line_time 1 9 [ 0 2 ]
+fid_line_time 1 14 [ 0 1 ]
+fid_line_time 1 15 [ 0 1 ]
+fid_line_time 1 19 [ 0 1 ]
+fid_line_time 1 22 [ 0 1 ]
+fid_line_time 1 27 [ 0 1 ]
+fid_line_time 1 31 [ 0 1 ]
+fid_line_time 1 32 [ 0 1 ]
+fid_line_time 1 35 [ 0 1 ]
+fid_sub_time 1 5 [ 0 1 ]
+fid_sub_time 1 7 [ 0 1 ]
+fid_sub_time 1 9 [ 0 2 ]
+fid_sub_time 1 14 [ 0 2 ]
+fid_sub_time 1 19 [ 0 1 ]
+fid_sub_time 1 22 [ 0 1 ]
+fid_sub_time 1 27 [ 0 1 ]
+fid_sub_time 1 31 [ 0 2 ]
+fid_sub_time 1 35 [ 0 1 ]
+profile_modes fid_block_time block
+profile_modes fid_line_time line
+profile_modes fid_sub_time sub
+sub_subinfo main::BEGIN [ 1 0 0 0 0 0 0 0 ]
+sub_subinfo main::bar [ 1 26 28 1 0 0 0 0 ]
+sub_subinfo main::bar called_by 1 31 [ 1 0 0 0 0 0 0
main::foo ]
+sub_subinfo main::destination [ 1 18 20 0 0 0 0 0 ]
+sub_subinfo main::foo [ 1 30 33 1 0 0 0 0 ]
+sub_subinfo main::foo called_by 1 35 [ 1 0 0 0 0 0 0
main::BEGIN ]
+sub_subinfo main::origin [ 1 13 16 1 0 0 0 0 ]
+sub_subinfo main::origin called_by 1 22 [ 1 0 0 0 0 0 0
main::BEGIN ]
+sub_subinfo main::other [ 1 9 9 2 0 0 0 0 ]
+sub_subinfo main::other called_by 1 14 [ 1 0 0 0 0 0 0
main::origin ]
+sub_subinfo main::other called_by 1 19 [ 1 0 0 0 0 0 0
main::destination ]
Added: trunk/t/test17-goto.t
==============================================================================
--- (empty file)
+++ trunk/t/test17-goto.t Wed Jul 15 14:22:57 2009
@@ -0,0 +1,6 @@
+use strict;
+use Test::More;
+use lib qw(t/lib);
+use NYTProfTest;
+
+run_test_group;
--~--~---------~--~----~------------~-------~--~----~
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]
-~----------~----~----~----~------~----~------~--~---