texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: test_utils.pl: pass test options to preamble form


From: Patrice Dumas
Subject: branch master updated: test_utils.pl: pass test options to preamble formatting for latex
Date: Sun, 31 Jul 2022 10:16:04 -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 78e89a4f0f test_utils.pl: pass test options to preamble formatting for 
latex
78e89a4f0f is described below

commit 78e89a4f0f3dd9320a9fdefd56061bfe82615639
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sun Jul 31 16:15:08 2022 +0200

    test_utils.pl: pass test options to preamble formatting for latex
---
 tp/t/test_utils.pl | 21 ++++++++++++++++-----
 1 file changed, 16 insertions(+), 5 deletions(-)

diff --git a/tp/t/test_utils.pl b/tp/t/test_utils.pl
index c1ce17ffa5..b81bd1a9ae 100644
--- a/tp/t/test_utils.pl
+++ b/tp/t/test_utils.pl
@@ -311,7 +311,7 @@ sub remove_keys($$;$)
   return undef if (!defined($root));
   if (!defined($been_there)) {
     #print STDERR "First call: $root\n";
-    $root = dclone ($root);
+    $root = dclone($root);
     #print STDERR Data::Dumper->Dump([$root]);
     $been_there = {};
   }
@@ -781,14 +781,18 @@ sub output_preamble_postamble_latex($$)
 {
   my $converter = shift;
   my $postamble = shift;
+  my $parser_options = shift;
 
   if ($postamble) {
     return '\end{document}
 ';
   } else {
-    return $converter->_latex_header()
-       .'\begin{document}
+    my $begin_document = '\begin{document}
 ';
+    if ($parser_options and $parser_options->{'full_document'}) {
+      $begin_document = '';
+    }
+    return $converter->_latex_header() . $begin_document;
   }
 }
 
@@ -826,6 +830,11 @@ sub test($$)
     #   {'EXPANDED_FORMATS' => ['tex']}
     # where you need @tex expanded in the t/*.t files.
   }
+  my $initial_parser_options;
+  # keep parser options to be able to pass to preamble formatting
+  if ($arg_output) {
+    $initial_parser_options = dclone($parser_options);
+  }
 
   # get all the infos put in parser_options that are not actual
   # parser options but specifications for the test.
@@ -1140,7 +1149,8 @@ sub test($$)
             }
             if ($outfile_preamble{$format}) {
               if (ref($outfile_preamble{$format}) eq 'CODE') {
-                print OUTFILE &{$outfile_preamble{$format}}($converter, 0);
+                print OUTFILE &{$outfile_preamble{$format}}($converter, 0,
+                                                     $initial_parser_options);
               } else {
                 print OUTFILE $outfile_preamble{$format}->[0];
               }
@@ -1148,7 +1158,8 @@ sub test($$)
             print OUTFILE $converted{$format};
             if ($outfile_preamble{$format}) {
               if (ref($outfile_preamble{$format}) eq 'CODE') {
-                print OUTFILE &{$outfile_preamble{$format}}($converter, 1);
+                print OUTFILE &{$outfile_preamble{$format}}($converter, 1,
+                                                     $initial_parser_options);
               } else {
                 print OUTFILE $outfile_preamble{$format}->[1];
               }



reply via email to

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