summaryrefslogtreecommitdiff
path: root/t/run
diff options
context:
space:
mode:
authorShawn M Moore <code@sartak.org>2012-08-24 10:35:08 +0200
committerFather Chrysostomos <sprout@cpan.org>2012-08-28 07:13:44 -0700
commitfe83c362fb182e46bac02c1bd1cf0b8d82c9f1bf (patch)
tree9d7da5e5a98ef9a21b90f1067f175b54145e3de6 /t/run
parent9e7f031c1856270daeb95d2b6db9817469855476 (diff)
downloadperl-fe83c362fb182e46bac02c1bd1cf0b8d82c9f1bf.tar.gz
"op-entry" DTrace probe
Diffstat (limited to 't/run')
-rw-r--r--t/run/dtrace.t24
1 files changed, 22 insertions, 2 deletions
diff --git a/t/run/dtrace.t b/t/run/dtrace.t
index 625e403907..183868d5d3 100644
--- a/t/run/dtrace.t
+++ b/t/run/dtrace.t
@@ -24,7 +24,7 @@ use strict;
use warnings;
use IPC::Open2;
-plan(tests => 5);
+plan(tests => 7);
dtrace_like(
'1',
@@ -117,6 +117,21 @@ PHASES
'make sure sub-entry and phase-change interact well',
);
+dtrace_like(<< 'PERL_SCRIPT',
+ my $tmp = "foo";
+ $tmp =~ s/f/b/;
+ chop $tmp;
+PERL_SCRIPT
+ << 'D_SCRIPT',
+ op-entry { printf("op-entry <%s>\n", copyinstr(arg0)) }
+D_SCRIPT
+ [
+ qr/op-entry <subst>/,
+ qr/op-entry <schop>/,
+ ],
+ 'basic op probe',
+);
+
sub dtrace_like {
my $perl = shift;
my $probes = shift;
@@ -152,6 +167,11 @@ sub dtrace_like {
die "Unexpected error from DTrace: $result"
if $child_exit_status != 0;
- like($result, $expected, $name);
+ if (ref($expected) eq 'ARRAY') {
+ like($result, $_, $name) for @$expected;
+ }
+ else {
+ like($result, $expected, $name);
+ }
}