summaryrefslogtreecommitdiff
path: root/Build/source/utils/ps2eps
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2011-09-29 12:04:55 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2011-09-29 12:04:55 +0000
commitdf2d55aedf664304987100812c45bdf4ef8231a0 (patch)
tree51fc759bb56195e21bb619b8859fe49e51d06697 /Build/source/utils/ps2eps
parent211a8519bb41a68b522fcadffad7df3041ab242b (diff)
ps2eps: add a simple test case
git-svn-id: svn://tug.org/texlive/trunk@24128 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/utils/ps2eps')
-rw-r--r--Build/source/utils/ps2eps/ChangeLog6
-rw-r--r--Build/source/utils/ps2eps/Makefile.am11
-rw-r--r--Build/source/utils/ps2eps/Makefile.in136
-rwxr-xr-xBuild/source/utils/ps2eps/bbox.test9
-rw-r--r--Build/source/utils/ps2eps/tests/plot.out2
-rw-r--r--Build/source/utils/ps2eps/tests/plot.pbmbin0 -> 4648 bytes
6 files changed, 142 insertions, 22 deletions
diff --git a/Build/source/utils/ps2eps/ChangeLog b/Build/source/utils/ps2eps/ChangeLog
index 0882f5eb7c2..a17dc0c5dbd 100644
--- a/Build/source/utils/ps2eps/ChangeLog
+++ b/Build/source/utils/ps2eps/ChangeLog
@@ -1,3 +1,9 @@
+2011-09-22 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * bbox.test: New shell script testing bbox.
+ * tests/plot.{pnm,out}: Test input and expected output.
+ * Makefile.am: Add the test and its data.
+
2011-03-31 Peter Breitenlohner <peb@mppmu.mpg.de>
* Makefile.am: Use the ../../texk/am/script_links.am fragment.
diff --git a/Build/source/utils/ps2eps/Makefile.am b/Build/source/utils/ps2eps/Makefile.am
index 731c0bb6449..67e6ed77347 100644
--- a/Build/source/utils/ps2eps/Makefile.am
+++ b/Build/source/utils/ps2eps/Makefile.am
@@ -1,6 +1,6 @@
## Makefile.am for the TeX Live subdirectory utils/ps2eps/
##
-## Copyright (C) 2009 - 2011 Peter Breitenlohner <tex-live@tug.org>
+## Copyright (C) 2009-2011 Peter Breitenlohner <tex-live@tug.org>
## You may freely use, modify and/or distribute this file.
##
ACLOCAL_AMFLAGS = -I ../../m4
@@ -39,3 +39,12 @@ uninstall-hook: uninstall-links
CLEANFILES = $(nodist_bin_SCRIPTS)
+## Tests
+##
+TESTS = bbox.test
+EXTRA_DIST += $(TESTS)
+
+## bbox.test
+EXTRA_DIST += tests/plot.pbm tests/plot.out
+DISTCLEANFILES = plot.out
+
diff --git a/Build/source/utils/ps2eps/Makefile.in b/Build/source/utils/ps2eps/Makefile.in
index b5338c10402..20d72764509 100644
--- a/Build/source/utils/ps2eps/Makefile.in
+++ b/Build/source/utils/ps2eps/Makefile.in
@@ -99,6 +99,8 @@ NROFF = nroff
MANS = $(man1_MANS)
ETAGS = etags
CTAGS = ctags
+am__tty_colors = \
+red=; grn=; lgn=; blu=; std=
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
@@ -198,7 +200,8 @@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
ACLOCAL_AMFLAGS = -I ../../m4
-EXTRA_DIST = $(PS2EPS_TREE) $(PS2EPS_TREE)-PATCHES
+EXTRA_DIST = $(PS2EPS_TREE) $(PS2EPS_TREE)-PATCHES \
+ ../../build-aux/relpath $(TESTS) tests/plot.pbm tests/plot.out
AM_CFLAGS = $(WARNING_CFLAGS)
bbox_SOURCES = \
$(PS2EPS_TREE)/src/C/bbox.c
@@ -216,6 +219,8 @@ all_scripts = $(lua_scripts) $(perl_scripts) $(shell_scripts)
texmfdir = ${prefix}/$(scriptsdir)
nodist_texmf_SCRIPTS = $(PS2EPS_TREE)/bin/ps2eps.pl
CLEANFILES = $(nodist_bin_SCRIPTS)
+TESTS = bbox.test
+DISTCLEANFILES = plot.out
all: all-am
.SUFFIXES:
@@ -485,6 +490,98 @@ GTAGS:
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+check-TESTS: $(TESTS)
+ @failed=0; all=0; xfail=0; xpass=0; skip=0; \
+ srcdir=$(srcdir); export srcdir; \
+ list=' $(TESTS) '; \
+ $(am__tty_colors); \
+ if test -n "$$list"; then \
+ for tst in $$list; do \
+ if test -f ./$$tst; then dir=./; \
+ elif test -f $$tst; then dir=; \
+ else dir="$(srcdir)/"; fi; \
+ if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
+ all=`expr $$all + 1`; \
+ case " $(XFAIL_TESTS) " in \
+ *[\ \ ]$$tst[\ \ ]*) \
+ xpass=`expr $$xpass + 1`; \
+ failed=`expr $$failed + 1`; \
+ col=$$red; res=XPASS; \
+ ;; \
+ *) \
+ col=$$grn; res=PASS; \
+ ;; \
+ esac; \
+ elif test $$? -ne 77; then \
+ all=`expr $$all + 1`; \
+ case " $(XFAIL_TESTS) " in \
+ *[\ \ ]$$tst[\ \ ]*) \
+ xfail=`expr $$xfail + 1`; \
+ col=$$lgn; res=XFAIL; \
+ ;; \
+ *) \
+ failed=`expr $$failed + 1`; \
+ col=$$red; res=FAIL; \
+ ;; \
+ esac; \
+ else \
+ skip=`expr $$skip + 1`; \
+ col=$$blu; res=SKIP; \
+ fi; \
+ echo "$${col}$$res$${std}: $$tst"; \
+ done; \
+ if test "$$all" -eq 1; then \
+ tests="test"; \
+ All=""; \
+ else \
+ tests="tests"; \
+ All="All "; \
+ fi; \
+ if test "$$failed" -eq 0; then \
+ if test "$$xfail" -eq 0; then \
+ banner="$$All$$all $$tests passed"; \
+ else \
+ if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \
+ banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \
+ fi; \
+ else \
+ if test "$$xpass" -eq 0; then \
+ banner="$$failed of $$all $$tests failed"; \
+ else \
+ if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \
+ banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \
+ fi; \
+ fi; \
+ dashes="$$banner"; \
+ skipped=""; \
+ if test "$$skip" -ne 0; then \
+ if test "$$skip" -eq 1; then \
+ skipped="($$skip test was not run)"; \
+ else \
+ skipped="($$skip tests were not run)"; \
+ fi; \
+ test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
+ dashes="$$skipped"; \
+ fi; \
+ report=""; \
+ if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \
+ report="Please report to $(PACKAGE_BUGREPORT)"; \
+ test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \
+ dashes="$$report"; \
+ fi; \
+ dashes=`echo "$$dashes" | sed s/./=/g`; \
+ if test "$$failed" -eq 0; then \
+ echo "$$grn$$dashes"; \
+ else \
+ echo "$$red$$dashes"; \
+ fi; \
+ echo "$$banner"; \
+ test -z "$$skipped" || echo "$$skipped"; \
+ test -z "$$report" || echo "$$report"; \
+ echo "$$dashes$$std"; \
+ test "$$failed" -eq 0; \
+ else :; fi
+
distdir: $(DISTFILES)
@list='$(MANS)'; if test -n "$$list"; then \
list=`for p in $$list; do \
@@ -649,6 +746,7 @@ distcleancheck: distclean
$(distcleancheck_listfiles) ; \
exit 1; } >&2
check-am: all-am
+ $(MAKE) $(AM_MAKEFLAGS) check-TESTS
check: check-am
all-am: Makefile $(PROGRAMS) $(SCRIPTS) $(MANS)
installdirs:
@@ -677,6 +775,7 @@ clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+ -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@@ -758,12 +857,12 @@ uninstall-am: uninstall-binPROGRAMS uninstall-man \
$(MAKE) $(AM_MAKEFLAGS) uninstall-hook
uninstall-man: uninstall-man1
-.MAKE: install-am install-data-am install-strip uninstall-am
+.MAKE: check-am install-am install-data-am install-strip uninstall-am
-.PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \
- clean-binPROGRAMS clean-generic ctags dist dist-all dist-bzip2 \
- dist-gzip dist-hook dist-lzma dist-shar dist-tarZ dist-xz \
- dist-zip distcheck distclean distclean-compile \
+.PHONY: CTAGS GTAGS all all-am am--refresh check check-TESTS check-am \
+ clean clean-binPROGRAMS clean-generic ctags dist dist-all \
+ dist-bzip2 dist-gzip dist-hook dist-lzma dist-shar dist-tarZ \
+ dist-xz dist-zip distcheck distclean distclean-compile \
distclean-generic distclean-tags distcleancheck distdir \
distuninstallcheck dvi dvi-am html html-am info info-am \
install install-am install-binPROGRAMS install-data \
@@ -783,10 +882,8 @@ uninstall-man: uninstall-man1
# in case of an SVN repository
dist-hook:
rm -rf `find $(distdir) -name .svn`
-
-#
.PHONY: install-lua-links install-perl-links install-shell-links \
- install-links make-links uninstall-links
+ install-links uninstall-links
@WIN32_TRUE@@WIN32_WRAP_TRUE@$(wrappers): $(runscript)
@WIN32_TRUE@@WIN32_WRAP_TRUE@ $(LN_S) $(runscript) $@
@@ -799,21 +896,18 @@ install-perl-links:
install-shell-links:
@WIN32_FALSE@ $(MAKE) $(AM_MAKEFLAGS) TYPE=shell EXT=sh install-links
-# We support both multiplatform and non-multiplatform builds.
+# We support native builds, multiplatform or not, as well as distro builds.
install-links:
- case "$(bindir)" in \
- */bin) $(MAKE) $(AM_MAKEFLAGS) REL=.. TYPE=$(TYPE) EXT=$(EXT) make-links;; \
- */bin/*) $(MAKE) $(AM_MAKEFLAGS) REL=../.. TYPE=$(TYPE) EXT=$(EXT) make-links;; \
- *) echo "strange directory '$(bindir)' for linked $(TYPE) scripts" >&2; \
- exit 1;; \
- esac
-
-make-links:
- @cd $(DESTDIR)$(bindir) && \
+ @REL=`$(SHELL) $(srcdir)/../../build-aux/relpath '$(DESTDIR)' '$(bindir)' '$(prefix)'`; \
+ if test -z "$$REL"; then \
+ echo 'unable to compute relative path for linked $(TYPE) scripts' >&2; \
+ exit 1; \
+ fi; \
+ cd $(DESTDIR)$(bindir) && \
for f in $($(TYPE)_scripts); do \
rm -f $$f; \
- echo "creating link '$$f' -> '$(REL)/$(scriptsdir)/$$f.$(EXT)'"; \
- $(LN_S) $(REL)/$(scriptsdir)/$$f.$(EXT) $$f || exit 1; \
+ echo "creating link '$$f' -> '$$REL/$(scriptsdir)/$$f.$(EXT)'"; \
+ $(LN_S) $$REL/$(scriptsdir)/$$f.$(EXT) $$f || exit 1; \
done
uninstall-links:
diff --git a/Build/source/utils/ps2eps/bbox.test b/Build/source/utils/ps2eps/bbox.test
new file mode 100755
index 00000000000..3216ccaf7d7
--- /dev/null
+++ b/Build/source/utils/ps2eps/bbox.test
@@ -0,0 +1,9 @@
+#! /bin/sh
+
+# Copyright (C) 2011 Peter Breitenlohner <tex-live@tug.org>
+# You may freely use, modify and/or distribute this file.
+
+./bbox -r 20 $srcdir/tests/plot.pbm >plot.out \
+ && diff plot.out $srcdir/tests/plot.out \
+ || exit 1
+
diff --git a/Build/source/utils/ps2eps/tests/plot.out b/Build/source/utils/ps2eps/tests/plot.out
new file mode 100644
index 00000000000..8fa1c79662a
--- /dev/null
+++ b/Build/source/utils/ps2eps/tests/plot.out
@@ -0,0 +1,2 @@
+%%BoundingBox: 205 75 598 602
+%%HiResBoundingBox: 205.200000 75.600000 597.600000 601.200000
diff --git a/Build/source/utils/ps2eps/tests/plot.pbm b/Build/source/utils/ps2eps/tests/plot.pbm
new file mode 100644
index 00000000000..f0f07230e21
--- /dev/null
+++ b/Build/source/utils/ps2eps/tests/plot.pbm
Binary files differ