git.shiar.nl
/
barcat.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
t/examples: skip missing command dependencies
[barcat.git]
/
t
/
examples.t
diff --git
a/t/examples.t
b/t/examples.t
index a331ce352d5322d9aa26b8f4e0af1973ea7c1555..29f7c5024109594b56261d6d175cbf4a1f976b9d 100755
(executable)
--- a/
t/examples.t
+++ b/
t/examples.t
@@
-21,6
+21,7
@@
open my $input, '<', $filename
local $/ = "\n\n";
while (readline $input) {
local $/ = "\n\n";
while (readline $input) {
+SKIP: {
# find scriptlets in the appropriate section
/^=head1 EXAMPLES/ ... /^=head1/ or next;
/^\h/ or next; # indented code snippet
# find scriptlets in the appropriate section
/^=head1 EXAMPLES/ ... /^=head1/ or next;
/^\h/ or next; # indented code snippet
@@
-68,6
+69,12
@@
while (readline $input) {
$cmd =~ s/\b$subcmd/$args/;
}
$cmd =~ s/\b$subcmd/$args/;
}
+ for my $param ($cmd =~ m{^[(\h]* (\w\S*)}gx) {
+ $param eq 'cat' or
+ runres(['which', $param])
+ or diag("dependency $param missing at $ref\n$cmd"), skip($name, 1);
+ }
+
# run and report unexpected results
my $output = runres($cmd);
ok(!!$output, $name)
# run and report unexpected results
my $output = runres($cmd);
ok(!!$output, $name)
@@
-79,7
+86,7
@@
while (readline $input) {
if (open my $record, '>', "sample/out/t$numprefix-$name.txt") {
print {$record} $output;
}
if (open my $record, '>', "sample/out/t$numprefix-$name.txt") {
print {$record} $output;
}
-}
+}
}
sub runres {
my ($cmd) = @_;
sub runres {
my ($cmd) = @_;