texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[8336] test_utils.pl


From: gavinsmith0123
Subject: [8336] test_utils.pl
Date: Fri, 19 Oct 2018 06:46:44 -0400 (EDT)

Revision: 8336
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=8336
Author:   gavin
Date:     2018-10-19 06:46:44 -0400 (Fri, 19 Oct 2018)
Log Message:
-----------
test_utils.pl

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/tp/t/test_utils.pl

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog     2018-10-18 21:00:26 UTC (rev 8335)
+++ trunk/ChangeLog     2018-10-19 10:46:44 UTC (rev 8336)
@@ -1,3 +1,13 @@
+2018-10-19  Gavin Smith  <address@hidden>
+
+       * tp/t/test_utils.pl: Create the output directory for the test
+       before running the conversion.  This means that if the test 
+       needs to create output files, the directory to contain them will 
+       exist.  It didn't exist the first time a test file was run when 
+       the very first test in the file needed to create output.
+       If there are conversion errors from texi2any, print them instead 
+       of just printing a message "Warning: output generated".
+
 2018-10-18  Gavin Smith  <address@hidden>
        
        * tp/tests/formatting/list-of-tests

Modified: trunk/tp/t/test_utils.pl
===================================================================
--- trunk/tp/t/test_utils.pl    2018-10-18 21:00:26 UTC (rev 8335)
+++ trunk/tp/t/test_utils.pl    2018-10-19 10:46:44 UTC (rev 8336)
@@ -663,6 +663,14 @@
     }
     delete $parser_options->{'test_split'};
   }
+
+  if (!$self->{'generate'}) {
+    mkdir "t/results/$self->{'name'}" if (! -d "t/results/$self->{'name'}");
+  } else {
+    mkdir $srcdir."t/results/$self->{'name'}"
+      if (! -d $srcdir."t/results/$self->{'name'}");
+  }
+
   my %todos;
   if ($parser_options->{'todo'}) {
     %todos = %{$parser_options->{'todo'}};
@@ -782,9 +790,14 @@
            = &{$formats{$format}}($self, $test_name, $format_type, 
                                   $result, $parser, 
                                   $parser_options, $format_converter_options);
+
+      # TODO: is it really useful to give this warning?
       $converted_errors{$format} = undef if (address@hidden);
       if (defined($converted{$format}) and $format =~ /^file_/) {
-        warn "Warning: output generated for $format by $test_name\n";
+        warn "Warning: errors printed for $format by $test_name\n";
+        foreach my $error_message (@{$converted_errors{$format}}) {
+          warn $error_message->{'error_line'};
+        }
       }
       #print STDERR "$format: \n$converted{$format}";
 
@@ -875,13 +888,9 @@
     my $out_file;
     if (!$self->{'generate'}) {
       $out_file = $new_file;
-      mkdir "t/results/$self->{'name'}" if (! -d "t/results/$self->{'name'}");
     } else {
       $out_file = $srcdir.$file;
-      mkdir $srcdir."t/results/$self->{'name'}"
-        if (! -d $srcdir."t/results/$self->{'name'}");
     }
-
     open (OUT, ">$out_file") or die "Open $out_file: $!\n";
     binmode (OUT, ":encoding(utf8)");
     print OUT 'use vars qw(%result_texis %result_texts %result_trees 
%result_errors '."\n".




reply via email to

[Prev in Thread] Current Thread [Next in Thread]