[BACK]Return to regress.pl CVS log [TXT][DIR] Up to [cvsweb.bsd.lv] / mandoc / regress

Diff for /mandoc/regress/regress.pl between version 1.8 and 1.13

version 1.8, 2017/07/18 18:47:06 version 1.13, 2020/01/08 10:37:53
Line 27  use IPC::Open3 qw(open3);
Line 27  use IPC::Open3 qw(open3);
 # Define this at one place such that it can easily be changed  # Define this at one place such that it can easily be changed
 # if diff(1) does not support the -a option.  # if diff(1) does not support the -a option.
 my @diff = qw(diff -au);  my @diff = qw(diff -au);
   system @diff, '/dev/null', '/dev/null' and @diff = qw(diff -u);
   
 # --- utility functions ------------------------------------------------  # --- utility functions ------------------------------------------------
   
Line 79  sub syshtml ($@) {
Line 80  sub syshtml ($@) {
         open my $outfd, '>', $outfile or die "$outfile: $!";          open my $outfd, '>', $outfile or die "$outfile: $!";
         my $infd;          my $infd;
         my $pid = open3 undef, $infd, undef, @_;          my $pid = open3 undef, $infd, undef, @_;
         my $state;          my $state = 0;
         while (<$infd>) {          while (<$infd>) {
                 chomp;                  chomp;
                 if (!$state && s/.*<math class="eqn">//) {                  if (!$state && s/.*<math class="eqn">//) {
                         $state = 1;                          $state = 'math';
                         next unless length;                          next unless length;
                   } elsif (/BEGINTEST/) {
                           $state = 'other';
                           next;
                   } elsif (/ENDTEST/) {
                           $state = 0;
                           next;
                 }                  }
                 $state = 1 if /^BEGINTEST/;                  if ($state eq 'math') {
                 if ($state && s/<\/math>.*//) {  
                         s/^ *//;                          s/^ *//;
                         print $outfd "$_\n" if length;                          if (s/<\/math>.*//) {
                         undef $state;                                  print $outfd "$_\n" if length;
                         next;                                  $state = 0;
                                   next;
                           }
                 }                  }
                 s/^ *//;  
                 print $outfd "$_\n" if $state;                  print $outfd "$_\n" if $state;
                 undef $state if /^ENDTEST/;  
         }          }
         close $outfd;          close $outfd;
         close $infd;          close $infd;
Line 159  foreach my $module (qw(roff char mdoc man tbl eqn)) {
Line 165  foreach my $module (qw(roff char mdoc man tbl eqn)) {
                 my %subvars = (MOPTS => '');                  my %subvars = (MOPTS => '');
                 parse_makefile "$module/$subdir/Makefile", \%subvars;                  parse_makefile "$module/$subdir/Makefile", \%subvars;
                 parse_makefile "$module/Makefile.inc", \%subvars;                  parse_makefile "$module/Makefile.inc", \%subvars;
                   delete $subvars{GOPTS};
                 delete $subvars{SKIP_GROFF};                  delete $subvars{SKIP_GROFF};
                 delete $subvars{SKIP_GROFF_ASCII};                  delete $subvars{SKIP_GROFF_ASCII};
                 delete $subvars{TBL};  
                 delete $subvars{EQN};  
                 my @mandoc = ('../mandoc', split ' ', $subvars{MOPTS});                  my @mandoc = ('../mandoc', split ' ', $subvars{MOPTS});
                 delete $subvars{MOPTS};                  delete $subvars{MOPTS};
                 my @regress_testnames;                  my @regress_testnames;
Line 421  if ($count_total == 1) {
Line 426  if ($count_total == 1) {
         print "\n";          print "\n";
 } else {  } else {
         print "No tests were run.\n";          print "No tests were run.\n";
 }  }
 if ($targets{clean}) {  if ($targets{clean}) {
         if ($count_rm) {          if ($count_rm) {
                 print "Deleted $count_rm test output files.\n";                  print "Deleted $count_rm test output files.\n";

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.13

CVSweb