texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: contrib/mass_test for tests on manuals found on G


From: Patrice Dumas
Subject: branch master updated: contrib/mass_test for tests on manuals found on GNU website
Date: Sun, 14 Jan 2024 15:28:18 -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 f24615e248 contrib/mass_test for tests on manuals found on GNU website
f24615e248 is described below

commit f24615e248d5b63d2fff5c696035055b32f96350
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sun Jan 14 21:27:23 2024 +0100

    contrib/mass_test for tests on manuals found on GNU website
    
    * contrib/mass_test/get_manuals.sh,
    contrib/mass_test/extract_manuals.sh: scripts to download and
    extract manuals found on the GNU website in software/*/manual/*.texi*.
    
    * contrib/mass_test/setup_reference_perlVSC.sh,
    contrib/mass_test/check_perlVSC.sh: check C against perl HTML output.
---
 .gitignore                                   |  6 ++++
 ChangeLog                                    | 11 +++++++
 contrib/mass_test/check_perlVSC.sh           | 46 +++++++++++++++++++++++++++
 contrib/mass_test/extract_manuals.sh         | 47 ++++++++++++++++++++++++++++
 contrib/mass_test/get_manuals.sh             |  4 +++
 contrib/mass_test/setup_reference_perlVSC.sh | 33 +++++++++++++++++++
 6 files changed, 147 insertions(+)

diff --git a/.gitignore b/.gitignore
index 36b778afad..1f08816347 100644
--- a/.gitignore
+++ b/.gitignore
@@ -396,6 +396,12 @@ contrib/perldoc-all/*.aux
 contrib/perldoc-all/perldoc-all.??
 contrib/perldoc-all/perldoc-all.???
 
+contrib/mass_test/compare_C_HTML
+contrib/mass_test/manuals
+contrib/mass_test/perl_HTML_refs
+contrib/mass_test/result_check_perlVSC
+contrib/mass_test/www.gnu.org
+
 js/build-aux/install-sh
 js/build-aux/missing
 js/examples/hello-html
diff --git a/ChangeLog b/ChangeLog
index a0d512125b..843720ac75 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2024-01-14  Patrice Dumas  <pertusus@free.fr>
+
+       contrib/mass_test for tests on manuals found on GNU website
+
+       * contrib/mass_test/get_manuals.sh,
+       contrib/mass_test/extract_manuals.sh: scripts to download and
+       extract manuals found on the GNU website in software/*/manual/*.texi*.
+
+       * contrib/mass_test/setup_reference_perlVSC.sh,
+       contrib/mass_test/check_perlVSC.sh: check C against perl HTML output.
+
 2024-01-14  Gavin Smith <gavinsmith0123@gmail.com>
 
        * tp/t/21multitable.t (fullwidth_in_prototype): New test.
diff --git a/contrib/mass_test/check_perlVSC.sh 
b/contrib/mass_test/check_perlVSC.sh
new file mode 100755
index 0000000000..9faa8917f7
--- /dev/null
+++ b/contrib/mass_test/check_perlVSC.sh
@@ -0,0 +1,46 @@
+#! /bin/sh
+
+# if set -e is used, diff call should be protected
+#set -e
+
+dir=compare_C_HTML
+mkdir -p $dir
+
+rm -rf result_check_perlVSC
+mkdir result_check_perlVSC
+
+TEXINFO_XS_CONVERT=1
+export TEXINFO_XS_CONVERT
+
+#set -x
+
+for manual_dir in manuals/*/ ; do
+  manual_name=`basename $manual_dir`
+  one_manual_found=no
+  for file in $manual_dir/*.texi* ; do
+    if grep -q -s '^ *@node \+[tT][Oo][Pp] *\(,.*\)\?$' $file; then
+      one_manual_found=yes
+      echo "doing $file"
+      bfile_ext=`basename $file`
+      bfile=`echo $bfile_ext | sed 's/\.texi.*$//'`
+      rm -rf $dir/$bfile/
+      mkdir $dir/$bfile/
+      err_file=$dir/$bfile/${bfile}-html_nodes.err
+      ../../tp/texi2any.pl --force --error-limit=10000 -c TEST=1 --html -o 
$dir/$bfile/html_nodes/ $file 2>$err_file
+      if test -s $err_file ; then :
+      else rm -f $err_file
+      fi
+      
+      diff_file=result_check_perlVSC/${manual_name}-${bfile}.diff
+      diff -u -r perl_HTML_refs/$bfile/ $dir/$bfile/ > $diff_file
+      if test -s $diff_file ; then
+        :
+      else
+        rm -f $diff_file
+      fi
+    fi
+  done
+  if test $one_manual_found = 'no' ; then
+    echo "WARNING: $manual_dir: no manual" 1>&2
+  fi
+done
diff --git a/contrib/mass_test/extract_manuals.sh 
b/contrib/mass_test/extract_manuals.sh
new file mode 100755
index 0000000000..807f7ed302
--- /dev/null
+++ b/contrib/mass_test/extract_manuals.sh
@@ -0,0 +1,47 @@
+#! /bin/sh
+
+set -e
+
+mkdir -p manuals
+
+for manual in www.gnu.org/software/*/manual/*.texi.tar.gz; do
+  bfile=`basename $manual .texi.tar.gz`
+  echo "$bfile"
+  rm -rf manuals/$bfile
+  mkdir manuals/$bfile
+  cp -p $manual manuals/$bfile/
+  (
+    cd manuals/$bfile/
+    tar xzf ${bfile}.texi.tar.gz
+    rm -f ${bfile}.texi.tar.gz
+  )
+done
+
+for dir in www.gnu.org/software/*/manual/ ; do
+  one_manual_found=no
+  for file in $dir/*.texi.tar.gz; do
+    if test -e "$file" ; then
+      one_manual_found=yes
+      break
+    fi
+  done
+  if test $one_manual_found = 'no' ; then
+    echo "REMARK: $dir: no manual" 1>&2
+  fi
+done
+
+# there culd be many other fix of manuals, but it is of doubtful
+# use and too time consuming to set up, instead it is better to
+# call texi2any with force.
+echo '@macro FIXME {arg}
+\\arg\\
+@end macro
+' > manuals/anubis/rendition.texi
+
+# files with does EOL found with
+# file manuals/*/*.texi | grep CRLF
+
+# remove dos end of lines.  Note that -i is not standard options of sed
+for file in manuals/orgadoc/*.texi manuals/remotecontrol/version.texi; do
+  sed -i -e 's/\r$//' $file
+done
diff --git a/contrib/mass_test/get_manuals.sh b/contrib/mass_test/get_manuals.sh
new file mode 100755
index 0000000000..33ba7afba7
--- /dev/null
+++ b/contrib/mass_test/get_manuals.sh
@@ -0,0 +1,4 @@
+#! /bin/sh
+
+wget -v -N -r 
--accept-regex='www.gnu.org/software/[^/]+/manual/(.+.texi.tar.gz)?$' 
https://www.gnu.org/manual/manual.html
+
diff --git a/contrib/mass_test/setup_reference_perlVSC.sh 
b/contrib/mass_test/setup_reference_perlVSC.sh
new file mode 100755
index 0000000000..07f893fc9f
--- /dev/null
+++ b/contrib/mass_test/setup_reference_perlVSC.sh
@@ -0,0 +1,33 @@
+#! /bin/sh
+
+set -e
+
+dir=perl_HTML_refs
+mkdir -p $dir
+
+TEXINFO_XS_CONVERT=0
+export TEXINFO_XS_CONVERT
+
+#set -x
+
+for manual_dir in manuals/*/ ; do
+  one_manual_found=no
+  for file in $manual_dir/*.texi* ; do
+    if grep -q -s '^ *@node \+[tT][Oo][Pp] *\(,.*\)\?$' $file; then
+      one_manual_found=yes
+      echo "doing $file"
+      bfile_ext=`basename $file`
+      bfile=`echo $bfile_ext | sed 's/\.texi.*$//'`
+      rm -rf $dir/$bfile/
+      mkdir $dir/$bfile/
+      err_file=$dir/$bfile/${bfile}-html_nodes.err
+      ../../tp/texi2any.pl --force --error-limit=10000 -c TEST=1 --html -o 
$dir/$bfile/html_nodes/ $file 2>$err_file
+      if test -s $err_file ; then :
+      else rm -f $err_file
+      fi
+    fi
+  done
+  if test $one_manual_found = 'no' ; then
+    echo "WARNING: $manual_dir: no manual" 1>&2
+  fi
+done



reply via email to

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