=================================================================== RCS file: /cvs/mandoc/regress/regress.pl,v retrieving revision 1.8 retrieving revision 1.13 diff -u -p -r1.8 -r1.13 --- mandoc/regress/regress.pl 2017/07/18 18:47:06 1.8 +++ mandoc/regress/regress.pl 2020/01/08 10:37:53 1.13 @@ -1,6 +1,6 @@ #!/usr/bin/env perl # -# $Id: regress.pl,v 1.8 2017/07/18 18:47:06 schwarze Exp $ +# $Id: regress.pl,v 1.13 2020/01/08 10:37:53 schwarze Exp $ # # Copyright (c) 2017 Ingo Schwarze # @@ -27,6 +27,7 @@ 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); +system @diff, '/dev/null', '/dev/null' and @diff = qw(diff -u); # --- utility functions ------------------------------------------------ @@ -79,23 +80,28 @@ sub syshtml ($@) { open my $outfd, '>', $outfile or die "$outfile: $!"; my $infd; my $pid = open3 undef, $infd, undef, @_; - my $state; + my $state = 0; while (<$infd>) { chomp; if (!$state && s/.*//) { - $state = 1; + $state = 'math'; next unless length; + } elsif (/BEGINTEST/) { + $state = 'other'; + next; + } elsif (/ENDTEST/) { + $state = 0; + next; } - $state = 1 if /^BEGINTEST/; - if ($state && s/<\/math>.*//) { + if ($state eq 'math') { s/^ *//; - print $outfd "$_\n" if length; - undef $state; - next; + if (s/<\/math>.*//) { + print $outfd "$_\n" if length; + $state = 0; + next; + } } - s/^ *//; print $outfd "$_\n" if $state; - undef $state if /^ENDTEST/; } close $outfd; close $infd; @@ -159,10 +165,9 @@ foreach my $module (qw(roff char mdoc man tbl eqn)) { my %subvars = (MOPTS => ''); parse_makefile "$module/$subdir/Makefile", \%subvars; parse_makefile "$module/Makefile.inc", \%subvars; + delete $subvars{GOPTS}; delete $subvars{SKIP_GROFF}; delete $subvars{SKIP_GROFF_ASCII}; - delete $subvars{TBL}; - delete $subvars{EQN}; my @mandoc = ('../mandoc', split ' ', $subvars{MOPTS}); delete $subvars{MOPTS}; my @regress_testnames; @@ -421,7 +426,7 @@ if ($count_total == 1) { print "\n"; } else { print "No tests were run.\n"; -} +} if ($targets{clean}) { if ($count_rm) { print "Deleted $count_rm test output files.\n";