version 1.1, 2017/02/08 03:02:13 |
version 1.3, 2017/02/09 15:34:28 |
|
|
# nor for piping it into the Perl program. |
# nor for piping it into the Perl program. |
use IPC::Open3 qw(open3); |
use IPC::Open3 qw(open3); |
|
|
|
# Define this at one place such that it can easily be changed |
|
# if diff(1) does not support the -a option. |
|
my @diff = qw(diff -au); |
|
|
# --- utility functions ------------------------------------------------ |
# --- utility functions ------------------------------------------------ |
|
|
sub usage ($) { |
sub usage ($) { |
Line 138 sub parse_makefile ($) { |
|
Line 142 sub parse_makefile ($) { |
|
my $var = $1; |
my $var = $1; |
my $opt = $2; |
my $opt = $2; |
my $val = $3; |
my $val = $3; |
$val =~ s/\${(\w+)}/$vars{$1}/; |
$val =~ s/\$\{(\w+)\}/$vars{$1}/; |
$val = "$vars{$var} $val" if $opt eq '+'; |
$val = "$vars{$var} $val" if $opt eq '+'; |
$vars{$var} = $val |
$vars{$var} = $val |
unless $opt eq '?' && defined $vars{$var}; |
unless $opt eq '?' && defined $vars{$var}; |
Line 227 for my $testname (@regress_testnames) { |
|
Line 231 for my $testname (@regress_testnames) { |
|
print "@mandoc -T ascii $i\n" if $targets{verbose}; |
print "@mandoc -T ascii $i\n" if $targets{verbose}; |
sysout $o, @mandoc, qw(-T ascii), $i |
sysout $o, @mandoc, qw(-T ascii), $i |
and fail $subdir, $testname, 'ascii:mandoc'; |
and fail $subdir, $testname, 'ascii:mandoc'; |
system qw(diff -au), $w, $o |
system @diff, $w, $o |
and fail $subdir, $testname, 'ascii:diff'; |
and fail $subdir, $testname, 'ascii:diff'; |
} |
} |
my $m = "$subdir/$testname.in_man"; |
my $m = "$subdir/$testname.in_man"; |
Line 241 for my $testname (@regress_testnames) { |
|
Line 245 for my $testname (@regress_testnames) { |
|
print "@mandoc -man -T ascii $m\n" if $targets{verbose}; |
print "@mandoc -man -T ascii $m\n" if $targets{verbose}; |
sysout $mo, @mandoc, qw(-man -T ascii -O mdoc), $m |
sysout $mo, @mandoc, qw(-man -T ascii -O mdoc), $m |
and fail $subdir, $testname, 'man:mandoc'; |
and fail $subdir, $testname, 'man:mandoc'; |
system qw(diff -au), $w, $mo |
system @diff, $w, $mo |
and fail $subdir, $testname, 'man:diff'; |
and fail $subdir, $testname, 'man:diff'; |
} |
} |
if ($targets{clean}) { |
if ($targets{clean}) { |
Line 266 for my $testname (@utf8_testnames) { |
|
Line 270 for my $testname (@utf8_testnames) { |
|
print "@mandoc -T utf8 $i\n" if $targets{verbose}; |
print "@mandoc -T utf8 $i\n" if $targets{verbose}; |
sysout $o, @mandoc, qw(-T utf8), $i |
sysout $o, @mandoc, qw(-T utf8), $i |
and fail $subdir, $testname, 'utf8:mandoc'; |
and fail $subdir, $testname, 'utf8:mandoc'; |
system qw(diff -au), $w, $o |
system @diff, $w, $o |
and fail $subdir, $testname, 'utf8:diff'; |
and fail $subdir, $testname, 'utf8:diff'; |
} |
} |
if ($targets{clean}) { |
if ($targets{clean}) { |
Line 287 for my $testname (@html_testnames) { |
|
Line 291 for my $testname (@html_testnames) { |
|
print "@mandoc -T html $i\n" if $targets{verbose}; |
print "@mandoc -T html $i\n" if $targets{verbose}; |
syshtml $o, @mandoc, qw(-T html), $i |
syshtml $o, @mandoc, qw(-T html), $i |
and fail $subdir, $testname, 'html:mandoc'; |
and fail $subdir, $testname, 'html:mandoc'; |
system qw(diff -au), $w, $o |
system @diff, $w, $o |
and fail $subdir, $testname, 'html:diff'; |
and fail $subdir, $testname, 'html:diff'; |
} |
} |
if ($targets{clean}) { |
if ($targets{clean}) { |
Line 308 for my $testname (@lint_testnames) { |
|
Line 312 for my $testname (@lint_testnames) { |
|
print "@mandoc -T lint $i\n" if $targets{verbose}; |
print "@mandoc -T lint $i\n" if $targets{verbose}; |
syslint $o, @mandoc, qw(-T lint), $i |
syslint $o, @mandoc, qw(-T lint), $i |
and fail $subdir, $testname, 'lint:mandoc'; |
and fail $subdir, $testname, 'lint:mandoc'; |
system qw(diff -au), $w, $o |
system @diff, $w, $o |
and fail $subdir, $testname, 'lint:diff'; |
and fail $subdir, $testname, 'lint:diff'; |
} |
} |
if ($targets{clean}) { |
if ($targets{clean}) { |