[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
From: |
Patrice Dumas |
Date: |
Tue, 16 Apr 2024 18:51:57 -0400 (EDT) |
branch: master
commit 8d448f230d51ed11df04a73912964b4bcb7eaf75
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Wed Apr 17 00:51:23 2024 +0200
* Pod-Simple-Texinfo/Makefile.am (test_files, EXTRA_DIST),
Pod-Simple-Texinfo/test_scripts/*.sh: add tests of pod2texi.pl, based
on tests formerly in manual_tests.
---
.gitignore | 3 +
ChangeLog | 6 ++
Pod-Simple-Texinfo/Makefile.am | 7 ++-
Pod-Simple-Texinfo/TODO | 10 ---
.../manual_tests/manual_sectioning_gap_test.sh | 15 -----
.../manual_tests/test_empty_head2.sh | 9 ---
.../manual_tests/test_ref_to_unknown.sh | 9 ---
.../test_scripts/manual_sectioning_gap_test.sh | 72 ++++++++++++++++++++++
.../test_scripts/test_empty_head2.sh | 44 +++++++++++++
.../test_scripts/test_ref_to_unknown.sh | 44 +++++++++++++
.../{manual_tests => tests}/Module1.pod | 0
.../{manual_tests => tests}/Module2.pod | 0
.../{manual_tests => tests}/empty_head2.pod | 0
.../{manual_tests => tests}/ref_to_unknown.pod | 0
.../{manual_tests => tests}/reference_Th1.texi | 0
.../reference_includes/Module1.texi | 0
.../reference_includes/Module2.texi | 0
.../reference_modules_main.texi | 4 +-
.../reference_ref_to_unknown.texi | 0
.../reference_sectioning_gap.texi | 2 +-
.../reference_test_empty_head2.texi | 0
.../{manual_tests => tests}/sectioning_gap.pod | 0
22 files changed, 177 insertions(+), 48 deletions(-)
diff --git a/.gitignore b/.gitignore
index b3323fcc7a..4876b19070 100644
--- a/.gitignore
+++ b/.gitignore
@@ -414,6 +414,9 @@ Pod-Simple-Texinfo/pod2texi
Pod-Simple-Texinfo/*.log
Pod-Simple-Texinfo/*.tmp
Pod-Simple-Texinfo/*.trs
+Pod-Simple-Texinfo/test_scripts/*.log
+Pod-Simple-Texinfo/test_scripts/*.tmp
+Pod-Simple-Texinfo/test_scripts/*.trs
Pod-Simple-Texinfo/blib
Pod-Simple-Texinfo/pm_to_blib
Pod-Simple-Texinfo/MYMETA.json
diff --git a/ChangeLog b/ChangeLog
index af0fafe7cd..39f6ee0195 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2024-04-16 Patrice Dumas <pertusus@free.fr>
+
+ * Pod-Simple-Texinfo/Makefile.am (test_files, EXTRA_DIST),
+ Pod-Simple-Texinfo/test_scripts/*.sh: add tests of pod2texi.pl, based
+ on tests formerly in manual_tests.
+
2024-04-16 Patrice Dumas <pertusus@free.fr>
* tp/Texinfo/XS/main/targets.c (add_element_to_identifiers_target):
diff --git a/Pod-Simple-Texinfo/Makefile.am b/Pod-Simple-Texinfo/Makefile.am
index 2e1b112eb0..3239b6ce71 100644
--- a/Pod-Simple-Texinfo/Makefile.am
+++ b/Pod-Simple-Texinfo/Makefile.am
@@ -13,14 +13,17 @@ AM_TESTS_ENVIRONMENT = srcdir="$(srcdir)"; export srcdir;
top_srcdir="$(top_srcd
nodist_bin_SCRIPTS = pod2texi
-test_files = prove.sh
+test_files = prove.sh \
+ test_scripts/manual_sectioning_gap_test.sh \
+ test_scripts/test_empty_head2.sh \
+ test_scripts/test_ref_to_unknown.sh
EXTRA_DIST = Changes \
Makefile.PL \
MANIFEST \
t/Pod-Simple-Texinfo.t \
pod2texi.pl \
- manual_tests \
+ tests \
$(test_files)
modulesdir = $(pkgdatadir)/Pod-Simple-Texinfo/Pod/Simple/
diff --git a/Pod-Simple-Texinfo/TODO b/Pod-Simple-Texinfo/TODO
index aa7fe9cef2..2cd3ffb223 100644
--- a/Pod-Simple-Texinfo/TODO
+++ b/Pod-Simple-Texinfo/TODO
@@ -6,13 +6,3 @@ This is the todo list for Pod-Simple-Texinfo
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved.
-
-Add tests of pod2texi.pl. The tests of the module are fine, but in
-pod2texi.pl the Texinfo output is completed with menus and modified to
-be valid Texinfo, which mobilize code that is not tested in that
-configuration.
-
-It is not clear how this can be done in Perl modules infrastructure,
-but it could be done with automake infrastructure.
-
-Tests in manual_tests/ should be in the test suite.
diff --git a/Pod-Simple-Texinfo/manual_tests/manual_sectioning_gap_test.sh
b/Pod-Simple-Texinfo/manual_tests/manual_sectioning_gap_test.sh
deleted file mode 100755
index f90cc168a0..0000000000
--- a/Pod-Simple-Texinfo/manual_tests/manual_sectioning_gap_test.sh
+++ /dev/null
@@ -1,15 +0,0 @@
-#! /bin/sh
-
-# tests the code in pod2texi.pl _parsed_manual_tree with gaps in sectioning
-# and manual name prepended.
-# From the Pod-Simple-Texinfo, run
-# ./manual_tests/manual_sectioning_gap_test.sh
-
-./pod2texi.pl --base-level=2 manual_tests/sectioning_gap.pod | diff -u
manual_tests/reference_sectioning_gap.texi -
-diff -u manual_tests/reference_Th1.texi Th1.texi
-rm -f Th1.texi
-
-./pod2texi.pl --base-level=section --subdir=manual_tests/includes
manual_tests/Module1.pod manual_tests/Module2.pod | diff -u
manual_tests/reference_modules_main.texi -
-diff -u -r manual_tests/reference_includes manual_tests/includes
-rm -rf manual_tests/includes
-
diff --git a/Pod-Simple-Texinfo/manual_tests/test_empty_head2.sh
b/Pod-Simple-Texinfo/manual_tests/test_empty_head2.sh
deleted file mode 100755
index 8f3b17c2a1..0000000000
--- a/Pod-Simple-Texinfo/manual_tests/test_empty_head2.sh
+++ /dev/null
@@ -1,9 +0,0 @@
-#! /bin/sh
-
-# From the Pod-Simple-Texinfo, run
-# ./manual_tests/test_empty_head2.sh
-
-# The manual processed in the test has an empty head.
-# There are errors generated when parsing the manual to fix and add
-# menus, which can be seen with --debug=2.
-./pod2texi.pl manual_tests/empty_head2.pod | diff -u
manual_tests/reference_test_empty_head2.texi -
diff --git a/Pod-Simple-Texinfo/manual_tests/test_ref_to_unknown.sh
b/Pod-Simple-Texinfo/manual_tests/test_ref_to_unknown.sh
deleted file mode 100755
index 2b5f6e07e2..0000000000
--- a/Pod-Simple-Texinfo/manual_tests/test_ref_to_unknown.sh
+++ /dev/null
@@ -1,9 +0,0 @@
-#! /bin/sh
-
-# From the Pod-Simple-Texinfo, run
-# ./manual_tests/test_ref_to_unknown.sh
-
-# The manual processed in the test has a reference that is not resolved.
-# There is an error generated when gathering internal references after
-# parsing the manual to fix and add menus, which can be seen with --debug=2.
-./pod2texi.pl manual_tests/ref_to_unknown.pod | diff -u
manual_tests/reference_ref_to_unknown.texi -
diff --git a/Pod-Simple-Texinfo/test_scripts/manual_sectioning_gap_test.sh
b/Pod-Simple-Texinfo/test_scripts/manual_sectioning_gap_test.sh
new file mode 100755
index 0000000000..45b0d3a1ff
--- /dev/null
+++ b/Pod-Simple-Texinfo/test_scripts/manual_sectioning_gap_test.sh
@@ -0,0 +1,72 @@
+#! /bin/sh
+
+# tests the code in pod2texi.pl _parsed_manual_tree with gaps in sectioning
+# and manual name prepended.
+# From Pod-Simple-Texinfo/, run
+# ./test_scripts/manual_sectioning_gap_test.sh
+
+if [ "z$testdir" = 'z' ]; then
+ testdir=.
+fi
+
+if test z"$srcdir" = "z"; then
+ srcdir=.
+fi
+
+# for DIFF_U_OPTION
+. $testdir/../tp/defs || exit 1
+
+mkdir -p out_tests
+
+return_code=0
+
+${srcdir}/pod2texi.pl --base-level=2 --subdir=out_tests
${srcdir}/tests/sectioning_gap.pod > out_tests/sectioning_gap.texi
+ret=$?
+if [ $ret != 0 ]; then
+ echo "F sectioning_gap.pod: $ret"
+ return_code=1
+fi
+
+diff $DIFF_U_OPTION ${srcdir}/tests/reference_sectioning_gap.texi
out_tests/sectioning_gap.texi
+diff_ret=$?
+if [ $diff_ret != 0 ]; then
+ return_code=1
+elif [ $return_code = 0 ]; then
+ rm -f out_tests/sectioning_gap.texi
+fi
+
+diff $DIFF_U_OPTION ${srcdir}/tests/reference_Th1.texi out_tests/Th1.texi
+if [ $diff_ret != 0 ]; then
+ return_code=1
+elif [ $return_code = 0 ]; then
+ rm -f out_tests/Th1.texi
+fi
+
+${srcdir}/pod2texi.pl --base-level=section --subdir=out_tests/includes
${srcdir}/tests/Module1.pod ${srcdir}/tests/Module2.pod >
out_tests/modules_main.texi
+if [ $ret != 0 ]; then
+ echo "F Module1.pod Module2.pod: $ret"
+ return_code=1
+fi
+
+diff $DIFF_U_OPTION ${srcdir}/tests/reference_modules_main.texi
out_tests/modules_main.texi
+diff_ret=$?
+if [ $diff_ret != 0 ]; then
+ return_code=1
+elif [ $return_code = 0 ]; then
+ rm -f out_tests/modules_main.texi
+fi
+
+diff $DIFF_U_OPTION -r ${srcdir}/tests/reference_includes out_tests/includes
+diff_ret=$?
+if [ $diff_ret != 0 ]; then
+ return_code=1
+elif [ $return_code = 0 ]; then
+ rm -rf out_tests/includes
+fi
+
+if [ $return_code = 0 ]; then
+ rmdir out_tests
+fi
+
+exit $return_code
+
diff --git a/Pod-Simple-Texinfo/test_scripts/test_empty_head2.sh
b/Pod-Simple-Texinfo/test_scripts/test_empty_head2.sh
new file mode 100755
index 0000000000..25480fc834
--- /dev/null
+++ b/Pod-Simple-Texinfo/test_scripts/test_empty_head2.sh
@@ -0,0 +1,44 @@
+#! /bin/sh
+
+# From Pod-Simple-Texinfo/, run
+# ./test_scripts/test_empty_head2.sh
+
+if [ "z$testdir" = 'z' ]; then
+ testdir=.
+fi
+
+if test z"$srcdir" = "z"; then
+ srcdir=.
+fi
+
+# for DIFF_U_OPTION
+. $testdir/../tp/defs || exit 1
+
+mkdir -p out_tests_empty_head2
+
+return_code=0
+
+# The manual processed in the test has an empty head.
+# There are errors generated when parsing the manual to fix and add
+# menus, which can be seen with --debug=2.
+${srcdir}/pod2texi.pl ${srcdir}/tests/empty_head2.pod >
out_tests_empty_head2/empty_head2.texi
+ret=$?
+if [ $ret != 0 ]; then
+ echo "F empty_head2.pod: $ret"
+ return_code=1
+fi
+
+diff $DIFF_U_OPTION ${srcdir}/tests/reference_test_empty_head2.texi
out_tests_empty_head2/empty_head2.texi
+diff_ret=$?
+if [ $diff_ret != 0 ]; then
+ return_code=1
+elif [ $return_code = 0 ]; then
+ rm -f out_tests_empty_head2/empty_head2.texi
+fi
+
+if [ $return_code = 0 ]; then
+ rmdir out_tests_empty_head2
+fi
+
+exit $return_code
+
diff --git a/Pod-Simple-Texinfo/test_scripts/test_ref_to_unknown.sh
b/Pod-Simple-Texinfo/test_scripts/test_ref_to_unknown.sh
new file mode 100755
index 0000000000..3760db6b01
--- /dev/null
+++ b/Pod-Simple-Texinfo/test_scripts/test_ref_to_unknown.sh
@@ -0,0 +1,44 @@
+#! /bin/sh
+
+# From Pod-Simple-Texinfo/, run
+# ./test_scripts/test_ref_to_unknown.sh
+
+if [ "z$testdir" = 'z' ]; then
+ testdir=.
+fi
+
+if test z"$srcdir" = "z"; then
+ srcdir=.
+fi
+
+# for DIFF_U_OPTION
+. $testdir/../tp/defs || exit 1
+
+mkdir -p out_tests_ref_to_unknown
+
+return_code=0
+
+# The manual processed in the test has a reference that is not resolved.
+# There is an error generated when gathering internal references after
+# parsing the manual to fix and add menus, which can be seen with --debug=2.
+${srcdir}/pod2texi.pl ${srcdir}/tests/ref_to_unknown.pod >
out_tests_ref_to_unknown/ref_to_unknown.texi
+ret=$?
+if [ $ret != 0 ]; then
+ echo "F ref_to_unknown.pod: $ret"
+ return_code=1
+fi
+
+diff $DIFF_U_OPTION ${srcdir}/tests/reference_ref_to_unknown.texi
out_tests_ref_to_unknown/ref_to_unknown.texi
+diff_ret=$?
+if [ $diff_ret != 0 ]; then
+ return_code=1
+elif [ $return_code = 0 ]; then
+ rm -f out_tests_ref_to_unknown/ref_to_unknown.texi
+fi
+
+if [ $return_code = 0 ]; then
+ rmdir out_tests_ref_to_unknown
+fi
+
+exit $return_code
+
diff --git a/Pod-Simple-Texinfo/manual_tests/Module1.pod
b/Pod-Simple-Texinfo/tests/Module1.pod
similarity index 100%
rename from Pod-Simple-Texinfo/manual_tests/Module1.pod
rename to Pod-Simple-Texinfo/tests/Module1.pod
diff --git a/Pod-Simple-Texinfo/manual_tests/Module2.pod
b/Pod-Simple-Texinfo/tests/Module2.pod
similarity index 100%
rename from Pod-Simple-Texinfo/manual_tests/Module2.pod
rename to Pod-Simple-Texinfo/tests/Module2.pod
diff --git a/Pod-Simple-Texinfo/manual_tests/empty_head2.pod
b/Pod-Simple-Texinfo/tests/empty_head2.pod
similarity index 100%
rename from Pod-Simple-Texinfo/manual_tests/empty_head2.pod
rename to Pod-Simple-Texinfo/tests/empty_head2.pod
diff --git a/Pod-Simple-Texinfo/manual_tests/ref_to_unknown.pod
b/Pod-Simple-Texinfo/tests/ref_to_unknown.pod
similarity index 100%
rename from Pod-Simple-Texinfo/manual_tests/ref_to_unknown.pod
rename to Pod-Simple-Texinfo/tests/ref_to_unknown.pod
diff --git a/Pod-Simple-Texinfo/manual_tests/reference_Th1.texi
b/Pod-Simple-Texinfo/tests/reference_Th1.texi
similarity index 100%
rename from Pod-Simple-Texinfo/manual_tests/reference_Th1.texi
rename to Pod-Simple-Texinfo/tests/reference_Th1.texi
diff --git a/Pod-Simple-Texinfo/manual_tests/reference_includes/Module1.texi
b/Pod-Simple-Texinfo/tests/reference_includes/Module1.texi
similarity index 100%
rename from Pod-Simple-Texinfo/manual_tests/reference_includes/Module1.texi
rename to Pod-Simple-Texinfo/tests/reference_includes/Module1.texi
diff --git a/Pod-Simple-Texinfo/manual_tests/reference_includes/Module2.texi
b/Pod-Simple-Texinfo/tests/reference_includes/Module2.texi
similarity index 100%
rename from Pod-Simple-Texinfo/manual_tests/reference_includes/Module2.texi
rename to Pod-Simple-Texinfo/tests/reference_includes/Module2.texi
diff --git a/Pod-Simple-Texinfo/manual_tests/reference_modules_main.texi
b/Pod-Simple-Texinfo/tests/reference_modules_main.texi
similarity index 83%
rename from Pod-Simple-Texinfo/manual_tests/reference_modules_main.texi
rename to Pod-Simple-Texinfo/tests/reference_modules_main.texi
index 75243c7820..6ee96d4201 100644
--- a/Pod-Simple-Texinfo/manual_tests/reference_modules_main.texi
+++ b/Pod-Simple-Texinfo/tests/reference_modules_main.texi
@@ -43,7 +43,7 @@ Module2
@end detailmenu
@end menu
-@include manual_tests/includes/Module1.texi
-@include manual_tests/includes/Module2.texi
+@include out_tests/includes/Module1.texi
+@include out_tests/includes/Module2.texi
@bye
diff --git a/Pod-Simple-Texinfo/manual_tests/reference_ref_to_unknown.texi
b/Pod-Simple-Texinfo/tests/reference_ref_to_unknown.texi
similarity index 100%
rename from Pod-Simple-Texinfo/manual_tests/reference_ref_to_unknown.texi
rename to Pod-Simple-Texinfo/tests/reference_ref_to_unknown.texi
diff --git a/Pod-Simple-Texinfo/manual_tests/reference_sectioning_gap.texi
b/Pod-Simple-Texinfo/tests/reference_sectioning_gap.texi
similarity index 89%
rename from Pod-Simple-Texinfo/manual_tests/reference_sectioning_gap.texi
rename to Pod-Simple-Texinfo/tests/reference_sectioning_gap.texi
index a6250d8357..275296b6c5 100644
--- a/Pod-Simple-Texinfo/manual_tests/reference_sectioning_gap.texi
+++ b/Pod-Simple-Texinfo/tests/reference_sectioning_gap.texi
@@ -28,6 +28,6 @@ Th1
@end detailmenu
@end menu
-@include Th1.texi
+@include out_tests/Th1.texi
@bye
diff --git a/Pod-Simple-Texinfo/manual_tests/reference_test_empty_head2.texi
b/Pod-Simple-Texinfo/tests/reference_test_empty_head2.texi
similarity index 100%
rename from Pod-Simple-Texinfo/manual_tests/reference_test_empty_head2.texi
rename to Pod-Simple-Texinfo/tests/reference_test_empty_head2.texi
diff --git a/Pod-Simple-Texinfo/manual_tests/sectioning_gap.pod
b/Pod-Simple-Texinfo/tests/sectioning_gap.pod
similarity index 100%
rename from Pod-Simple-Texinfo/manual_tests/sectioning_gap.pod
rename to Pod-Simple-Texinfo/tests/sectioning_gap.pod