texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: * tp/t/test_utils.pl (%formats, test): add the ep


From: Patrice Dumas
Subject: branch master updated: * tp/t/test_utils.pl (%formats, test): add the epub_file format, associated to convert_to_html. Minor changes in code.
Date: Mon, 09 Sep 2024 03:08:30 -0400

This is an automated email from the git hooks/post-receive script.

pertusus pushed a commit to branch master
in repository texinfo.

The following commit(s) were added to refs/heads/master by this push:
     new fbdf9cc514 * tp/t/test_utils.pl (%formats, test): add the epub_file 
format, associated to convert_to_html. Minor changes in code.
fbdf9cc514 is described below

commit fbdf9cc514becd017e3724f5cff182370b4da1bc
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Mon Sep 9 09:08:15 2024 +0200

    * tp/t/test_utils.pl (%formats, test): add the epub_file format,
    associated to convert_to_html.
    Minor changes in code.
    
    * tp/Makefile.tres, tp/t/epub_tests.t: use epub_file format.
---
 ChangeLog                                          |  8 +++++++
 tp/Makefile.tres                                   |  6 +++---
 tp/t/epub_tests.t                                  |  2 +-
 .../EPUB/chapter_before_top_epub.opf               |  0
 .../EPUB/xhtml/chapter_before_top_epub.xhtml       |  0
 .../EPUB/xhtml/nav_toc.xhtml                       |  0
 .../EPUB/xhtml/top.xhtml                           |  0
 .../META-INF/container.xml                         |  0
 .../chapter_before_top_epub_epub_package/mimetype  |  0
 tp/t/results/epub_tests/section_part_epub.pl       |  2 +-
 .../EPUB/section_part_epub.opf                     |  0
 .../EPUB/xhtml/nav_toc.xhtml                       |  0
 .../EPUB/xhtml/part.xhtml                          |  0
 .../EPUB/xhtml/section_part_epub.xhtml             |  0
 .../META-INF/container.xml                         |  0
 .../section_part_epub_epub_package/mimetype        |  0
 .../EPUB/very-badly-placed-setfilename.opf         |  0
 .../EPUB/xhtml/nav_toc.xhtml                       |  0
 .../EPUB/xhtml/very badly placed setfilename.xhtml |  0
 .../META-INF/container.xml                         |  0
 .../mimetype                                       |  0
 tp/t/test_utils.pl                                 | 25 ++++++++++++++++------
 22 files changed, 32 insertions(+), 11 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index e7914ec67d..3b31291880 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2024-09-09  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/t/test_utils.pl (%formats, test): add the epub_file format,
+       associated to convert_to_html.
+       Minor changes in code.
+
+       * tp/Makefile.tres, tp/t/epub_tests.t: use epub_file format.
+
 2024-09-08  Patrice Dumas  <pertusus@free.fr>
 
        * NEWS, TODO, doc/texinfo.texi (Achieving strict EPUB conformance):
diff --git a/tp/Makefile.tres b/tp/Makefile.tres
index 08f797ea90..6637a9b575 100644
--- a/tp/Makefile.tres
+++ b/tp/Makefile.tres
@@ -490,11 +490,11 @@ test_files_generated_list = 
$(test_tap_files_generated_list) \
   t/results/docbook_tests/multiple_documentlanguage.pl \
   t/results/docbook_tests/special_docbook_unnumbered.pl \
   t/results/epub_tests/chapter_before_top_epub.pl \
-  t/results/epub_tests/chapter_before_top_epub/res_html \
+  t/results/epub_tests/chapter_before_top_epub/res_epub \
   t/results/epub_tests/section_part_epub.pl \
-  t/results/epub_tests/section_part_epub/res_html \
+  t/results/epub_tests/section_part_epub/res_epub \
   t/results/epub_tests/setfilename_on_top_and_after_node_epub.pl \
-  t/results/epub_tests/setfilename_on_top_and_after_node_epub/res_html \
+  t/results/epub_tests/setfilename_on_top_and_after_node_epub/res_epub \
   t/results/float/anchor_in_caption.pl \
   t/results/float/cindex_in_caption.pl \
   t/results/float/comment_space_comand_in_float.pl \
diff --git a/tp/t/epub_tests.t b/tp/t/epub_tests.t
index 0d3b55a29e..c849154bc0 100644
--- a/tp/t/epub_tests.t
+++ b/tp/t/epub_tests.t
@@ -37,7 +37,7 @@ my @file_tests = (
 );
 
 foreach my $test (@file_tests) {
-  push @{$test->[2]->{'test_formats'}}, 'file_html';
+  push @{$test->[2]->{'test_formats'}}, 'file_epub';
   $test->[2]->{'test_input_file_name'} = $test->[0] . '.texi'
     unless (exists($test->[2]->{'test_input_file_name'}));
   $test->[2]->{'full_document'} = 1 unless 
(exists($test->[2]->{'full_document'}));
diff --git 
a/tp/t/results/epub_tests/chapter_before_top_epub/res_html/chapter_before_top_epub_epub_package/EPUB/chapter_before_top_epub.opf
 
b/tp/t/results/epub_tests/chapter_before_top_epub/res_epub/chapter_before_top_epub_epub_package/EPUB/chapter_before_top_epub.opf
similarity index 100%
rename from 
tp/t/results/epub_tests/chapter_before_top_epub/res_html/chapter_before_top_epub_epub_package/EPUB/chapter_before_top_epub.opf
rename to 
tp/t/results/epub_tests/chapter_before_top_epub/res_epub/chapter_before_top_epub_epub_package/EPUB/chapter_before_top_epub.opf
diff --git 
a/tp/t/results/epub_tests/chapter_before_top_epub/res_html/chapter_before_top_epub_epub_package/EPUB/xhtml/chapter_before_top_epub.xhtml
 
b/tp/t/results/epub_tests/chapter_before_top_epub/res_epub/chapter_before_top_epub_epub_package/EPUB/xhtml/chapter_before_top_epub.xhtml
similarity index 100%
rename from 
tp/t/results/epub_tests/chapter_before_top_epub/res_html/chapter_before_top_epub_epub_package/EPUB/xhtml/chapter_before_top_epub.xhtml
rename to 
tp/t/results/epub_tests/chapter_before_top_epub/res_epub/chapter_before_top_epub_epub_package/EPUB/xhtml/chapter_before_top_epub.xhtml
diff --git 
a/tp/t/results/epub_tests/chapter_before_top_epub/res_html/chapter_before_top_epub_epub_package/EPUB/xhtml/nav_toc.xhtml
 
b/tp/t/results/epub_tests/chapter_before_top_epub/res_epub/chapter_before_top_epub_epub_package/EPUB/xhtml/nav_toc.xhtml
similarity index 100%
rename from 
tp/t/results/epub_tests/chapter_before_top_epub/res_html/chapter_before_top_epub_epub_package/EPUB/xhtml/nav_toc.xhtml
rename to 
tp/t/results/epub_tests/chapter_before_top_epub/res_epub/chapter_before_top_epub_epub_package/EPUB/xhtml/nav_toc.xhtml
diff --git 
a/tp/t/results/epub_tests/chapter_before_top_epub/res_html/chapter_before_top_epub_epub_package/EPUB/xhtml/top.xhtml
 
b/tp/t/results/epub_tests/chapter_before_top_epub/res_epub/chapter_before_top_epub_epub_package/EPUB/xhtml/top.xhtml
similarity index 100%
rename from 
tp/t/results/epub_tests/chapter_before_top_epub/res_html/chapter_before_top_epub_epub_package/EPUB/xhtml/top.xhtml
rename to 
tp/t/results/epub_tests/chapter_before_top_epub/res_epub/chapter_before_top_epub_epub_package/EPUB/xhtml/top.xhtml
diff --git 
a/tp/t/results/epub_tests/chapter_before_top_epub/res_html/chapter_before_top_epub_epub_package/META-INF/container.xml
 
b/tp/t/results/epub_tests/chapter_before_top_epub/res_epub/chapter_before_top_epub_epub_package/META-INF/container.xml
similarity index 100%
rename from 
tp/t/results/epub_tests/chapter_before_top_epub/res_html/chapter_before_top_epub_epub_package/META-INF/container.xml
rename to 
tp/t/results/epub_tests/chapter_before_top_epub/res_epub/chapter_before_top_epub_epub_package/META-INF/container.xml
diff --git 
a/tp/t/results/epub_tests/chapter_before_top_epub/res_html/chapter_before_top_epub_epub_package/mimetype
 
b/tp/t/results/epub_tests/chapter_before_top_epub/res_epub/chapter_before_top_epub_epub_package/mimetype
similarity index 100%
rename from 
tp/t/results/epub_tests/chapter_before_top_epub/res_html/chapter_before_top_epub_epub_package/mimetype
rename to 
tp/t/results/epub_tests/chapter_before_top_epub/res_epub/chapter_before_top_epub_epub_package/mimetype
diff --git a/tp/t/results/epub_tests/section_part_epub.pl 
b/tp/t/results/epub_tests/section_part_epub.pl
index b21a40911f..def4ce7f50 100644
--- a/tp/t/results/epub_tests/section_part_epub.pl
+++ b/tp/t/results/epub_tests/section_part_epub.pl
@@ -202,7 +202,7 @@ $result_errors{'section_part_epub'} = [
 $result_floats{'section_part_epub'} = {};
 
 
-$result_converted_errors{'file_html'}->{'section_part_epub'} = [
+$result_converted_errors{'file_epub'}->{'section_part_epub'} = [
   {
     'error_line' => 'warning: must specify a title with a title command or @top
 ',
diff --git 
a/tp/t/results/epub_tests/section_part_epub/res_html/section_part_epub_epub_package/EPUB/section_part_epub.opf
 
b/tp/t/results/epub_tests/section_part_epub/res_epub/section_part_epub_epub_package/EPUB/section_part_epub.opf
similarity index 100%
rename from 
tp/t/results/epub_tests/section_part_epub/res_html/section_part_epub_epub_package/EPUB/section_part_epub.opf
rename to 
tp/t/results/epub_tests/section_part_epub/res_epub/section_part_epub_epub_package/EPUB/section_part_epub.opf
diff --git 
a/tp/t/results/epub_tests/section_part_epub/res_html/section_part_epub_epub_package/EPUB/xhtml/nav_toc.xhtml
 
b/tp/t/results/epub_tests/section_part_epub/res_epub/section_part_epub_epub_package/EPUB/xhtml/nav_toc.xhtml
similarity index 100%
rename from 
tp/t/results/epub_tests/section_part_epub/res_html/section_part_epub_epub_package/EPUB/xhtml/nav_toc.xhtml
rename to 
tp/t/results/epub_tests/section_part_epub/res_epub/section_part_epub_epub_package/EPUB/xhtml/nav_toc.xhtml
diff --git 
a/tp/t/results/epub_tests/section_part_epub/res_html/section_part_epub_epub_package/EPUB/xhtml/part.xhtml
 
b/tp/t/results/epub_tests/section_part_epub/res_epub/section_part_epub_epub_package/EPUB/xhtml/part.xhtml
similarity index 100%
rename from 
tp/t/results/epub_tests/section_part_epub/res_html/section_part_epub_epub_package/EPUB/xhtml/part.xhtml
rename to 
tp/t/results/epub_tests/section_part_epub/res_epub/section_part_epub_epub_package/EPUB/xhtml/part.xhtml
diff --git 
a/tp/t/results/epub_tests/section_part_epub/res_html/section_part_epub_epub_package/EPUB/xhtml/section_part_epub.xhtml
 
b/tp/t/results/epub_tests/section_part_epub/res_epub/section_part_epub_epub_package/EPUB/xhtml/section_part_epub.xhtml
similarity index 100%
rename from 
tp/t/results/epub_tests/section_part_epub/res_html/section_part_epub_epub_package/EPUB/xhtml/section_part_epub.xhtml
rename to 
tp/t/results/epub_tests/section_part_epub/res_epub/section_part_epub_epub_package/EPUB/xhtml/section_part_epub.xhtml
diff --git 
a/tp/t/results/epub_tests/section_part_epub/res_html/section_part_epub_epub_package/META-INF/container.xml
 
b/tp/t/results/epub_tests/section_part_epub/res_epub/section_part_epub_epub_package/META-INF/container.xml
similarity index 100%
rename from 
tp/t/results/epub_tests/section_part_epub/res_html/section_part_epub_epub_package/META-INF/container.xml
rename to 
tp/t/results/epub_tests/section_part_epub/res_epub/section_part_epub_epub_package/META-INF/container.xml
diff --git 
a/tp/t/results/epub_tests/section_part_epub/res_html/section_part_epub_epub_package/mimetype
 
b/tp/t/results/epub_tests/section_part_epub/res_epub/section_part_epub_epub_package/mimetype
similarity index 100%
rename from 
tp/t/results/epub_tests/section_part_epub/res_html/section_part_epub_epub_package/mimetype
rename to 
tp/t/results/epub_tests/section_part_epub/res_epub/section_part_epub_epub_package/mimetype
diff --git 
a/tp/t/results/epub_tests/setfilename_on_top_and_after_node_epub/res_html/very 
badly placed setfilename_epub_package/EPUB/very-badly-placed-setfilename.opf 
b/tp/t/results/epub_tests/setfilename_on_top_and_after_node_epub/res_epub/very 
badly placed setfilename_epub_package/EPUB/very-badly-placed-setfilename.opf
similarity index 100%
rename from 
tp/t/results/epub_tests/setfilename_on_top_and_after_node_epub/res_html/very 
badly placed setfilename_epub_package/EPUB/very-badly-placed-setfilename.opf
rename to 
tp/t/results/epub_tests/setfilename_on_top_and_after_node_epub/res_epub/very 
badly placed setfilename_epub_package/EPUB/very-badly-placed-setfilename.opf
diff --git 
a/tp/t/results/epub_tests/setfilename_on_top_and_after_node_epub/res_html/very 
badly placed setfilename_epub_package/EPUB/xhtml/nav_toc.xhtml 
b/tp/t/results/epub_tests/setfilename_on_top_and_after_node_epub/res_epub/very 
badly placed setfilename_epub_package/EPUB/xhtml/nav_toc.xhtml
similarity index 100%
rename from 
tp/t/results/epub_tests/setfilename_on_top_and_after_node_epub/res_html/very 
badly placed setfilename_epub_package/EPUB/xhtml/nav_toc.xhtml
rename to 
tp/t/results/epub_tests/setfilename_on_top_and_after_node_epub/res_epub/very 
badly placed setfilename_epub_package/EPUB/xhtml/nav_toc.xhtml
diff --git 
a/tp/t/results/epub_tests/setfilename_on_top_and_after_node_epub/res_html/very 
badly placed setfilename_epub_package/EPUB/xhtml/very badly placed 
setfilename.xhtml 
b/tp/t/results/epub_tests/setfilename_on_top_and_after_node_epub/res_epub/very 
badly placed setfilename_epub_package/EPUB/xhtml/very badly placed 
setfilename.xhtml
similarity index 100%
rename from 
tp/t/results/epub_tests/setfilename_on_top_and_after_node_epub/res_html/very 
badly placed setfilename_epub_package/EPUB/xhtml/very badly placed 
setfilename.xhtml
rename to 
tp/t/results/epub_tests/setfilename_on_top_and_after_node_epub/res_epub/very 
badly placed setfilename_epub_package/EPUB/xhtml/very badly placed 
setfilename.xhtml
diff --git 
a/tp/t/results/epub_tests/setfilename_on_top_and_after_node_epub/res_html/very 
badly placed setfilename_epub_package/META-INF/container.xml 
b/tp/t/results/epub_tests/setfilename_on_top_and_after_node_epub/res_epub/very 
badly placed setfilename_epub_package/META-INF/container.xml
similarity index 100%
rename from 
tp/t/results/epub_tests/setfilename_on_top_and_after_node_epub/res_html/very 
badly placed setfilename_epub_package/META-INF/container.xml
rename to 
tp/t/results/epub_tests/setfilename_on_top_and_after_node_epub/res_epub/very 
badly placed setfilename_epub_package/META-INF/container.xml
diff --git 
a/tp/t/results/epub_tests/setfilename_on_top_and_after_node_epub/res_html/very 
badly placed setfilename_epub_package/mimetype 
b/tp/t/results/epub_tests/setfilename_on_top_and_after_node_epub/res_epub/very 
badly placed setfilename_epub_package/mimetype
similarity index 100%
rename from 
tp/t/results/epub_tests/setfilename_on_top_and_after_node_epub/res_html/very 
badly placed setfilename_epub_package/mimetype
rename to 
tp/t/results/epub_tests/setfilename_on_top_and_after_node_epub/res_epub/very 
badly placed setfilename_epub_package/mimetype
diff --git a/tp/t/test_utils.pl b/tp/t/test_utils.pl
index 43e135b328..ee370ae551 100644
--- a/tp/t/test_utils.pl
+++ b/tp/t/test_utils.pl
@@ -162,8 +162,14 @@ my %formats = (
   'info' => \&convert_to_info,
   'file_info' => \&convert_to_info,
   'html' => \&convert_to_html,
+  # Can also be used for epub, the only difference is the name of the
+  # output directory.
   'file_html' => \&convert_to_html,
   'html_text' => \&convert_to_html,
+  # NOTE setting file_epub format does not automatically loads epub3.pm,
+  # since init files are handled before parsing.  The init file should
+  # also be added to init_files.
+  'file_epub' => \&convert_to_html,
   'xml' => \&convert_to_xml,
   'file_xml' => \&convert_to_xml,
   'docbook' => \&convert_to_docbook,
@@ -1015,7 +1021,7 @@ sub test($$)
   }
 
   if (not defined($document)) {
-    print STDERR "ERROR: parsing result undef\n";
+    warn "ERROR: parsing result undef\n";
     my ($parser_errors, $parser_error_count) = $parser->errors();
     foreach my $error_message (@$parser_errors) {
       warn $error_message->{'error_line'}
@@ -1215,17 +1221,23 @@ sub test($$)
                                       %$init_files_options};
       my $format_type = $format;
       if ($format_type =~ s/^file_//) {
+        if ($format_type eq 'epub' and !$doing_epub) {
+          warn "ERROR: $self->{'name'}: $test_name: $format: init file not 
loaded\n";
+        }
         # the information that the results is a file is passed
-        # through $format_converter_options->{'SUBDIR'} being defined
-        my $base = "t/results/$self->{'name'}/$test_name/";
+        # through $format_converter_options->{'SUBDIR'} being defined,
+        # except for EPUB, which set (and reuse) SUBDIR internally.
+        my $test_base_dir = "t/results/$self->{'name'}/$test_name/";
+        my $base;
         my $test_out_dir;
         if ($self->{'generate'}) {
-          $base = $srcdir.$base;
+          $base = $srcdir.$test_base_dir;
           $test_out_dir = $base.'res_'.$format_type;
           if (-d $test_out_dir) {
             unlink_dir_files($test_out_dir);
           }
         } else {
+          $base = $test_base_dir;
           $test_out_dir = $base.'out_'.$format_type;
         }
         if (!defined($format_converter_options->{'SUBDIR'})) {
@@ -1605,7 +1617,8 @@ sub test($$)
 
             # compare *_epub_package/EPUB and *_epub_package/EPUB/xhtml
             # contents too for epub
-            if ($format_type eq 'html' and $doing_epub) {
+            if (($format_type eq 'html' or $format_type eq 'epub')
+                and $doing_epub) {
               my @epub_package_dirs;
               if (opendir(RDIR, $reference_dir)) {
                 my @files = readdir (RDIR);
@@ -1658,7 +1671,7 @@ sub test($$)
                 }
               }
               if (!$used_dir) {
-                print STDERR "WARNING: $format $test_name: ".
+                warn "WARNING: $format $test_name: ".
                                 "no suitable epub_package dir\n";
               }
             }



reply via email to

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