[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: t/test_utils.pl: do not pass SIMPLE_MENU to parse
From: |
Patrice Dumas |
Subject: |
branch master updated: t/test_utils.pl: do not pass SIMPLE_MENU to parser, as it is not a parser option, instead set a variable to do the tree transformation and pass to converter. |
Date: |
Fri, 27 Aug 2021 16:51:25 -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 781633c t/test_utils.pl: do not pass SIMPLE_MENU to parser, as it is
not a parser option, instead set a variable to do the tree transformation and
pass to converter.
781633c is described below
commit 781633c4cce20d7609989f5d78bfef4df54da7aa
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Fri Aug 27 22:50:17 2021 +0200
t/test_utils.pl: do not pass SIMPLE_MENU to parser, as it is
not a parser option, instead set a variable to do the tree
transformation and pass to converter.
---
tp/t/nodenormalization.t | 3 +--
tp/t/test_utils.pl | 30 +++++++++++++++++++-----------
2 files changed, 20 insertions(+), 13 deletions(-)
diff --git a/tp/t/nodenormalization.t b/tp/t/nodenormalization.t
index 4de4496..4169602 100644
--- a/tp/t/nodenormalization.t
+++ b/tp/t/nodenormalization.t
@@ -25,8 +25,7 @@ my $strings_textdomain = 'texinfo_document';
Locale::Messages->select_package ('gettext_pp');
Locale::Messages::bindtextdomain ('texinfo_document', 't/locales');
-my $parser = Texinfo::Parser::parser({'TEST' => 1,
- 'include_directories' => [
+my $parser = Texinfo::Parser::parser({'include_directories' => [
$srcdir.'t/include/'],
'EXPANDED_FORMATS' => ['html', 'tex']});
diff --git a/tp/t/test_utils.pl b/tp/t/test_utils.pl
index a79d013..41983d3 100644
--- a/tp/t/test_utils.pl
+++ b/tp/t/test_utils.pl
@@ -615,12 +615,7 @@ sub convert_to_html($$$$$$;$)
$converter_options->{'SPLIT'} = 0
if ($format eq 'html_text'
- and !defined($parser_options->{'SPLIT'})
and !defined($converter_options->{'SPLIT'}));
- if (!defined($converter_options->{'SIMPLE_MENU'})
- and $parser_options->{'SIMPLE_MENU'}) {
- $converter_options->{'SIMPLE_MENU'} = 1;
- }
my $converter =
Texinfo::Convert::HTML->converter ({'DEBUG' => $self->{'DEBUG'},
'parser' => $parser,
@@ -766,6 +761,13 @@ sub test($$)
$parser_options = shift @$test_case if (@$test_case);
$converter_options = shift @$test_case if (@$test_case);
+ 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'}");
+ }
+
if (!defined $parser_options->{'EXPANDED_FORMATS'}) {
$parser_options->{'EXPANDED_FORMATS'} = [
'docbook', 'html', 'xml', 'info', 'plaintext', 'latex'];
@@ -775,6 +777,8 @@ sub test($$)
# where you need @tex expanded in the t/*.t files.
}
+ # get all the infos put in parser_options that are not actual
+ # parser options but specifications for the test.
my $test_file;
if ($parser_options->{'test_file'}) {
$test_file = $input_files_dir . $parser_options->{'test_file'};
@@ -794,11 +798,15 @@ sub test($$)
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'}");
+ # register that there is a tree transformation to do
+ # in addition to passing to converter.
+ my $simple_menus;
+ if ($parser_options->{'SIMPLE_MENU'}) {
+ $simple_menus = 1;
+ if (!defined($converter_options->{'SIMPLE_MENU'})) {
+ $converter_options->{'SIMPLE_MENU'} = 1;
+ }
+ delete $parser_options->{'SIMPLE_MENU'};
}
my %todos;
@@ -885,7 +893,7 @@ sub test($$)
$merged_index_entries,
$index_names);
}
- if ($parser_options->{'SIMPLE_MENU'}) {
+ if ($simple_menus) {
# require instead of use for speed when this module is not needed
require Texinfo::Transformations;
$parser->Texinfo::Transformations::set_menus_to_simple_menu();
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: t/test_utils.pl: do not pass SIMPLE_MENU to parser, as it is not a parser option, instead set a variable to do the tree transformation and pass to converter.,
Patrice Dumas <=