[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
From: |
Patrice Dumas |
Date: |
Mon, 28 Nov 2022 11:55:59 -0500 (EST) |
branch: master
commit ee25a6ccf0a6e143b6a4421f947c9d8b7666475d
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Mon Nov 28 17:54:51 2022 +0100
tp/maintain/check_back_xml_forth_texi_t.sh: add notice, comments, minor
fixes
---
tp/maintain/check_back_xml_forth_texi_t.sh | 34 +++++++++++++++++++++++++++++-
1 file changed, 33 insertions(+), 1 deletion(-)
diff --git a/tp/maintain/check_back_xml_forth_texi_t.sh
b/tp/maintain/check_back_xml_forth_texi_t.sh
index a7ded4d057..0e8390140a 100755
--- a/tp/maintain/check_back_xml_forth_texi_t.sh
+++ b/tp/maintain/check_back_xml_forth_texi_t.sh
@@ -1,8 +1,30 @@
#! /bin/sh
+#
+# check_back_xml_forth_texi_t.sh: convert all the Texinfo code contained in
+# the tp/t/*.t tests to Texinfo XML and convert back the XML to Texinfo using
+# util/txixml2texi. Compare with the Texinfo code generated with expansion
+# of macros and @value. The objective here is not to test the conversion to
XML,
+# which is better tested directly in the tp/t/*.t tests, but to check that
+# the resulting XML can be parsed and contain the same information as in the
+# corresponding Texinfo code.
+#
+# Copyright 2022 Free Software Foundation, Inc.
+#
+# This file is free software; as a special exception the author gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+#
+# Originally written by Patrice Dumas.
+
#set -e
mdir=check_back_xml_forth_texi
+mkdir -p $mdir
echo "generate t directory Texinfo files"
./maintain/all_tests.sh texis > $mdir/all_tests_texis.log
@@ -21,7 +43,16 @@ for dir in `find t_texis/ -type d` ; do
for file in $dir/*.texi; do
echo " -> $file: plaintexinfo"
bfile=`basename $file .texi`
- ./texi2any.pl -c TEXINFO_OUTPUT_FORMAT=plaintexinfo --ifxml --no-ifinfo
--force --error=100000 -o $mdir/backforth_plaintexi/$bdir/$bfile.texi $file
+ # Either the output file or the output directory can be specified.
+ # The conversion to Texinfo XML below uses the directory.
+ # Specifying the file allows, as a side effect, to check the consistency
+ # of test name and output file name.
+ # Even with specifying the directory in both cases, the file names may
+ # not be exactly the same when there are specific values for @setfilename.
+ # This concerns a few files only, and the files concered are more or less
+ # the same when the file or the directory is specified.
+ #./texi2any.pl -c TEXINFO_OUTPUT_FORMAT=plaintexinfo --ifxml --no-ifinfo
--force --error=100000 -o $mdir/backforth_plaintexi/$bdir/$bfile.texi $file
+ ./texi2any.pl -c TEXINFO_OUTPUT_FORMAT=plaintexinfo --ifxml --no-ifinfo
--force --error=100000 -o $mdir/backforth_plaintexi/$bdir/ $file
echo " Texinfo XML"
./texi2any.pl --xml --force --error=100000 -o
$mdir/backforth_xmltexi/$bdir/ $file
echo " Back"
@@ -33,5 +64,6 @@ done
diff -u -r t_texis/ $mdir/backforth_checktexi/ > $mdir/orig_texi.diff
diff -u -r $mdir/backforth_plaintexi/ $mdir/backforth_checktexi/ >
$mdir/plain_texi.diff
+# To find XML parsing errors
# grep --color 'parser error' check_back_xml_forth_texi/backforth_logs/*