[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[8216] unknown_nodes_renamed test
From: |
gavinsmith0123 |
Subject: |
[8216] unknown_nodes_renamed test |
Date: |
Sun, 23 Sep 2018 12:24:44 -0400 (EDT) |
Revision: 8216
http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=8216
Author: gavin
Date: 2018-09-23 12:24:44 -0400 (Sun, 23 Sep 2018)
Log Message:
-----------
unknown_nodes_renamed test
Modified Paths:
--------------
trunk/ChangeLog
trunk/tp/Makefile.am
trunk/tp/Texinfo/Common.pm
trunk/tp/Texinfo/Parser.pm
trunk/tp/t/92formatting.t
trunk/tp/t/results/formatting/unknown_nodes_renamed.pl
trunk/tp/tests/Makefile.am
Added Paths:
-----------
trunk/tp/t/input_files/unknown_nodes_renamed-noderename.cnf
trunk/tp/t/results/formatting/unknown_nodes_renamed/
trunk/tp/t/results/formatting/unknown_nodes_renamed/res_html/
trunk/tp/t/results/formatting/unknown_nodes_renamed/res_html/unknown_nodes_renamed.html
Removed Paths:
-------------
trunk/tp/tests/formatting/unknown_nodes_renamed-noderename.cnf-ref
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2018-09-23 13:49:00 UTC (rev 8215)
+++ trunk/ChangeLog 2018-09-23 16:24:44 UTC (rev 8216)
@@ -1,5 +1,15 @@
2018-09-23 Gavin Smith <address@hidden>
+ * tp/Texinfo/Parser.pm (parse_texi_file): Save name subdirectory
+ containing input file.
+ * tp/Texinfo/Common.pm (parse_renamed_nodes_file): Check for
+ noderename.cnf in subdirectory containing input file first.
+ * t/92formatting.t (unknown_nodes_renamed): Output a file for
+ the test and use a renamed nodes file. This restores an error
+ message that was present in the test this one replaced.
+
+2018-09-23 Gavin Smith <address@hidden>
+
* tp/tests/formatting/list-of-tests
(unknown_nodes_renamed, one_line, empty): Remove.
* tp/t/92formatting.t
Modified: trunk/tp/Makefile.am
===================================================================
--- trunk/tp/Makefile.am 2018-09-23 13:49:00 UTC (rev 8215)
+++ trunk/tp/Makefile.am 2018-09-23 16:24:44 UTC (rev 8216)
@@ -167,6 +167,7 @@
t/input_files/cpp_lines.texi \
t/input_files/delcomment.texi \
t/input_files/east_asian_in_w.texi \
+ t/input_files/empty.texi \
t/input_files/empty_lines_at_beginning_no_setfilename.texi \
t/input_files/empty_lines_at_beginning_no_setfilename_no_element.texi \
t/input_files/japanese_utf8.texi \
@@ -173,10 +174,12 @@
t/input_files/japanese_shift_jis.texi \
t/input_files/nodequote.texi \
t/input_files/non_break_spaces.texi \
+ t/input_files/one_line.texi \
t/input_files/one_line_no_content.texi \
t/input_files/sample_utf8.texi \
t/input_files/things_before_setfilename_no_element.texi \
t/input_files/things_before_setfilename.texi \
+ t/input_files/unknown_nodes_renamed.texi \
#
document_domain = $(PACKAGE)_document
Modified: trunk/tp/Texinfo/Common.pm
===================================================================
--- trunk/tp/Texinfo/Common.pm 2018-09-23 13:49:00 UTC (rev 8215)
+++ trunk/tp/Texinfo/Common.pm 2018-09-23 16:24:44 UTC (rev 8216)
@@ -1623,7 +1623,13 @@
my $renamed_nodes = shift;
my $renamed_nodes_lines = shift;
- if (open(RENAMEDFILE, "<$renamed_nodes_file")) {
+ my $input_directory = $self->{'info'}->{'input_directory'};
+
+ # check for noderename.cnf in directory of source, and in current
+ # directory.
+ if ($input_directory
+ and open(RENAMEDFILE, "<$input_directory$renamed_nodes_file")
+ or open(RENAMEDFILE, "<$renamed_nodes_file")) {
if ($self->get_conf('INPUT_PERL_ENCODING')) {
binmode(RENAMEDFILE, ":encoding(".
$self->get_conf('INPUT_PERL_ENCODING').")");
Modified: trunk/tp/Texinfo/Parser.pm
===================================================================
--- trunk/tp/Texinfo/Parser.pm 2018-09-23 13:49:00 UTC (rev 8215)
+++ trunk/tp/Texinfo/Parser.pm 2018-09-23 16:24:44 UTC (rev 8216)
@@ -875,6 +875,7 @@
'fh' => $filehandle
}];
$self->{'info'}->{'input_file_name'} = $file_name;
+ $self->{'info'}->{'input_directory'} = $directories;
my $tree = $self->_parse_texi($root);
# Find 'text_root', which contains everything before first node/section.
Modified: trunk/tp/t/92formatting.t
===================================================================
--- trunk/tp/t/92formatting.t 2018-09-23 13:49:00 UTC (rev 8215)
+++ trunk/tp/t/92formatting.t 2018-09-23 16:24:44 UTC (rev 8216)
@@ -10,8 +10,11 @@
# under tp/tests did, but to be faster.
my @test_cases = (
['unknown_nodes_renamed',
- undef, {'test_file' => 'unknown_nodes_renamed.texi',
+ undef, {'test_file' => 'unknown_nodes_renamed.texi',
+ 'test_formats' => ['file_html']
},
+ {'RENAMED_NODES_FILE' => 'unknown_nodes_renamed-noderename.cnf',
+ }
],
['one_line_no_content',
undef, {'test_file' => 'one_line_no_content.texi',
@@ -29,7 +32,9 @@
);
foreach my $test (@test_cases) {
- push @{$test->[2]->{'test_formats'}}, 'html';
+ if (!$test->[2]->{'test_formats'}) {
+ push @{$test->[2]->{'test_formats'}}, 'html';
+ }
$test->[3]->{'TEXI2HTML'} = 1;
$test->[3]->{'TEST'} = 1;
}
Copied: trunk/tp/t/input_files/unknown_nodes_renamed-noderename.cnf (from rev
8074, trunk/tp/tests/formatting/unknown_nodes_renamed-noderename.cnf-ref)
===================================================================
--- trunk/tp/t/input_files/unknown_nodes_renamed-noderename.cnf
(rev 0)
+++ trunk/tp/t/input_files/unknown_nodes_renamed-noderename.cnf 2018-09-23
16:24:44 UTC (rev 8216)
@@ -0,0 +1,4 @@
+Unknown node 1
+unknown node 2
+@@{} renamed as unknow too
+
Added:
trunk/tp/t/results/formatting/unknown_nodes_renamed/res_html/unknown_nodes_renamed.html
===================================================================
---
trunk/tp/t/results/formatting/unknown_nodes_renamed/res_html/unknown_nodes_renamed.html
(rev 0)
+++
trunk/tp/t/results/formatting/unknown_nodes_renamed/res_html/unknown_nodes_renamed.html
2018-09-23 16:24:44 UTC (rev 8216)
@@ -0,0 +1,52 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<!-- Created by texinfo, http://www.gnu.org/software/texinfo/ -->
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>Untitled Document</title>
+
+<meta name="description" content="Untitled Document">
+<meta name="keywords" content="Untitled Document">
+<meta name="resource-type" content="document">
+<meta name="distribution" content="global">
+<style type="text/css">
+<!--
+a.summary-letter {text-decoration: none}
+blockquote.indentedblock {margin-right: 0em}
+blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
+blockquote.smallquotation {font-size: smaller}
+div.display {margin-left: 3.2em}
+div.example {margin-left: 3.2em}
+div.lisp {margin-left: 3.2em}
+div.smalldisplay {margin-left: 3.2em}
+div.smallexample {margin-left: 3.2em}
+div.smalllisp {margin-left: 3.2em}
+kbd {font-style: oblique}
+pre.display {font-family: inherit}
+pre.format {font-family: inherit}
+pre.menu-comment {font-family: serif}
+pre.menu-preformatted {font-family: serif}
+pre.smalldisplay {font-family: inherit; font-size: smaller}
+pre.smallexample {font-size: smaller}
+pre.smallformat {font-family: inherit; font-size: smaller}
+pre.smalllisp {font-size: smaller}
+span.nolinebreak {white-space: nowrap}
+span.roman {font-family: initial; font-weight: normal}
+span.sansserif {font-family: sans-serif; font-weight: normal}
+ul.no-bullet {list-style: none}
+-->
+</style>
+
+
+</head>
+
+<body lang="en">
+<a name="Top"></a>
+<hr>
+<p><font size="-1">
+ This document was generated on <em>a sunny day</em>.
+</font></p>
+
+
+</body>
+</html>
Modified: trunk/tp/t/results/formatting/unknown_nodes_renamed.pl
===================================================================
--- trunk/tp/t/results/formatting/unknown_nodes_renamed.pl 2018-09-23
13:49:00 UTC (rev 8215)
+++ trunk/tp/t/results/formatting/unknown_nodes_renamed.pl 2018-09-23
16:24:44 UTC (rev 8216)
@@ -101,66 +101,20 @@
-$result_converted{'html'}->{'unknown_nodes_renamed'} = '<!DOCTYPE html PUBLIC
"-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<!-- Created by texinfo, http://www.gnu.org/software/texinfo/ -->
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<title>Untitled Document</title>
+$result_converted{'file_html'}->{'unknown_nodes_renamed'} = '';
-<meta name="description" content="Untitled Document">
-<meta name="keywords" content="Untitled Document">
-<meta name="resource-type" content="document">
-<meta name="distribution" content="global">
-<style type="text/css">
-<!--
-a.summary-letter {text-decoration: none}
-blockquote.indentedblock {margin-right: 0em}
-blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
-blockquote.smallquotation {font-size: smaller}
-div.display {margin-left: 3.2em}
-div.example {margin-left: 3.2em}
-div.lisp {margin-left: 3.2em}
-div.smalldisplay {margin-left: 3.2em}
-div.smallexample {margin-left: 3.2em}
-div.smalllisp {margin-left: 3.2em}
-kbd {font-style: oblique}
-pre.display {font-family: inherit}
-pre.format {font-family: inherit}
-pre.menu-comment {font-family: serif}
-pre.menu-preformatted {font-family: serif}
-pre.smalldisplay {font-family: inherit; font-size: smaller}
-pre.smallexample {font-size: smaller}
-pre.smallformat {font-family: inherit; font-size: smaller}
-pre.smalllisp {font-size: smaller}
-span.nolinebreak {white-space: nowrap}
-span.roman {font-family: initial; font-weight: normal}
-span.sansserif {font-family: sans-serif; font-weight: normal}
-ul.no-bullet {list-style: none}
--->
-</style>
-
-
-</head>
-
-<body lang="en">
-<a name="Top"></a>
-<hr>
-<p><font size="-1">
- This document was generated on <em>a sunny day</em>.
-</font></p>
-
-
-</body>
-</html>
-';
-
-$result_converted_errors{'html'}->{'unknown_nodes_renamed'} = [
+$result_converted_errors{'file_html'}->{'unknown_nodes_renamed'} = [
{
'error_line' => 'unknown_nodes_renamed.texi: warning: must specify a title
with a title command or @top
',
'text' => 'must specify a title with a title command or @top',
'type' => 'warning'
+ },
+ {
+ 'error_line' => 'unknown_nodes_renamed-noderename.cnf:3: warning: target
node (new name for `Unknown node 1\') not in document: renamed as unknow too
+',
+ 'text' => 'target node (new name for `Unknown node 1\') not in document:
renamed as unknow too',
+ 'type' => 'warning'
}
];
Modified: trunk/tp/tests/Makefile.am
===================================================================
--- trunk/tp/tests/Makefile.am 2018-09-23 13:49:00 UTC (rev 8215)
+++ trunk/tp/tests/Makefile.am 2018-09-23 16:24:44 UTC (rev 8216)
@@ -63,8 +63,7 @@
all-local: htmlxref/htmlxref.cnf htmlxref-only_mono/htmlxref.cnf \
htmlxref-only_split/htmlxref.cnf \
equivalent_nodes-noderename.cnf sectioning/equivalent_nodes-noderename.cnf \
- unknown_nodes_renamed-noderename.cnf \
- formatting/unknown_nodes_renamed-noderename.cnf coverage_macro-cr.texi
+ coverage_macro-cr.texi
htmlxref/htmlxref.cnf: htmlxref/htmlxref.cnf-ref
${INSTALL_DATA} $(srcdir)/htmlxref/htmlxref.cnf-ref $@
@@ -81,12 +80,6 @@
equivalent_nodes-noderename.cnf: sectioning/renamednodes.cnf-ref
${INSTALL_DATA} $(srcdir)/sectioning/renamednodes.cnf-ref $@
-formatting/unknown_nodes_renamed-noderename.cnf:
formatting/unknown_nodes_renamed-noderename.cnf-ref
- ${INSTALL_DATA}
$(srcdir)/formatting/unknown_nodes_renamed-noderename.cnf-ref $@
-
-unknown_nodes_renamed-noderename.cnf:
formatting/unknown_nodes_renamed-noderename.cnf-ref
- ${INSTALL_DATA}
$(srcdir)/formatting/unknown_nodes_renamed-noderename.cnf-ref $@
-
coverage_macro-cr.texi: coverage_macro.texi
sed 's/$$/\r/' $(srcdir)/coverage_macro.texi > $@
Deleted: trunk/tp/tests/formatting/unknown_nodes_renamed-noderename.cnf-ref
===================================================================
--- trunk/tp/tests/formatting/unknown_nodes_renamed-noderename.cnf-ref
2018-09-23 13:49:00 UTC (rev 8215)
+++ trunk/tp/tests/formatting/unknown_nodes_renamed-noderename.cnf-ref
2018-09-23 16:24:44 UTC (rev 8216)
@@ -1,4 +0,0 @@
-Unknown node 1
-unknown node 2
-@@{} renamed as unknow too
-
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [8216] unknown_nodes_renamed test,
gavinsmith0123 <=