summaryrefslogtreecommitdiffstats
path: root/c++/examples/testexamples.sh
diff options
context:
space:
mode:
authorBill Wendling <wendling@ncsa.uiuc.edu>2000-12-08 16:15:00 (GMT)
committerBill Wendling <wendling@ncsa.uiuc.edu>2000-12-08 16:15:00 (GMT)
commit4aab9c01dfb21f8aa6ee926ac7f13b9f2a5f7ff6 (patch)
tree4a746e8f631925353ab42686a7f06a75cfcdb38c /c++/examples/testexamples.sh
parent7548217cb4d404ea20dea76e8b0aeae799bfda20 (diff)
downloadhdf5-4aab9c01dfb21f8aa6ee926ac7f13b9f2a5f7ff6.zip
hdf5-4aab9c01dfb21f8aa6ee926ac7f13b9f2a5f7ff6.tar.gz
hdf5-4aab9c01dfb21f8aa6ee926ac7f13b9f2a5f7ff6.tar.bz2
[svn-r3097] Purpose:
Add Description: Adding a small amount of testing to the C++ library until "real" testing can be created. (We use the examples). Platforms tested: Linux
Diffstat (limited to 'c++/examples/testexamples.sh')
-rwxr-xr-xc++/examples/testexamples.sh55
1 files changed, 55 insertions, 0 deletions
diff --git a/c++/examples/testexamples.sh b/c++/examples/testexamples.sh
new file mode 100755
index 0000000..54141c0
--- /dev/null
+++ b/c++/examples/testexamples.sh
@@ -0,0 +1,55 @@
+#!/bin/sh
+
+CMP='cmp -s'
+DIFF='diff -c'
+
+nerrors=0
+verbose=yes
+
+actual=sample.out
+expect=expected.out
+
+# 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'
+}
+
+TESTING C++ Examples
+
+(
+ ./create
+ ./readdata
+ ./writedata
+ ./compound
+ ./extend_ds
+ ./chunks
+ ./h5group
+) > $actual
+
+if $CMP $expect $actual; then
+ echo " PASSED"
+else
+ echo "*FAILED*"
+ echo " Expected result differs from actual result"
+ nerrors="`expr $nerrors + 1`"
+ test yes = "$verbose" && $DIFF $expect $actual | sed 's/^/ /'
+fi
+
+# Clean up output file
+if test -z "$HDF5_NOCLEANUP"; then
+ rm -f $actual
+fi
+
+if test $nerrors -eq 0 ; then
+ echo "All tests passed."
+fi
+
+exit $nerrors