diff options
author | Elena Pourmal <epourmal@hdfgroup.org> | 2006-08-02 19:08:09 (GMT) |
---|---|---|
committer | Elena Pourmal <epourmal@hdfgroup.org> | 2006-08-02 19:08:09 (GMT) |
commit | 71a4d0e9c48c4e02e5384cd3f6e38a2a530e9d22 (patch) | |
tree | 9213f695c2ccdd44d4e19233a1f4ed1ff7b048d8 /vms | |
parent | c951c2783053bcac690a815d7dda1e2f122e3031 (diff) | |
download | hdf5-71a4d0e9c48c4e02e5384cd3f6e38a2a530e9d22.zip hdf5-71a4d0e9c48c4e02e5384cd3f6e38a2a530e9d22.tar.gz hdf5-71a4d0e9c48c4e02e5384cd3f6e38a2a530e9d22.tar.bz2 |
[svn-r12526] Description:
Added test script to test h5import tool; added new source file
to the make.com file in the src directory.
Platforms tested:
Only h5import was tested on the VMS server
Diffstat (limited to 'vms')
-rw-r--r-- | vms/src/make.com | 2 | ||||
-rw-r--r-- | vms/tools/h5import/check_h5import.com | 171 |
2 files changed, 172 insertions, 1 deletions
diff --git a/vms/src/make.com b/vms/src/make.com index f370462..7aa239e 100644 --- a/vms/src/make.com +++ b/vms/src/make.com @@ -35,7 +35,7 @@ $ cobj= "H5, H5A, H5AC, H5B, H5B2, H5B2cache,"+- "H5FDfamily, H5FDlog, H5FDmpi, H5FDmpio,"+- "H5FDmpiposix, H5FDmulti, H5FDsec2, H5FDstdio,"+- "H5FDstream, H5FL, H5FO,"+- - "H5FS, H5FScache, H5FSdbg,"+- + "H5FS, H5FScache, H5FSdbg, H5FSsection"+- "H5G, H5Gdeprec, H5Gent, H5Glink, H5Gloc, H5Gname, H5Gnode, H5Gstab,"+- "H5Gobj, H5Goh, H5Gtest, H5Gtraverse,"+- "H5HF, H5HFcache, H5HFdbg, H5HFint, H5HFtest, H5HFstat,"+- diff --git a/vms/tools/h5import/check_h5import.com b/vms/tools/h5import/check_h5import.com new file mode 100644 index 0000000..8387dd2 --- /dev/null +++ b/vms/tools/h5import/check_h5import.com @@ -0,0 +1,171 @@ +$ ! +$ ! This command file tests h5import utility. The command file has to +$ ! run in the [hdf5-top.tools.h5import.testfiles] directory. +$ ! +$ ! +$ ! Define symbols +$ ! +$ current_dir = F$DIRECTRY() +$ len = F$LENGTH(current_dir) +$ temp = F$EXTRACT(0, len-19, current_dir) +$ h5dump_dir = temp + "H5DUMP]" +$ h5dump :== $sys$disk:'h5dump_dir'h5dump.exe +$ h5import_dir = temp + "H5IMPORT]" +$ h5import :== $sys$disk:'h5import_dir'h5import.exe +$ h5importtest :== $sys$disk:'h5import_dir'h5importtest.exe +$ ! +$ ! Define output for diff command that compares expected and actual +$ ! outputs of h5dump +$ ! +$ create h5dump.log +$ ! +$ ! h5import tests +$ ! +$ ! Run h5importtest to create input files +$ ! +$ h5importtest +$ CALL TOOLTEST "ASCII I32 rank 3 - Output BE " - + "txtin32 -c textin32 -o" test1.h5 +$ ! +$ CALL TOOLTEST "ASCII I16 rank 3 - Output LE - CHUNKED - extended" - + "txtin16 -c textin16 -o" test2.h5 +$ ! +$ CALL TOOLTEST - + "ASCII I8 - rank 3 - Output I16 LE-Chunked+Extended+Compressed " - + "txtin16 -c textin8 -o" test3.h5 +$ ! +$ CALL TOOLTEST "ASCII UI32 - rank 3 - Output BE " - + "in1 -c textuin32 -o" test4.h5 +$ ! +$ CALL TOOLTEST "ASCII UI16 - rank 2 - Output LE+Chunked+Compressed " - + "in1 -c textuin16 -o" test5.h5 +$ ! +$ CALL TOOLTEST "ASCII F32 - rank 3 - Output LE " - + "fp1 -c textfp32 -o" test6.h5 +$ ! +$ CALL TOOLTEST - + "ASCII F64 - rank 3 - Output BE + CHUNKED+Extended+Compressed " - + "fp2 -c textfp64 -o" test7.h5 +$ ! +$ CALL TOOLTEST - + "BINARY F64 - rank 3 - Output LE+CHUNKED+Extended+Compressed " - + "bfp64 -c conbfp64 -o" test8.h5 +$ ! +$ CALL TOOLTEST "BINARY I16 - rank 3 - Output order LE + CHUNKED + extended " - + "bin16 -c conbin16 -o" test9.h5 +$ ! +$ CALL TOOLTEST - + "BINARY I8 - rank 3 - Output I16LE + Chunked+Extended+Compressed " - + "bin8 -c conbin8 -o" test10.h5 +$ ! +$ CALL TOOLTEST "BINARY I32 - rank 3 - Output BE + CHUNKED " - + "bin32 -c conbin32 -o" test11.h5 +$ ! +$ CALL TOOLTEST "BINARY UI16 - rank 3 - Output byte BE + CHUNKED " - + "buin16 -c conbuin16 -o" test12.h5 +$ ! +$ CALL TOOLTEST "BINARY UI32 - rank 3 - Output LE + CHUNKED " - + "buin32 -c conbuin32 -o" test13.h5 +$ +$ +$ +$TOOLTEST: SUBROUTINE +$ +$ len = F$LENGTH(P3) +$ base = F$EXTRACT(0,len-3,P3) +$ actual = base + "out.h5" +$ actual_dump = base + "out.txt" +$ actual_dump_err = base + "out.err" +$ expected_dump = base + ".txt" +$ expected_dump_err = base + ".err" +$ +$ begin = "Testing" +$ ! +$ ! Run h5import with output in the 'actual' file +$ ! +$ ON ERROR THEN CONTINUE +$ h5import 'P2 'actual' +$ define/nolog sys$output 'actual_dump' +$ define/nolog sys$error 'actual_dump_err' +$ ! +$ ! Dump the actual and expected files +$ ! +$ h5dump 'actual' +$ deassign sys$output +$ deassign sys$error +$ if F$SEARCH(actual_dump_err) .NES. "" +$ then +$ set message/notext/nofacility/noidentification/noseverity +$ append 'actual_dump_err' 'actual_dump' +$ set message/ntext/facility/identification/severity +$ endif +$ define/nolog sys$output 'expected_dump' +$ define/nolog sys$error 'expected_dump_err' +$ h5dump 'P3 +$ deassign sys$output +$ deassign sys$error +$ if F$SEARCH(expected_dump_err) .NES. "" +$ then +$ set message/notext/nofacility/noidentification/noseverity +$ append 'expected_dump_err' 'expected_dump' +$ set message/ntext/facility/identification/severity +$ endif +$ ! +$ ! Compare the results +$ ! +$ diff/output=h5dump_temp/ignore=(spacing,trailing_spaces,blank_lines)- + 'actual_dump' - + 'expected_dump' +$ open/read temp_out h5dump_temp.dif +$ ! +$READ_DATA: +$ read/end_of_file=end_read temp_out record1 +$ ! +$ ! Skip blank lines +$ ! +$ if record1 .EQS. "" then goto READ_DATA +$ ! +$ ! Find record with "Number" and exit the loop +$ ! +$ len = F$LENGTH(record1) +$ pos = F$LOCATE("Number", record1) +$ ! +$ if pos .EQ. 0 +$ then +$ err_code = F$EXTRACT(len-1,1,record1) +$ goto END_READ +$ endif +$ ! +$ goto READ_DATA +$ +$ ! +$END_READ: +$ close temp_out +$ ! +$ ! File names are different, so we allow only one difference +$ ! in h5dump +$ if err_code .eqs. "1" +$ then +$ result = "PASSED" +$ line = F$FAO("!8AS !62AS !80AS", begin, P1, result) +$ else +$ result = "*FAILED*" +$ line = F$FAO("!8AS !61AS !79AS", 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 +$ if F$SEARCH("*out.h5;*") then del *out.h5;* +$ if F$SEARCH("*.dif;*") then del *.dif;* +$ if F$SEARCH("*.err;*") then del *.err;* +$ ! +$ ! +$ENDSUBROUTINE + |