summaryrefslogtreecommitdiffstats
path: root/tools/h52jpeg/h52jpeg.sh
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/h52jpeg/h52jpeg.sh
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/h52jpeg/h52jpeg.sh')
-rw-r--r--tools/h52jpeg/h52jpeg.sh91
1 files changed, 91 insertions, 0 deletions
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
+