texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: * tp/tests/Makefile.am (input_file_names_recoded_


From: Patrice Dumas
Subject: branch master updated: * tp/tests/Makefile.am (input_file_names_recoded_stamp.txt): record in the file if the recoding succeeded or failed.
Date: Thu, 10 Mar 2022 16:38:49 -0500

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 0e8edd7016 * tp/tests/Makefile.am 
(input_file_names_recoded_stamp.txt): record in the file if the recoding 
succeeded or failed.
0e8edd7016 is described below

commit 0e8edd701650643a0da01f0acfd8b28f8703183d
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Thu Mar 10 22:38:36 2022 +0100

    * tp/tests/Makefile.am (input_file_names_recoded_stamp.txt):
    record in the file if the recoding succeeded or failed.
    
    * tp/tests/run_parser_all.sh: if 'Need recoded file names'
    appears on a test line, skip the test if the recoding of
    file names failed.
    
    * tp/tests/run_parser_all.sh: if a prerequisite for a test is
    missing, such as not recoded file names needed, or latex2html
    or tex4ht not present, and only one test is run, return 77 to
    have the test marked as skipped instead of succeeding.
---
 ChangeLog                         | 14 ++++++++++++++
 tp/tests/Makefile.am              |  3 +--
 tp/tests/README                   | 19 +++++++++++++++++++
 tp/tests/formatting/list-of-tests |  9 ++++++---
 tp/tests/run_parser_all.sh        | 25 ++++++++++++++++++++++++-
 5 files changed, 64 insertions(+), 6 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index cebf9f0454..af83a4cc99 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2022-03-10  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/tests/Makefile.am (input_file_names_recoded_stamp.txt):
+       record in the file if the recoding succeeded or failed.
+
+       * tp/tests/run_parser_all.sh: if 'Need recoded file names'
+       appears on a test line, skip the test if the recoding of
+       file names failed.
+
+       * tp/tests/run_parser_all.sh: if a prerequisite for a test is
+       missing, such as not recoded file names needed, or latex2html
+       or tex4ht not present, and only one test is run, return 77 to
+       have the test marked as skipped instead of succeeding.
+
 2022-03-10  Patrice Dumas  <pertusus@free.fr>
 
        * tp/tests/Makefile.am (check_DATA): copy and change file name
diff --git a/tp/tests/Makefile.am b/tp/tests/Makefile.am
index 872e910a67..63113ba566 100644
--- a/tp/tests/Makefile.am
+++ b/tp/tests/Makefile.am
@@ -64,8 +64,7 @@ other-checks: all
 check_DATA = input_file_names_recoded_stamp.txt
 
 input_file_names_recoded_stamp.txt: $(srcdir)/input/included_latîn1.texi
-       $(PERL) $(srcdir)/../maintain/copy_change_file_name_encoding.pl 
$(srcdir)/input/included_latîn1.texi .
-       : > $@
+       if $(PERL) $(srcdir)/../maintain/copy_change_file_name_encoding.pl 
$(srcdir)/input/included_latîn1.texi . ; then echo 'OK' > $@ ; else echo 
'FAILED' > $@ ; fi
 
 distclean-local:
        rm -f input_file_names_recoded_stamp.txt included_lat*n1.texi
diff --git a/tp/tests/README b/tp/tests/README
index 6b4cf56f7f..ecede54121 100644
--- a/tp/tests/README
+++ b/tp/tests/README
@@ -115,6 +115,20 @@ for the test results, a filter script should be used 
instead.  An
 example of such a script can be seen in po_document/fix-translations.sh.
 
 
+Test requiring recoded file names
+=================================
+
+Some test require the possibility to recode file names, in general from
+UTF-8 to a non UTF-8 encoding whan the test require a file name in a
+non UTF-8 encoding.  The recoding of file names required by these
+tests are done by make check, and it is possible to do it manually
+with make input_file_names_recoded_stamp.txt.  If the recoding fails,
+for instance if the recoding leads to invalid UTF-8 and the file system does
+not accept invalid UTF-8, input_file_names_recoded_stamp.txt will contain
+FAILED, and the test requiring the files with recoded file names will
+be skipped.
+
+
 TeX4ht and LaTeX2HTML tests
 ===========================
 The tex4ht and latex2HTML related tests are not run automatically, as
@@ -181,6 +195,11 @@ specifies that the results of the processing of 
manual.texi with additional
 command line arguments --split chapter will be in the a_test_split_chapter
 directory.
 
+"Need recoded file names" should appear on a line for a test requiring
+recoded file names. for example
+
+manual_include_accented_file_name_latin1 
manual_include_accented_file_name_latin1.texi -D 'needrecodedfilenames Need 
recoded file names'
+
 Common .texi
 ------------
 A common .texi file should be in the top-level directory (there is such an
diff --git a/tp/tests/formatting/list-of-tests 
b/tp/tests/formatting/list-of-tests
index 675768a0cc..8965ca597c 100644
--- a/tp/tests/formatting/list-of-tests
+++ b/tp/tests/formatting/list-of-tests
@@ -31,11 +31,14 @@ non_ascii_test_rawtext osé_utf8.texi -c 
TEXINFO_OUTPUT_FORMAT=rawtext
 non_ascii_no_setfilename_test_rawtext osé_utf8_no_setfilename.texi -c 
TEXINFO_OUTPUT_FORMAT=rawtext
 
 # test of non utf8 encoded file name in non utf8 document
-manual_include_accented_file_name_latin1 
manual_include_accented_file_name_latin1.texi --info
+# "Need recoded file names" string is used in test driving script
+# to determine that the recoding of file names need to have
+# succeeded for this test not to be skipped
+manual_include_accented_file_name_latin1 
manual_include_accented_file_name_latin1.texi --info -D 'needrecodedfilenames 
Need recoded file names'
 
-manual_include_accented_file_name_latin1_explicit_encoding 
manual_include_accented_file_name_latin1.texi --info -c 
DOC_ENCODING_FOR_INPUT_FILE_NAME=0 -c LOCALE_INPUT_FILE_NAME_ENCODING=ISO-8859-1
+manual_include_accented_file_name_latin1_explicit_encoding 
manual_include_accented_file_name_latin1.texi --info -c 
DOC_ENCODING_FOR_INPUT_FILE_NAME=0 -c 
LOCALE_INPUT_FILE_NAME_ENCODING=ISO-8859-1 -D 'needrecodedfilenames Need 
recoded file names'
 
 # fails to find the latin1 encoded include file as the locale encoding
 # of the test suite is utf8
-manual_include_accented_file_name_latin1_use_locale_encoding 
manual_include_accented_file_name_latin1.texi --info -c 
DOC_ENCODING_FOR_INPUT_FILE_NAME=0
+manual_include_accented_file_name_latin1_use_locale_encoding 
manual_include_accented_file_name_latin1.texi --info -c 
DOC_ENCODING_FOR_INPUT_FILE_NAME=0 -D 'needrecodedfilenames Need recoded file 
names'
 
diff --git a/tp/tests/run_parser_all.sh b/tp/tests/run_parser_all.sh
index 289ccf7c64..492fdbbaba 100755
--- a/tp/tests/run_parser_all.sh
+++ b/tp/tests/run_parser_all.sh
@@ -7,6 +7,16 @@
 # are permitted in any medium without royalty provided the copyright
 # notice and this notice are preserved.
 
+check_need_recoded_file_names ()
+{
+   if echo "$remaining" | grep 'Need recoded file names' >/dev/null; then
+     if [ "$no_recoded_file_names" = 'yes' ]; then
+       echo "S: (no recoded file names) $current"
+       return 1
+     fi
+   fi
+   return 0
+}
 
 check_latex2html_and_tex4ht ()
 {
@@ -185,6 +195,11 @@ if which html2wiki > /dev/null 2>&1; then
   no_html2wiki=no
 fi
 
+no_recoded_file_names=yes
+if sed 1q input_file_names_recoded_stamp.txt | grep 'OK' >/dev/null; then
+  no_recoded_file_names=no
+fi
+
 one_test=no
 if test -n "$1"; then
   one_test=yes
@@ -325,7 +340,15 @@ while read line; do
     results_dir="$srcdir/$testdir/${res_dir}${dir_suffix}"
     one_test_done=yes
 
-    check_latex2html_and_tex4ht || continue 2
+    skipped_test=no
+    check_need_recoded_file_names || skipped_test=yes
+    check_latex2html_and_tex4ht || skipped_test=yes
+    if [ "$skipped_test" = 'yes' ] ; then
+      if test $one_test = 'yes' ; then
+        return_code=77
+      fi
+      continue 2
+    fi
 
     dir=$current
     test -d "${outdir}$dir" && rm -rf "${outdir}$dir"



reply via email to

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