summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorPedro Vicente Nunes <pvn@hdfgroup.org>2008-06-16 20:28:52 (GMT)
committerPedro Vicente Nunes <pvn@hdfgroup.org>2008-06-16 20:28:52 (GMT)
commit0df34ad232f331d2d87e8ec0046298ef844127f8 (patch)
treef49618898a3f67815dc925891c15126753aba862 /tools
parent8d914f5a3e6d0e93c0293eb2ee2e453acd6eeb07 (diff)
downloadhdf5-0df34ad232f331d2d87e8ec0046298ef844127f8.zip
hdf5-0df34ad232f331d2d87e8ec0046298ef844127f8.tar.gz
hdf5-0df34ad232f331d2d87e8ec0046298ef844127f8.tar.bz2
[svn-r15219] added a test file and a test script
for now, the test script just calls the tool binary with the command line parameters, with no special checking of the accuracy of the output contents (jpeg files) tested: linux
Diffstat (limited to 'tools')
-rw-r--r--tools/h52jpeg/Makefile.am10
-rw-r--r--tools/h52jpeg/Makefile.in51
-rw-r--r--tools/h52jpeg/h52jpeg.sh91
-rw-r--r--tools/testfiles/h52jpegtst.h5bin0 -> 227613 bytes
4 files changed, 126 insertions, 26 deletions
diff --git a/tools/h52jpeg/Makefile.am b/tools/h52jpeg/Makefile.am
index fdc1eee..05ea153 100644
--- a/tools/h52jpeg/Makefile.am
+++ b/tools/h52jpeg/Makefile.am
@@ -23,22 +23,22 @@ include $(top_srcdir)/config/commence.am
# Include src and tools/lib directories
INCLUDES=-I$(top_srcdir)/src -I$(top_srcdir)/tools/lib -I$(top_srcdir)/hl/src
-# These are our main targets, the tools
+# These are our main targets
+TEST_PROG=h52jpegtst
+TEST_SCRIPT=$(srcdir)/h52jpeg.sh
-#TEST_SCRIPT=$(srcdir)/h52jpeg.sh
check_SCRIPTS=$(TEST_SCRIPT)
+check_PROGRAMS=$(TEST_PROG)
bin_PROGRAMS=h52jpeg
noinst_PROGRAMS=h52jpegtst
h52jpeg_SOURCES=h52jpeg.c
-
h52jpegtst_SOURCES=h52jpegtst.c
# Programs all depend on the hdf5 library, the tools library, and the HL
# library.
-LDADD=$(LIBH5_HL) $(LIBH5TOOLS) $(LIBHDF5) -ljpeg
-
+LDADD=$(LIBH5_HL) $(LIBH5TOOLS) $(LIBHDF5) -ljpeg
CHECK_CLEANFILES+=*.h5
CHECK_CLEANFILES+=*.jpeg
diff --git a/tools/h52jpeg/Makefile.in b/tools/h52jpeg/Makefile.in
index ae091c7..606ee95 100644
--- a/tools/h52jpeg/Makefile.in
+++ b/tools/h52jpeg/Makefile.in
@@ -52,9 +52,10 @@ host_triplet = @host@
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
$(top_srcdir)/config/commence.am \
$(top_srcdir)/config/conclude.am
+check_PROGRAMS = $(am__EXEEXT_1)
bin_PROGRAMS = h52jpeg$(EXEEXT)
noinst_PROGRAMS = h52jpegtst$(EXEEXT)
-TESTS = $(am__EXEEXT_1)
+TESTS = $(check_PROGRAMS) $(check_SCRIPTS)
subdir = tools/h52jpeg
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.in
@@ -65,6 +66,7 @@ CONFIG_HEADER = $(top_builddir)/src/H5config.h
CONFIG_CLEAN_FILES =
am__installdirs = "$(DESTDIR)$(bindir)"
binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+am__EXEEXT_1 = h52jpegtst$(EXEEXT)
PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS)
am_h52jpeg_OBJECTS = h52jpeg.$(OBJEXT)
h52jpeg_OBJECTS = $(am_h52jpeg_OBJECTS)
@@ -90,7 +92,6 @@ SOURCES = $(h52jpeg_SOURCES) $(h52jpegtst_SOURCES)
DIST_SOURCES = $(h52jpeg_SOURCES) $(h52jpegtst_SOURCES)
ETAGS = etags
CTAGS = ctags
-am__EXEEXT_1 =
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = /home1/packages/automake/automake-1.9.6/bin/aclocal-1.9 -I /afs/ncsa/projects/hdf/packages/libtool_1.5.14/Linux_2.4/share/aclocal
ADD_PARALLEL_FILES = @ADD_PARALLEL_FILES@
@@ -343,9 +344,9 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.h5 *.jpeg
# Include src and tools/lib directories
INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/tools/lib -I$(top_srcdir)/hl/src
-# These are our main targets, the tools
-
-#TEST_SCRIPT=$(srcdir)/h52jpeg.sh
+# These are our main targets
+TEST_PROG = h52jpegtst
+TEST_SCRIPT = $(srcdir)/h52jpeg.sh
check_SCRIPTS = $(TEST_SCRIPT)
h52jpeg_SOURCES = h52jpeg.c
h52jpegtst_SOURCES = h52jpegtst.c
@@ -431,6 +432,13 @@ clean-binPROGRAMS:
rm -f $$p $$f ; \
done
+clean-checkPROGRAMS:
+ @list='$(check_PROGRAMS)'; for p in $$list; do \
+ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f $$p $$f"; \
+ rm -f $$p $$f ; \
+ done
+
clean-noinstPROGRAMS:
@list='$(noinst_PROGRAMS)'; for p in $$list; do \
f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
@@ -554,7 +562,7 @@ distdir: $(DISTFILES)
fi; \
done
check-am: all-am
- $(MAKE) $(AM_MAKEFLAGS) $(check_SCRIPTS)
+ $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) $(check_SCRIPTS)
$(MAKE) $(AM_MAKEFLAGS) check-TESTS
check: check-am
all-am: Makefile $(PROGRAMS) all-local
@@ -588,8 +596,8 @@ maintainer-clean-generic:
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
-clean-am: clean-binPROGRAMS clean-generic clean-libtool \
- clean-noinstPROGRAMS mostlyclean-am
+clean-am: clean-binPROGRAMS clean-checkPROGRAMS clean-generic \
+ clean-libtool clean-noinstPROGRAMS mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
@@ -648,19 +656,20 @@ uninstall-am: uninstall-binPROGRAMS
.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS all all-am all-local check check-TESTS check-am \
- clean clean-binPROGRAMS clean-generic clean-libtool \
- clean-noinstPROGRAMS ctags distclean distclean-compile \
- distclean-generic distclean-libtool distclean-tags distdir dvi \
- dvi-am html html-am info info-am install install-am \
- install-binPROGRAMS install-data install-data-am install-dvi \
- install-dvi-am install-exec install-exec-am install-html \
- install-html-am install-info install-info-am install-man \
- install-pdf install-pdf-am install-ps install-ps-am \
- install-strip installcheck installcheck-am installdirs \
- maintainer-clean maintainer-clean-generic mostlyclean \
- mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
- mostlyclean-local pdf pdf-am ps ps-am tags uninstall \
- uninstall-am uninstall-binPROGRAMS
+ clean clean-binPROGRAMS clean-checkPROGRAMS clean-generic \
+ clean-libtool clean-noinstPROGRAMS ctags distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-tags distdir dvi dvi-am html html-am info info-am \
+ install install-am install-binPROGRAMS install-data \
+ install-data-am install-dvi install-dvi-am install-exec \
+ install-exec-am install-html install-html-am install-info \
+ install-info-am install-man install-pdf install-pdf-am \
+ install-ps install-ps-am install-strip installcheck \
+ installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool mostlyclean-local pdf \
+ pdf-am ps ps-am tags uninstall uninstall-am \
+ uninstall-binPROGRAMS
# List all build rules defined by HDF5 Makefiles as "PHONY" targets here.
diff --git a/tools/h52jpeg/h52jpeg.sh b/tools/h52jpeg/h52jpeg.sh
new file mode 100644
index 0000000..0901cd2
--- /dev/null
+++ b/tools/h52jpeg/h52jpeg.sh
@@ -0,0 +1,91 @@
+#! /bin/sh
+#
+# Copyright by The HDF Group.
+# Copyright by the Board of Trustees of the University of Illinois.
+# All rights reserved.
+#
+# This file is part of HDF5. The full HDF5 copyright notice, including
+# terms governing use, modification, and redistribution, is contained in
+# the files COPYING and Copyright.html. COPYING can be found at the root
+# of the source code distribution tree; Copyright.html can be found at the
+# root level of an installed copy of the electronic HDF5 document set and
+# is linked from the top-level documents page. It can also be found at
+# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have
+# access to either file, you may request a copy from help@hdfgroup.org.
+#
+# Tests for the h52jpeg tool
+# Pedro Vicente Nunes (THG), 6/16/2008
+
+TOOL=h52jpeg # The tool name
+TOOL_BIN=`pwd`/$TOOL # The path of the tool binary
+
+SRCFILE=h52jpegtst.h5
+INDIR=$srcdir/../testfiles
+TESTFILE="$INDIR/$SRCFILE"
+
+CMP='cmp -s'
+DIFF='diff -c'
+
+nerrors=0
+verbose=yes
+
+# The build (current) directory might be different than the source directory.
+if test -z "$srcdir"; then
+ srcdir=.
+fi
+
+
+# Print a line-line message left justified in a field of 70 characters
+# beginning with the word "Testing".
+#
+TESTING() {
+ SPACES=" "
+ echo "Testing $* $SPACES" | cut -c1-70 | tr -d '\012'
+}
+
+# Just call the tool binary with the command line parameters
+#
+TOOLTEST()
+{
+ # Run test.
+ # Tflops interprets "$@" as "" when no parameter is given (e.g., the
+ # case of missing file name). Changed it to use $@ till Tflops fixes it.
+
+ if [ "`uname -s`" = "TFLOPS O/S" ]; then
+ $RUNSERIAL $TOOL_BIN $@
+ else
+ $RUNSERIAL $TOOL_BIN "$@"
+ fi
+
+ RET=$?
+ if [ $RET != 0 ] ; then
+ echo "*FAILED*"
+ nerrors="`expr $nerrors + 1`"
+ else
+ echo " PASSED"
+ fi
+}
+
+
+
+##############################################################################
+# The tests
+# To avoid the printing of the complete full path of the test file, that hides
+# all the other parameters for long paths, the printing of the command line
+# is done first in
+# TESTING with the name only of the test file $TOOL, not its full path $TESTFILE
+##############################################################################
+
+
+# Test for traversing the file and export all images/datasets to jpeg
+TESTING $TOOL $SRCFILE myjpeg
+TOOLTEST $TESTFILE myjpeg
+
+
+
+if test $nerrors -eq 0 ; then
+ echo "All $TOOL tests passed."
+fi
+
+exit $nerrors
+
diff --git a/tools/testfiles/h52jpegtst.h5 b/tools/testfiles/h52jpegtst.h5
new file mode 100644
index 0000000..39bded7
--- /dev/null
+++ b/tools/testfiles/h52jpegtst.h5
Binary files differ