summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorElena Pourmal <epourmal@hdfgroup.org>2006-06-21 21:41:30 (GMT)
committerElena Pourmal <epourmal@hdfgroup.org>2006-06-21 21:41:30 (GMT)
commit9884f217002ef2f84dd14198c0e2105d72ac05ba (patch)
tree65eaa5f86865544a94b020d49113497482c5b829
parentb634cbbcc42f8107bbd781ebaefb432847cf74e8 (diff)
downloadhdf5-9884f217002ef2f84dd14198c0e2105d72ac05ba.zip
hdf5-9884f217002ef2f84dd14198c0e2105d72ac05ba.tar.gz
hdf5-9884f217002ef2f84dd14198c0e2105d72ac05ba.tar.bz2
[svn-r12429] Purpose: Alpha Open VMS port
Description: Added a command file for testing tools; it has a framework to do exactly (almost) what UNIX tools test scripts do: - run test tool and save output - compare output with expected result - figure out the difference and - print PASSED /*FAILED* in a manner similar to the UNIX output It needs to be populated with more tests and reused for other tools. Solution: Platforms tested: VMS server Misc. update:
-rw-r--r--MANIFEST1
-rw-r--r--vms/tools/h5dump/check_h5dump.com75
2 files changed, 76 insertions, 0 deletions
diff --git a/MANIFEST b/MANIFEST
index fbfd2ea..48f5709 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -1421,6 +1421,7 @@
./vms/make.com
./vms/tools/h5dump/make.com
./vms/tools/h5dump/check.com
+./vms/tools/h5dump/check_h5dump.com
./vms/tools/h5ls/check.com
./vms/tools/h5ls/make.com
./vms/tools/h5diff/check.com
diff --git a/vms/tools/h5dump/check_h5dump.com b/vms/tools/h5dump/check_h5dump.com
new file mode 100644
index 0000000..99d2c77
--- /dev/null
+++ b/vms/tools/h5dump/check_h5dump.com
@@ -0,0 +1,75 @@
+$ !
+$ ! This command file tests h5dump utility. The command file has to
+$ ! run in the [hdf5-top.tools.testfiles] directory.
+$ !
+$ !
+$ ! Define h5dump symbol
+$ !
+$ current_dir = F$DIRECTRY()
+$ len = F$LENGTH(current_dir)
+$ temp = F$EXTRACT(0, len-10, current_dir)
+$ h5dump_dir = temp + "H5DUMP]"
+$ h5dump :== $sys$disk:'h5dump_dir'h5dump.exe
+$ !
+$ ! Define output for diff command that compares expected and actual
+$ ! outputs of h5dump
+$ !
+$ create h5dump.log
+$ !
+$ ! h5dump tests
+$ !
+$ CALL TOOLTEST tgroup-1.ddl "tgroup.h5"
+$ ! CALL TOOLTEST tgroup-x.ddl "tgroup.h5"
+$
+$
+$TOOLTEST: SUBROUTINE
+$
+$ len = F$LENGTH(P1)
+$ base = F$EXTRACT(0,len-3,P1)
+$ actual = base + "out"
+$
+$ begin = "Testing h5dump "
+$ !
+$ ! Run the test and save output in the 'actual' file
+$ !
+$ define sys$output 'actual'
+$ write sys$output "#############################"
+$ write sys$output "Expected output for 'h5dump ''P2''"
+$ write sys$output "#############################"
+$ h5dump 'P2
+$ deassign sys$output
+$ !
+$ ! Compare the results
+$ !
+$ diff/output=h5dump_temp 'actual' 'P1'
+$ open/read temp_out h5dump_temp.dif
+$ read temp_out record1
+$ close temp_out
+$ !
+$ ! Extract error code and format output line
+$ !
+$ len = F$LENGTH(record1)
+$ err_code = F$EXTRACT(len-1,1,record1)
+$ if err_code .eqs. "0"
+$ then
+$ result = "PASSED"
+$ line = F$FAO("!15AS !50AS !70AS", begin, P1, result)
+$ else
+$ result = "*FAILED*"
+$ line = F$FAO("!15AS !49AS !69AS", begin, P1, result)
+$ endif
+$ !
+$ ! Print test result
+$ !
+$ write sys$output line
+$ !
+$ ! Append the result to the log file
+$ !
+$ append h5dump_temp.dif h5dump.log
+$ !
+$ ! Delete temporary files
+$ !
+$ del *.out;*
+$ !
+$ENDSUBROUTINE
+