[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[groff] 01/01: Add a sanity check on 2 hdtbl examples.
From: |
Bertrand Garrigues |
Subject: |
[groff] 01/01: Add a sanity check on 2 hdtbl examples. |
Date: |
Tue, 6 Nov 2018 19:43:58 -0500 (EST) |
bgarrigues pushed a commit to branch master
in repository groff.
commit 0925a21f617c775ec14360cfda4d8e88dec8c540
Author: Bertrand Garrigues <address@hidden>
Date: Wed Nov 7 00:53:45 2018 +0100
Add a sanity check on 2 hdtbl examples.
* contrib/hdtbl/examples/test-hdtbl.sh.in: new test script that
use 'gs' to check the number of pages of 'fonts_x.ps' and
'fonts_n.ps'.
* contrib/hdtbl/hdtbl.am: connect 'test-hdtbl.sh' to 'make check'
---
ChangeLog | 10 ++++++++
contrib/hdtbl/examples/test-hdtbl.sh.in | 41 +++++++++++++++++++++++++++++++++
contrib/hdtbl/hdtbl.am | 11 ++++++++-
3 files changed, 61 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog
index 87ccb6a..91858f1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2018-11-07 Bertrand Garrigues <address@hidden>
+
+ Add a sanity check on 2 hdtbl examples.
+
+ * contrib/hdtbl/examples/test-hdtbl.sh.in: new test script that
+ use 'gs' to check the number of pages of 'fonts_x.ps' and
+ 'fonts_n.ps'.
+
+ * contrib/hdtbl/hdtbl.am: connect 'test-hdtbl.sh' to 'make check'
+
2018-11-05 G. Branden Robinson <address@hidden>
* src/utils/lookbib/lookbib.cpp: Doesn't make much sense to mark
diff --git a/contrib/hdtbl/examples/test-hdtbl.sh.in
b/contrib/hdtbl/examples/test-hdtbl.sh.in
new file mode 100644
index 0000000..9313506
--- /dev/null
+++ b/contrib/hdtbl/examples/test-hdtbl.sh.in
@@ -0,0 +1,41 @@
+#!/bin/sh
+#
+# Copyright (C) 2018- Free Software Foundation, Inc.
+#
+# This file is part of groff.
+#
+# groff is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# groff is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+# Test generated files 'font_n.ps' and 'font_x.ps'. Both should have
+# 38 pages.
+
address@hidden@
address@hidden@
+ret=0
+# $1 file, $2 expected number of lines
+check_number_pages()
+{
+ echo "Checking $1"
+ res=`$gs_program -o /dev/null/ -sDEVICE=bbox $1 2>&1 | grep
HiResBoundingBox | wc -l`
+ if test $res != $2; then
+ echo " Error: expected $2 pages, found $res pages"
+ ret=255
+ fi
+}
+
+check_number_pages $builddir/contrib/hdtbl/examples/fonts_n.ps 38
+check_number_pages $builddir/contrib/hdtbl/examples/fonts_x.ps 38
+
+exit $ret
diff --git a/contrib/hdtbl/hdtbl.am b/contrib/hdtbl/hdtbl.am
index 1b80a9a..c5e4d38 100644
--- a/contrib/hdtbl/hdtbl.am
+++ b/contrib/hdtbl/hdtbl.am
@@ -51,7 +51,8 @@ HDTBLGENFILES = \
contrib/hdtbl/examples/fonts_x.roff
EXTRA_DIST += \
contrib/hdtbl/examples/fonts_n.in \
- contrib/hdtbl/examples/fonts_x.in
+ contrib/hdtbl/examples/fonts_x.in \
+ contrib/hdtbl/examples/test-hdtbl.sh.in
HDTBLEXAMPLEFILES = \
contrib/hdtbl/examples/common.roff \
@@ -101,6 +102,14 @@ EXTRA_DIST += \
contrib/hdtbl/hdtbl.tmac-u \
contrib/hdtbl/hdmisc.tmac-u
+TESTS += contrib/hdtbl/examples/test-hdtbl.sh
+contrib/hdtbl/examples/test-hdtbl.sh: $(top_builddir)/config.status \
+ $(HDTBLPROCESSEDEXAMPLEFILES)
$(top_srcdir)/contrib/hdtbl/examples/test-hdtbl.sh.in
+ sed -e "s|address@hidden@]|$(abs_top_builddir)|g" \
+ -e "s|address@hidden@]|$(GHOSTSCRIPT)|g" \
+ $(top_srcdir)/contrib/hdtbl/examples/test-hdtbl.sh.in > $@
+ chmod +x $@
+
# Rule to generate ps and roff files
SUFFIXES += .roff .in .ps
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [groff] 01/01: Add a sanity check on 2 hdtbl examples.,
Bertrand Garrigues <=