summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2018-02-04 19:31:16 +0100
committerDaniel Friesel <derf@finalrewind.org>2018-02-04 19:31:16 +0100
commitb0bd5ee468aa566ff22e30f6b36fc9eef5b60524 (patch)
tree4fc2ae1a69deb325d5be781b4de30ef5bee1379f /test
parent21b9e37eb8fb04e172d7bc00a938dd1d616a9359 (diff)
mandoc test: Check for mandoc in PATH, only fail in case of errors
Diffstat (limited to 'test')
-rwxr-xr-xtest/mandoc.t13
1 files changed, 10 insertions, 3 deletions
diff --git a/test/mandoc.t b/test/mandoc.t
index 3740809..638c5e9 100755
--- a/test/mandoc.t
+++ b/test/mandoc.t
@@ -6,15 +6,22 @@ use 5.010;
use Test::More tests => 3;
SKIP: {
- qx{mandoc -V};
+ my $mandoc_present = 0;
- if ( $? != 0 ) {
+ for my $path (split(qr{:}, $ENV{PATH})) {
+ if (-x "${path}/mandoc") {
+ $mandoc_present = 1;
+ last;
+ }
+ }
+
+ if ( not $mandoc_present ) {
diag('mandoc not installed, test skipped. This is NOT fatal.');
skip( 'mandoc not installed', 3 );
}
for my $file ( 'feh', 'feh-cam', 'gen-cam-menu' ) {
- qx{mandoc -Tlint man/${file}.1};
+ qx{mandoc -Tlint -Werror man/${file}.1};
is( $?, 0, "${file}.1: Valid mdoc syntax" );
}
}