1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
|
#! /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 COPYING file, which can be found at the root of the source code
# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.
#
# Tests for the h5dump tool
# Assume we are on a little-endian system
WORDS_BIGENDIAN="no"
TESTNAME=h5dump
EXIT_SUCCESS=0
EXIT_FAILURE=1
H5DUMP=h5dump # The h5dump tool name
H5DELETE='h5delete -f' # The h5delete tool name
H5REPACK=h5repack # The h5repack tool name
RM='rm -rf'
CMP='cmp'
DIFF='diff -c'
GREP='grep'
CP='cp'
DIRNAME='dirname'
LS='ls'
AWK='awk'
nerrors=0
verbose=yes
######################################################################
# Input files
# --------------------------------------------------------------------
# Where the tool's HDF5 input files are located
TESTFILES_HDF5_DIR="./testfiles/hdf5"
# Where the tool's expected output files are located
H5DUMP_TESTFILES_OUT_DIR="./testfiles/expected/h5dump"
######################################################################
# Output files
# --------------------------------------------------------------------
# Where the text output goes
TEXT_OUTPUT_DIR=./h5dump_test_output
# Where the repacked HDF5 input files go
REPACK_OUTPUT_DIR=./h5dump_repack_output
######################################################################
# test files
# --------------------------------------------------------------------
# HDF5 test files.
#
# Kept in $H5REPACK_TESTFILES_HDF5_DIR
# Repacked to $REPACK_OUTPUT_DIR
#
# These files fail to repack w/ native VOL (investigate later)
# tall.h5
# tattrreg.h5 <-- This one does not even cause h5repack to fail!
# tbigdims.h5 (repack hangs w/ passthru VOL)
# err_attr_dspace.h5
# tfcontents1.h5
# tfcontents2.h5
#
# These files have native-specific content
# tfamily00000.h5
# tfamily00001.h5
# tfamily00002.h5
# tfamily00003.h5
# tfamily00004.h5
# tfamily00005.h5
# tfamily00006.h5
# tfamily00007.h5
# tfamily00008.h5
# tfamily00009.h5
# tfamily00010.h5
# tfilters.h5
# filter_fail.h5 (can't be repacked w/o missing filter)
# tgrp_comments.h5
# tmulti-b.h5
# tmulti-g.h5
# tmulti-l.h5
# tmulti-o.h5
# tmulti-r.h5
# tmulti-s.h5
# tsplit_file-m.h5
# tsplit_file-r.h5
#
# Link files require an h5repack H5Lcopy work-around
# textlink.h5
# textlinksrc.h5
# textlinktar.h5
# tslink.h5
# tsoftlinks.h5
# tudlink.h5
#
# These files have problems with DAOS, usually due to old-school references
# tarray1_big.h5
# tattr2.h5
# tdatareg.h5
# thlink.h5 This appears to have a cycle that causes an eventual segfault.
# tloop.h5 Ditto on the cycle problem
# torderattr.h5
# tordergr.h5
# tnestedcmpddt.h5 Basically identical output, but type description text differs enough to trigger a problem
# tvlstr.h5 As above
HDF5_FILES="
h5copytst.h5
charsets.h5
file_space.h5
packedbits.h5
t128bit_float.h5
taindices.h5
tarray1.h5
tarray2.h5
tarray3.h5
tarray4.h5
tarray5.h5
tarray6.h5
tarray7.h5
tarray8.h5
tattr4_be.h5
tattr.h5
tattrintsize.h5
tbinary.h5
tbitnopaque.h5
tchar.h5
tcmpdattrintsize.h5
tcmpdintsize.h5
tcompound_complex2.h5
tcompound_complex.h5
tcompound.h5
tdset.h5
tempty.h5
tfpformat.h5
tfvalues.h5
tgroup.h5
tgrp_comments.h5
tgrpnullspace.h5
thyperslab.h5
tints4dims.h5
tintsattrs.h5
tlarge_objname.h5
tldouble.h5
tnamed_dtype_attr.h5
tnestedcomp.h5
tno-subset.h5
tnullspace.h5
tsaf.h5
tscalarattrintsize.h5
tscalarintattrsize.h5
tscalarintsize.h5
tscalarstring.h5
tstr2.h5
tstr3.h5
tstr.h5
tvldtypes1.h5
tvldtypes2.h5
tvldtypes3.h5
tvldtypes4.h5
tvldtypes5.h5
tvlenstr_array.h5
tvms.h5
zerodim.h5
"
# Expected output files.
#
# Kept in $H5DUMP_TESTFILES_OUT_DIR
# Copied to $TEXT_OUTPUT_DIR
#
# NOTE: This is ALL the files - they have not been culled based on the HDF5
# files in the above list.
#
EXPECTED_OUTPUT_FILES="
charsets.ddl
err_attr_dspace.ddl
file_space.ddl
filter_fail.ddl
filter_fail.err
h5dump-help.txt
non_existing.ddl
non_existing.err
out3.h5import
packedbits.ddl
tall-1.ddl
tall-1.err
tall-2A0.ddl
tall-2A0.err
tall-2A.ddl
tall-2A.err
tall-2B.ddl
tall-2B.err
tall-2.ddl
tall-3.ddl
tall-4s.ddl
tall-5s.ddl
tall-6.ddl
tall-6.exp
tall-7.ddl
tall-7N.ddl
tallfilters.ddl
tarray1_big.ddl
tarray1_big.err
tarray1.ddl
tarray2.ddl
tarray3.ddl
tarray4.ddl
tarray5.ddl
tarray6.ddl
tarray7.ddl
tarray8.ddl
tattr-1.ddl
tattr-2.ddl
tattr-3.ddl
tattr-3.err
tattr-4_be.ddl
tattrcontents1.ddl
tattrcontents2.ddl
tattrintsize.ddl
tattrreg.ddl
tattrregR.ddl
tattrregR.err
tbigdims.ddl
tbin1.ddl
tbin1.ddl
tbin2.ddl
tbin3.ddl
tbin4.ddl
tbinregR.ddl
tbinregR.exp
tbitnopaque_be.ddl
tbitnopaque_le.ddl
tboot1.ddl
tboot2A.ddl
tboot2B.ddl
tboot2.ddl
tchar1.ddl
tchunked.ddl
tcmpdattrintsize.ddl
tcmpdintsize.ddl
tcomp-1.ddl
tcomp-2.ddl
tcomp-3.ddl
tcomp-3.err
tcomp-4.ddl
tcompact.ddl
tcompound_complex2.ddl
tcontents.ddl
tcontiguos.ddl
tdatareg.ddl
tdataregR.ddl
tdataregR.err
tdeflate.ddl
tdset-1.ddl
tdset-2.ddl
tdset-2.err
tdset-3s.ddl
tempty.ddl
texceedsubblock.ddl
texceedsubblock.err
texceedsubcount.ddl
texceedsubcount.err
texceedsubstart.ddl
texceedsubstart.err
texceedsubstride.ddl
texceedsubstride.err
texternal.ddl
textlink.ddl
textlink.err
textlinkfar.ddl
textlinkfar.err
textlinksrc.ddl
textlinksrc.err
tfamily.ddl
tfill.ddl
tfletcher32.ddl
tfpformat.ddl
tgroup-1.ddl
tgroup-2.ddl
tgroup-2.err
tgrp_comments.ddl
tgrpnullspace.ddl
thlink-1.ddl
thlink-2.ddl
thlink-3.ddl
thlink-4.ddl
thlink-5.ddl
thyperslab.ddl
tindicesno.ddl
tindicessub1.ddl
tindicessub2.ddl
tindicessub3.ddl
tindicessub4.ddl
tindicesyes.ddl
tints4dimsBlock2.ddl
tints4dimsBlockEq.ddl
tints4dimsCount2.ddl
tints4dimsCountEq.ddl
tints4dims.ddl
tints4dimsStride2.ddl
tintsattrs.ddl
tlarge_objname.ddl
tlonglinks.ddl
tloop-1.ddl
tmulti.ddl
tmultifile.ddl
tnamed_dtype_attr.ddl
tnbit.ddl
tnestcomp-1.ddl
tnestedcmpddt.ddl
tnoattrdata.ddl
tnoattrddl.ddl
tnodata.ddl
tnoddl.ddl
tnoddlfile.ddl
tnoddlfile.exp
tno-subset.ddl
tnullspace.ddl
torderattr1.ddl
torderattr2.ddl
torderattr3.ddl
torderattr4.ddl
tordercontents1.ddl
tordercontents2.ddl
tordergr1.ddl
tordergr2.ddl
tordergr3.ddl
tordergr4.ddl
tordergr5.ddl
torderlinks1.ddl
torderlinks1.err
torderlinks2.ddl
torderlinks2.err
tperror.ddl
tperror.err
tqmarkfile.ddl
tqmarkfile.err
trawdatafile.ddl
trawdatafile.exp
trawssetfile.ddl
trawssetfile.exp
treadfilter.ddl
treadintfilter.ddl
treference.ddl
tsaf.ddl
tscalarattrintsize.ddl
tscalarintattrsize.ddl
tscalarintsize.ddl
tscalarstring.ddl
tscaleoffset.ddl
tshuffle.ddl
tslink-1.ddl
tslink-2.ddl
tslink-D.ddl
tslink-D.err
tsplit_file.ddl
tstarfile.ddl
tstr-1.ddl
tstr2bin2.exp
tstr2bin6.exp
tstr-2.ddl
tstring2.ddl
tstring.ddl
tstringe.ddl
tszip.ddl
tudlink-1.ddl
tudlink-2.ddl
tuserfilter.ddl
tvldtypes1.ddl
tvldtypes2.ddl
tvldtypes3.ddl
tvldtypes4.ddl
tvldtypes5.ddl
tvlenstr_array.ddl
tvlstr.ddl
tvms.ddl
twidedisplay.ddl
twithddl.exp
twithddlfile.ddl
twithddlfile.exp
zerodim.ddl
"
######################################################################
# Utility functions
# --------------------------------------------------------------------
# Copy the expected text output files to the text output directory
# to make it easier to diff the expected and actual output.
#
COPY_EXPECTED_OUTPUT_FILES()
{
for outfile in $EXPECTED_OUTPUT_FILES
do
filepath="$H5DUMP_TESTFILES_OUT_DIR/$outfile"
# Use -f to make sure get a new copy
$CP -f $filepath $TEXT_OUTPUT_DIR
if [ $? -ne 0 ]; then
echo "Error: FAILED to copy expected output file: $filepath ."
fi
done
}
# Repack the HDF5 files to the repack directory.
#
REPACK_HDF5_FILES()
{
for repackfile in $HDF5_FILES
do
inpath="$TESTFILES_HDF5_DIR/$repackfile"
outpath="$REPACK_OUTPUT_DIR/$repackfile"
# Repack the file
$H5REPACK --src-vol-name=native --enable-error-stack $inpath $outpath
if [ $? -ne 0 ]; then
echo "Error: FAILED to repack HDF5 file: $inpath ."
fi
done
}
# Cleans up HDF5 and text output from the tests. Only cleans if the
# HDF5_NOCLEANUP variable is unset.
#
CLEAN_OUTPUT()
{
# Remove output if the "no cleanup" environment variable is not defined
if test -z "$HDF5_NOCLEANUP"; then
# Text output
$RM $TEXT_OUTPUT_DIR
# HDF5 output
#
# Can't just rm -rf the directory if the VOL storage doesn't map to
# a normal file, so we'll use h5delete to delete the file.
for hdf5file in $HDF5_FILES
do
filepath="$REPACK_OUTPUT_DIR/$hdf5file"
$H5DELETE $filepath
done
# The HDF5 output directory is always created, even if the VOL
# storage won't use it. Delete it here.
$RM $REPACK_OUTPUT_DIR
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'
}
# Source in the output filter function definitions.
. ./output_filter.sh
######################################################################
# Main testing functions
# --------------------------------------------------------------------
# Run a test and print PASS or *FAIL*. If a test fails then increment
# the `nerrors' global variable and (if $verbose is set) display the
# difference between the actual output and the expected output. The
# expected output is given as the first argument to this function and
# the actual output file is calculated by replacing the `.ddl' with
# `.out'. The actual output is not removed if $HDF5_NOCLEANUP has a
# non-zero value.
# If $1 == ignorecase then do caseless CMP and DIFF.
# ADD_H5_TEST
RUNTEST() {
# check if caseless compare and diff requested
if [ "$1" = ignorecase ]; then
caseless="-i"
# replace cmp with diff which runs much longer.
xCMP="$DIFF -i"
shift
else
caseless=""
# stick with faster cmp if ignorecase is not requested.
xCMP="$CMP"
fi
expect="$TEXT_OUTPUT_DIR/$1"
actual="$TEXT_OUTPUT_DIR/`basename $1 .ddl`.out"
actual_err="$TEXT_OUTPUT_DIR/`basename $1 .ddl`.err"
actual_sav=${actual}-sav
actual_err_sav=${actual_err}-sav
shift
# Run test.
TESTING $H5DUMP $@
(
$RUNSERIAL $H5DUMP "$@"
) >$actual 2>$actual_err
# save actual and actual_err in case they are needed later.
cp $actual $actual_sav
STDOUT_FILTER $actual
cp $actual_err $actual_err_sav
STDERR_FILTER $actual_err
# Clean h5dump stdout files
H5DUMP_FILTER $actual
# Strip the HDF5 output directory name from the output file
# (use | to avoid sed and directory delimiter clash)
cp $actual $tmp_file
sed "s|$REPACK_OUTPUT_DIR/||" < $tmp_file > $actual
if [ ! -f $expect ]; then
# Create the expect file if it doesn't yet exist.
echo " CREATED"
cp $actual $expect
echo " Expected result (*.ddl) missing"
nerrors="`expr $nerrors + 1`"
elif $xCMP $expect $actual > /dev/null 2>&1 ; then
echo " PASSED"
else
echo "*FAILED*"
echo " Expected result (*.ddl) differs from actual result (*.out)"
nerrors="`expr $nerrors + 1`"
test yes = "$verbose" && $DIFF $caseless $expect $actual |sed 's/^/ /'
fi
}
# same as RUNTEST but compares generated file to expected output
# and compares the generated data file to the expected data file
# used for the binary tests that expect a full path in -o without -b
# ADD_H5_EXPORT_TEST
RUNTEST2() {
expectdata="$TEXT_OUTPUT_DIR/$1"
expect="$TEXT_OUTPUT_DIR/`basename $1 .exp`.ddl"
actualdata="$TEXT_OUTPUT_DIR/`basename $1 .exp`.txt"
actual="$TEXT_OUTPUT_DIR/`basename $1 .exp`.out"
actual_err="$TEXT_OUTPUT_DIR/`basename $1 .exp`.err"
shift
# Run test.
TESTING $H5DUMP $@
(
$RUNSERIAL $H5DUMP "$@"
) >$actual 2>$actual_err
# Strip the HDF5 output directory name from the output file
# (use | to avoid sed and directory delimiter clash)
cp $actual $tmp_file
sed "s|$REPACK_OUTPUT_DIR/||" < $tmp_file > $actual
if [ ! -f $expect ]; then
# Create the expect file if it doesn't yet exist.
echo " CREATED"
$CP $actual $expect
echo " Expected result (*.ddl) missing"
nerrors="`expr $nerrors + 1`"
elif $CMP $expect $actual; then
if [ ! -f $expectdata ]; then
# Create the expect data file if it doesn't yet exist.
echo " CREATED"
$CP $actualdata $expectdata
echo " Expected data (*.exp) missing"
nerrors="`expr $nerrors + 1`"
elif $CMP $expectdata $actualdata; then
echo " PASSED"
else
echo "*FAILED*"
echo " Expected datafile (*.exp) differs from actual datafile (*.txt)"
nerrors="`expr $nerrors + 1`"
test yes = "$verbose" && $DIFF $expectdata $actualdata |sed 's/^/ /'
fi
else
echo "*FAILED*"
echo " Expected result (*.ddl) differs from actual result (*.out)"
nerrors="`expr $nerrors + 1`"
test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /'
fi
}
# same as RUNTEST2 but compares generated file to expected ddl file
# and compares the generated data file to the expected data file
# used for the binary tests that expect a full path in -o without -b
# ADD_H5_TEST_EXPORT
RUNTEST2A() {
expectdata="$TEXT_OUTPUT_DIR/$1"
expect="$TEXT_OUTPUT_DIR/`basename $1 .exp`.ddl"
actualdata="$TEXT_OUTPUT_DIR/`basename $1 .exp`.txt"
actual="$TEXT_OUTPUT_DIR/`basename $1 .exp`.out"
actual_err="$TEXT_OUTPUT_DIR/`basename $1 .exp`.err"
shift
expectmeta="$TEXT_OUTPUT_DIR/$1"
actualmeta="$TEXT_OUTPUT_DIR/`basename $1 .exp`.txt"
shift
# Run test.
TESTING $H5DUMP $@
(
$RUNSERIAL $H5DUMP "$@"
) >$actual 2>$actual_err
# Strip the HDF5 output directory name from the output file
# (use | to avoid sed and directory delimiter clash)
cp $actual $tmp_file
sed "s|$REPACK_OUTPUT_DIR/||" < $tmp_file > $actual
cp $actualdata $tmp_file
sed "s|$REPACK_OUTPUT_DIR/||" < $tmp_file > $actualdata
cp $actualmeta $tmp_file
sed "s|$REPACK_OUTPUT_DIR/||" < $tmp_file > $actualmeta
if [ ! -f $expect ]; then
# Create the expect file if it doesn't yet exist.
echo " CREATED"
cp $actual $expect
echo " Expected result (*.ddl) missing"
nerrors="`expr $nerrors + 1`"
elif $CMP $expect $actual; then
if [ ! -f $expectdata ]; then
# Create the expect data file if it doesn't yet exist.
echo " CREATED"
cp $actualdata $expectdata
echo " Expected data (*.exp) missing"
nerrors="`expr $nerrors + 1`"
elif $DIFF $expectdata $actualdata; then
if [ ! -f $expectmeta ]; then
# Create the expect meta file if it doesn't yet exist.
echo " CREATED"
cp $actualmeta $expectmeta
echo " Expected metafile (*.ddl) missing"
nerrors="`expr $nerrors + 1`"
elif $CMP $expectmeta $actualmeta; then
echo " PASSED"
else
echo "*FAILED*"
echo " Expected metafile (*.ddl) differs from actual metafile (*.txt)"
nerrors="`expr $nerrors + 1`"
test yes = "$verbose" && $DIFF $expectmeta $actualmeta |sed 's/^/ /'
fi
else
echo "*FAILED*"
echo " Expected datafile (*.exp) differs from actual datafile (*.txt)"
nerrors="`expr $nerrors + 1`"
test yes = "$verbose" && $DIFF $expectdata $actualdata |sed 's/^/ /'
fi
else
echo "*FAILED*"
echo " Expected result (*.ddl) differs from actual result (*.out)"
nerrors="`expr $nerrors + 1`"
test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /'
fi
}
# same as RUNTEST2 but only compares the generated data file to the expected data file
# used for the binary tests that expect a full path in -o with -b
# ADD_H5_EXPORT_TEST
RUNTEST2B() {
expectdata="$TEXT_OUTPUT_DIR/$1"
actualdata="$TEXT_OUTPUT_DIR/`basename $1 .exp`.txt"
actual="$TEXT_OUTPUT_DIR/`basename $1 .exp`.out"
actual_err="$TEXT_OUTPUT_DIR/`basename $1 .exp`.err"
shift
# Run test.
TESTING $H5DUMP $@
(
$RUNSERIAL $H5DUMP "$@"
) >$actual 2>$actual_err
# Strip the HDF5 output directory name from the output file
# (use | to avoid sed and directory delimiter clash)
cp $actual $tmp_file
sed "s|$REPACK_OUTPUT_DIR/||" < $tmp_file > $actual
if [ ! -f $expectdata ]; then
# Create the expect data file if it doesn't yet exist.
echo " CREATED"
cp $actualdata $expectdata
echo " Expected data (*.exp) missing"
nerrors="`expr $nerrors + 1`"
elif $CMP $expectdata $actualdata; then
echo " PASSED"
else
echo "*FAILED*"
echo " Expected datafile (*.exp) differs from actual datafile (*.txt)"
nerrors="`expr $nerrors + 1`"
test yes = "$verbose" && $DIFF $expectdata $actualdata |sed 's/^/ /'
fi
}
RUNTEST_HELP() {
expect="$TEXT_OUTPUT_DIR/$1"
actual="$TEXT_OUTPUT_DIR/`basename $1 .txt`.out"
actual_err="$TEXT_OUTPUT_DIR/`basename $1 .txt`.err"
shift
# Run test.
TESTING $H5DUMP $@
(
$RUNSERIAL $H5DUMP "$@"
) >$actual 2>$actual_err
if [ ! -f $expectdata ]; then
# Create the expect data file if it doesn't yet exist.
echo " CREATED"
cp $actual $expect-CREATED
echo " Expected output (*.txt) missing"
nerrors="`expr $nerrors + 1`"
elif $CMP $expect $actual; then
echo " PASSED"
else
echo "*FAILED*"
echo " Expected output (*.txt) differs from actual output (*.out)"
nerrors="`expr $nerrors + 1`"
fi
}
# Call the h5dump tool and grep for a value
# txttype ERRTXT greps test error output, otherwise greps test output
RUNTEST_GREP()
{
txttype=$1
expectdata=$2
actual=$TEXT_OUTPUT_DIR/$3
actual_err="$TEXT_OUTPUT_DIR/`basename $3 .ddl`.oerr"
shift
shift
shift
# Run test.
TESTING $H5DUMP -p $@
(
$ENVCMD $RUNSERIAL $H5DUMP -p "$@"
) >$actual 2>$actual_err
if [ "$txttype" = "ERRTXT" ]; then
$GREP "$expectdata" $actual_err > /dev/null
else
$GREP "$expectdata" $actual > /dev/null
fi
if [ $? -eq 0 ]; then
echo " PASSED"
else
echo " FAILED"
nerrors="`expr $nerrors + 1`"
fi
}
# Call the h5dump tool and grep for a value but disables plugin filter loading
# txttype ERRTXT greps test error output, otherwise greps test output
RUNTEST_GREP2()
{
txttype=$1
expectdata=$2
actual=$TEXT_OUTPUT_DIR/$3
actual_err="$TEXT_OUTPUT_DIR/`basename $3 .ddl`.oerr"
shift
shift
shift
# Run test.
TESTING $H5DUMP -p $@
(
$ENVCMD $RUNSERIAL $H5DUMP -p "$@"
) >$actual 2>$actual_err
if [ "$txttype" = "ERRTXT" ]; then
$GREP "$expectdata" $actual_err > /dev/null
else
$GREP "$expectdata" $actual > /dev/null
fi
if [ $? -eq 0 ]; then
echo " PASSED"
else
echo " FAILED"
nerrors="`expr $nerrors + 1`"
fi
}
##############################################################################
##############################################################################
### T H E T E S T S ###
##############################################################################
##############################################################################
# Prepare for test
#
# We create the repack output dir in case it's needed. If a VOL connector doesn't
# use normal files, it'll just stay empty and get deleted later.
CLEAN_OUTPUT
test -d $TEXT_OUTPUT_DIR || mkdir -p $TEXT_OUTPUT_DIR
test -d $REPACK_OUTPUT_DIR || mkdir -p $REPACK_OUTPUT_DIR
COPY_EXPECTED_OUTPUT_FILES
REPACK_HDF5_FILES
# Run h5dump tests
#
# NOTE: In the official HDF5 library tools tests, the emitted error stack
# output is checked against canonical error stack output. This is too
# brittle to be done with arbitrary VOL connectors, so all of the tests
# which do that now solely test normal output.
#
# The tests are still run with --enable-error-stack, however, in case
# that helps with debugging issues.
# test the help syntax
RUNTEST_HELP h5dump-help.txt -h
# test data output redirection
RUNTEST tnoddl.ddl --enable-error-stack --ddl -y $REPACK_OUTPUT_DIR/packedbits.h5
RUNTEST tnodata.ddl --enable-error-stack --output $REPACK_OUTPUT_DIR/packedbits.h5
RUNTEST tnoattrddl.ddl --enable-error-stack -O -y $REPACK_OUTPUT_DIR/tattr.h5
RUNTEST tnoattrdata.ddl --enable-error-stack -A -o $REPACK_OUTPUT_DIR/tattr.h5
RUNTEST2 trawdatafile.exp --enable-error-stack -y -o $TEXT_OUTPUT_DIR/trawdatafile.txt $REPACK_OUTPUT_DIR/packedbits.h5
RUNTEST2 tnoddlfile.exp --enable-error-stack -O -y -o $TEXT_OUTPUT_DIR/tnoddlfile.txt $REPACK_OUTPUT_DIR/packedbits.h5
RUNTEST2A twithddlfile.exp twithddl.exp --enable-error-stack --ddl=$TEXT_OUTPUT_DIR/twithddl.txt -y -o $TEXT_OUTPUT_DIR/twithddlfile.txt $REPACK_OUTPUT_DIR/packedbits.h5
RUNTEST2 trawssetfile.exp --enable-error-stack -d "/dset1[1,1;;;]" -y -o $TEXT_OUTPUT_DIR/trawssetfile.txt $REPACK_OUTPUT_DIR/tdset.h5
# test for maximum display datasets
RUNTEST twidedisplay.ddl --enable-error-stack -w0 $REPACK_OUTPUT_DIR/packedbits.h5
# test for signed/unsigned datasets
RUNTEST packedbits.ddl --enable-error-stack $REPACK_OUTPUT_DIR/packedbits.h5
# test for compound signed/unsigned datasets
RUNTEST tcmpdintsize.ddl --enable-error-stack $REPACK_OUTPUT_DIR/tcmpdintsize.h5
# test for signed/unsigned scalar datasets
RUNTEST tscalarintsize.ddl --enable-error-stack $REPACK_OUTPUT_DIR/tscalarintsize.h5
# test for signed/unsigned attributes
RUNTEST tattrintsize.ddl --enable-error-stack $REPACK_OUTPUT_DIR/tattrintsize.h5
# test for compound signed/unsigned attributes
RUNTEST tcmpdattrintsize.ddl --enable-error-stack $REPACK_OUTPUT_DIR/tcmpdattrintsize.h5
# test for signed/unsigned scalar attributes
RUNTEST tscalarattrintsize.ddl --enable-error-stack $REPACK_OUTPUT_DIR/tscalarattrintsize.h5
# test for signed/unsigned scalar datasets with attributes
RUNTEST tscalarintattrsize.ddl --enable-error-stack $REPACK_OUTPUT_DIR/tscalarintattrsize.h5
# test for signed/unsigned datasets attributes
RUNTEST tintsattrs.ddl --enable-error-stack $REPACK_OUTPUT_DIR/tintsattrs.h5
# test for string scalar dataset attribute
RUNTEST tscalarstring.ddl --enable-error-stack $REPACK_OUTPUT_DIR/tscalarstring.h5
# test for displaying groups
RUNTEST tgroup-1.ddl --enable-error-stack $REPACK_OUTPUT_DIR/tgroup.h5
# test for displaying the selected groups
RUNTEST tgroup-2.ddl --enable-error-stack --group=/g2 --group / -g /y $REPACK_OUTPUT_DIR/tgroup.h5
# test for displaying simple space datasets
RUNTEST tdset-1.ddl --enable-error-stack $REPACK_OUTPUT_DIR/tdset.h5
# test for displaying selected datasets
RUNTEST tdset-2.ddl --enable-error-stack -H -d dset1 -d /dset2 --dataset=dset3 $REPACK_OUTPUT_DIR/tdset.h5
# test for displaying attributes
RUNTEST tattr-1.ddl --enable-error-stack $REPACK_OUTPUT_DIR/tattr.h5
# test for displaying the selected attributes of string type and scalar space
RUNTEST tattr-2.ddl --enable-error-stack -a "/\/attr1" --attribute /attr4 --attribute=/attr5 $REPACK_OUTPUT_DIR/tattr.h5
RUNTEST tattr-2.ddl --enable-error-stack -N "/\/attr1" --any_path /attr4 --any_path=/attr5 $REPACK_OUTPUT_DIR/tattr.h5
# test for header and error messages
RUNTEST tattr-3.ddl --enable-error-stack --header -a /attr2 --attribute=/attr $REPACK_OUTPUT_DIR/tattr.h5
# test for displaying at least 9 attributes on root from a BE machine
RUNTEST tattr-4_be.ddl --enable-error-stack $REPACK_OUTPUT_DIR/tattr4_be.h5
# test for displaying attributes in shared datatype (also in group and dataset)
# TODO: This test looks like it misses a hard link to a named datatype. Might be an issue with the h5repack H5Ocopy work-around.
#RUNTEST tnamed_dtype_attr.ddl --enable-error-stack $REPACK_OUTPUT_DIR/tnamed_dtype_attr.h5
# test for displaying soft links and user-defined links
#RUNTEST tslink-1.ddl --enable-error-stack tslink.h5
#RUNTEST tudlink-1.ddl --enable-error-stack tudlink.h5
# test for displaying the selected link
#RUNTEST tslink-2.ddl --enable-error-stack -l slink2 tslink.h5
#RUNTEST tslink-2.ddl --enable-error-stack -N slink2 tslink.h5
#RUNTEST tudlink-2.ddl --enable-error-stack -l udlink2 tudlink.h5
# test for displaying dangling soft links
#RUNTEST tslink-D.ddl --enable-error-stack -d /slink1 tslink.h5
# tests for hard links
#RUNTEST thlink-1.ddl --enable-error-stack $REPACK_OUTPUT_DIR/thlink.h5
#RUNTEST thlink-2.ddl --enable-error-stack -d /g1/dset2 --dataset /dset1 --dataset=/g1/g1.1/dset3 $REPACK_OUTPUT_DIR/thlink.h5
#RUNTEST thlink-3.ddl --enable-error-stack -d /g1/g1.1/dset3 --dataset /g1/dset2 --dataset=/dset1 $REPACK_OUTPUT_DIR/thlink.h5
#RUNTEST thlink-4.ddl --enable-error-stack -g /g1 $REPACK_OUTPUT_DIR/thlink.h5
#RUNTEST thlink-4.ddl --enable-error-stack -N /g1 $REPACK_OUTPUT_DIR/thlink.h5
#RUNTEST thlink-5.ddl --enable-error-stack -d /dset1 -g /g2 -d /g1/dset2 $REPACK_OUTPUT_DIR/thlink.h5
#RUNTEST thlink-5.ddl --enable-error-stack -N /dset1 -N /g2 -N /g1/dset2 $REPACK_OUTPUT_DIR/thlink.h5
# tests for compound data types
# Looks like the unnamed type number is different after repacking?
#RUNTEST tcomp-1.ddl --enable-error-stack $REPACK_OUTPUT_DIR/tcompound.h5
# test for named data types
RUNTEST tcomp-2.ddl --enable-error-stack -t /type1 --datatype /type2 --datatype=/group1/type3 $REPACK_OUTPUT_DIR/tcompound.h5
RUNTEST tcomp-2.ddl --enable-error-stack -N /type1 --any_path /type2 --any_path=/group1/type3 $REPACK_OUTPUT_DIR/tcompound.h5
# test for unnamed type
# Looks like the unnamed type number is different after repacking?
#RUNTEST tcomp-3.ddl --enable-error-stack -t /#6632 -g /group2 $REPACK_OUTPUT_DIR/tcompound.h5
# test complicated compound datatype
RUNTEST tcomp-4.ddl --enable-error-stack $REPACK_OUTPUT_DIR/tcompound_complex.h5
RUNTEST tcompound_complex2.ddl --enable-error-stack $REPACK_OUTPUT_DIR/tcompound_complex2.h5
# tests for bitfields and opaque data types
if test $WORDS_BIGENDIAN != "yes"; then
RUNTEST tbitnopaque_le.ddl --enable-error-stack $REPACK_OUTPUT_DIR/tbitnopaque.h5
else
RUNTEST tbitnopaque_be.ddl --enable-error-stack $REPACK_OUTPUT_DIR/tbitnopaque.h5
fi
#test for the nested compound type
RUNTEST tnestcomp-1.ddl --enable-error-stack $REPACK_OUTPUT_DIR/tnestedcomp.h5
#RUNTEST tnestedcmpddt.ddl --enable-error-stack $REPACK_OUTPUT_DIR/tnestedcmpddt.h5
# test for options (TODO: tall does not repack)
#RUNTEST tall-1.ddl --enable-error-stack tall.h5
#RUNTEST tall-2.ddl --enable-error-stack --header -g /g1/g1.1 -a attr2 tall.h5
#RUNTEST tall-3.ddl --enable-error-stack -d /g2/dset2.1 -l /g1/g1.2/g1.2.1/slink tall.h5
#RUNTEST tall-3.ddl --enable-error-stack -N /g2/dset2.1 -N /g1/g1.2/g1.2.1/slink tall.h5
#RUNTEST tall-7.ddl --enable-error-stack -a attr1 tall.h5
#RUNTEST tall-7N.ddl --enable-error-stack -N attr1 tall.h5
# test for loop detection
#RUNTEST tloop-1.ddl --enable-error-stack $REPACK_OUTPUT_DIR/tloop.h5
# test for string
RUNTEST tstr-1.ddl --enable-error-stack $REPACK_OUTPUT_DIR/tstr.h5
RUNTEST tstr-2.ddl --enable-error-stack $REPACK_OUTPUT_DIR/tstr2.h5
# test for file created by Lib SAF team
RUNTEST tsaf.ddl --enable-error-stack $REPACK_OUTPUT_DIR/tsaf.h5
# test for file with variable length data
RUNTEST tvldtypes1.ddl --enable-error-stack $REPACK_OUTPUT_DIR/tvldtypes1.h5
RUNTEST tvldtypes2.ddl --enable-error-stack $REPACK_OUTPUT_DIR/tvldtypes2.h5
RUNTEST tvldtypes3.ddl --enable-error-stack $REPACK_OUTPUT_DIR/tvldtypes3.h5
RUNTEST tvldtypes4.ddl --enable-error-stack $REPACK_OUTPUT_DIR/tvldtypes4.h5
RUNTEST tvldtypes5.ddl --enable-error-stack $REPACK_OUTPUT_DIR/tvldtypes5.h5
#test for file with variable length string data
#RUNTEST tvlstr.ddl --enable-error-stack $REPACK_OUTPUT_DIR/tvlstr.h5
RUNTEST tvlenstr_array.ddl --enable-error-stack $REPACK_OUTPUT_DIR/tvlenstr_array.h5
# test for files with array data
RUNTEST tarray1.ddl --enable-error-stack $REPACK_OUTPUT_DIR/tarray1.h5
# # added for bug# 2092 - tarray1_big.h
#RUNTEST_GREP ERRTXT "NULL token size" tarray1_big.ddl --enable-error-stack -R $REPACK_OUTPUT_DIR/tarray1_big.h5
RUNTEST tarray2.ddl --enable-error-stack $REPACK_OUTPUT_DIR/tarray2.h5
RUNTEST tarray3.ddl --enable-error-stack $REPACK_OUTPUT_DIR/tarray3.h5
RUNTEST tarray4.ddl --enable-error-stack $REPACK_OUTPUT_DIR/tarray4.h5
RUNTEST tarray5.ddl --enable-error-stack $REPACK_OUTPUT_DIR/tarray5.h5
RUNTEST tarray6.ddl --enable-error-stack $REPACK_OUTPUT_DIR/tarray6.h5
RUNTEST tarray7.ddl --enable-error-stack $REPACK_OUTPUT_DIR/tarray7.h5
RUNTEST tarray8.ddl --enable-error-stack $REPACK_OUTPUT_DIR/tarray8.h5
# test for wildcards in filename (does not work with cmake)
# inconsistent across platforms RUNTEST tstarfile.ddl --enable-error-stack -H -d Dataset1 tarr*.h5
#RUNTEST tqmarkfile.ddl --enable-error-stack -H -d Dataset1 tarray?.h5
RUNTEST tmultifile.ddl --enable-error-stack -H -d Dataset1 $REPACK_OUTPUT_DIR/tarray2.h5 $REPACK_OUTPUT_DIR/tarray3.h5 $REPACK_OUTPUT_DIR/tarray4.h5 $REPACK_OUTPUT_DIR/tarray5.h5 $REPACK_OUTPUT_DIR/tarray6.h5 $REPACK_OUTPUT_DIR/tarray7.h5
# test for files with empty data
RUNTEST tempty.ddl --enable-error-stack $REPACK_OUTPUT_DIR/tempty.h5
# test for files with group names which reach > 1024 bytes in size
RUNTEST tlarge_objname.ddl --enable-error-stack -w157 $REPACK_OUTPUT_DIR/tlarge_objname.h5
# test '-A' to suppress data but print attr's
#RUNTEST tall-2A.ddl --enable-error-stack -A tall.h5
# test '-A' to suppress attr's but print data
#RUNTEST tall-2A0.ddl --enable-error-stack -A 0 tall.h5
# test '-r' to print attributes in ASCII instead of decimal
#RUNTEST tall-2B.ddl --enable-error-stack -A -r tall.h5
# test Subsetting
#RUNTEST tall-4s.ddl --enable-error-stack --dataset=/g1/g1.1/dset1.1.1 --start=1,1 --stride=2,3 --count=3,2 --block=1,1 tall.h5
#RUNTEST tall-5s.ddl --enable-error-stack -d "/g1/g1.1/dset1.1.2[0;2;10;]" tall.h5
RUNTEST tdset-3s.ddl --enable-error-stack -d "/dset1[1,1;;;]" $REPACK_OUTPUT_DIR/tdset.h5
RUNTEST tno-subset.ddl --enable-error-stack --no-compact-subset -d "AHFINDERDIRECT::ah_centroid_t[0] it=0 tl=0" $REPACK_OUTPUT_DIR/tno-subset.h5
RUNTEST tints4dimsCount2.ddl --enable-error-stack -d FourDimInts -s 0,0,0,0 -c 2,2,2,2 $REPACK_OUTPUT_DIR/tints4dims.h5
RUNTEST tints4dimsBlock2.ddl --enable-error-stack -d FourDimInts -s 0,0,0,0 -c 1,1,1,1 -k 2,2,2,2 $REPACK_OUTPUT_DIR/tints4dims.h5
RUNTEST tints4dimsStride2.ddl --enable-error-stack -d FourDimInts -s 0,0,0,0 -S 2,2,2,2 -c 2,2,2,2 $REPACK_OUTPUT_DIR/tints4dims.h5
RUNTEST tints4dimsCountEq.ddl --enable-error-stack -d FourDimInts -s 0,0,0,0 -S 2,2,1,1 -k 1,2,1,1 -c 2,2,4,4 $REPACK_OUTPUT_DIR/tints4dims.h5
RUNTEST tints4dimsBlockEq.ddl --enable-error-stack -d FourDimInts -s 0,0,0,0 -S 2,2,1,1 -c 2,2,1,1 -k 1,2,4,4 $REPACK_OUTPUT_DIR/tints4dims.h5
# test printing characters in ASCII instead of decimal
RUNTEST tchar1.ddl --enable-error-stack -r $REPACK_OUTPUT_DIR/tchar.h5
# test datatypes in ASCII and UTF8
RUNTEST charsets.ddl --enable-error-stack $REPACK_OUTPUT_DIR/charsets.h5
# test -p with a non existing dataset
#RUNTEST tperror.ddl --enable-error-stack -p -d bogus tfcontents1.h5
# test for file contents
#RUNTEST tcontents.ddl --enable-error-stack -n tfcontents1.h5
#RUNTEST tordercontents1.ddl --enable-error-stack -n --sort_by=name --sort_order=ascending tfcontents1.h5
#RUNTEST tordercontents2.ddl --enable-error-stack -n --sort_by=name --sort_order=descending tfcontents1.h5
#RUNTEST tattrcontents1.ddl --enable-error-stack -n 1 --sort_order=ascending tall.h5
#RUNTEST tattrcontents2.ddl --enable-error-stack -n 1 --sort_order=descending tall.h5
# fill values
# TODO: Reports offsets, which change after repacking
#RUNTEST tfill.ddl --enable-error-stack -p $REPACK_OUTPUT_DIR/tfvalues.h5
# several datatype, with references , print path
#RUNTEST treference.ddl --enable-error-stack $REPACK_OUTPUT_DIR/tattr2.h5
# escape/not escape non printable characters
RUNTEST tstringe.ddl --enable-error-stack -e $REPACK_OUTPUT_DIR/tstr3.h5
RUNTEST tstring.ddl --enable-error-stack $REPACK_OUTPUT_DIR/tstr3.h5
# char data as ASCII with non escape
RUNTEST tstring2.ddl --enable-error-stack -r -d str4 $REPACK_OUTPUT_DIR/tstr3.h5
# array indices print/not print
RUNTEST tindicesyes.ddl --enable-error-stack $REPACK_OUTPUT_DIR/taindices.h5
RUNTEST tindicesno.ddl --enable-error-stack -y $REPACK_OUTPUT_DIR/taindices.h5
########## array indices with subsetting
# 1D case
RUNTEST tindicessub1.ddl --enable-error-stack -d 1d -s 1 -S 10 -c 2 -k 3 $REPACK_OUTPUT_DIR/taindices.h5
# 2D case
RUNTEST tindicessub2.ddl --enable-error-stack -d 2d -s 1,2 -S 3,3 -c 3,2 -k 2,2 $REPACK_OUTPUT_DIR/taindices.h5
# 3D case
RUNTEST tindicessub3.ddl --enable-error-stack -d 3d -s 0,1,2 -S 1,3,3 -c 2,2,2 -k 1,2,2 $REPACK_OUTPUT_DIR/taindices.h5
# 4D case
RUNTEST tindicessub4.ddl --enable-error-stack -d 4d -s 0,0,1,2 -c 2,2,3,2 -S 1,1,3,3 -k 1,1,2,2 $REPACK_OUTPUT_DIR/taindices.h5
# Exceed the dimensions for subsetting
RUNTEST texceedsubstart.ddl --enable-error-stack -d 1d -s 1,3 $REPACK_OUTPUT_DIR/taindices.h5
RUNTEST texceedsubcount.ddl --enable-error-stack -d 1d -c 1,3 $REPACK_OUTPUT_DIR/taindices.h5
RUNTEST texceedsubstride.ddl --enable-error-stack -d 1d -S 1,3 $REPACK_OUTPUT_DIR/taindices.h5
RUNTEST texceedsubblock.ddl --enable-error-stack -d 1d -k 1,3 $REPACK_OUTPUT_DIR/taindices.h5
# test for displaying objects with very long names
# TODO: Has diff issues
#RUNTEST tlonglinks.ddl --enable-error-stack $REPACK_OUTPUT_DIR/tlonglinks.h5
# dimensions over 4GB, print boundary
# TODO: tbigdims.h5 hangs when repacking
#RUNTEST tbigdims.ddl --enable-error-stack -d dset4gb -s 4294967284 -c 22 tbigdims.h5
# hyperslab read
RUNTEST thyperslab.ddl --enable-error-stack $REPACK_OUTPUT_DIR/thyperslab.h5
# test for displaying dataset and attribute of null space
RUNTEST tnullspace.ddl --enable-error-stack $REPACK_OUTPUT_DIR/tnullspace.h5
RUNTEST tgrpnullspace.ddl -p --enable-error-stack $REPACK_OUTPUT_DIR/tgrpnullspace.h5
# test for displaying dataset and attribute of space with 0 dimension size
RUNTEST zerodim.ddl --enable-error-stack $REPACK_OUTPUT_DIR/zerodim.h5
# test for long double (some systems do not have long double)
#RUNTEST tldouble.ddl --enable-error-stack $REPACK_OUTPUT_DIR/tldouble.h5
# test for vms
RUNTEST tvms.ddl --enable-error-stack $REPACK_OUTPUT_DIR/tvms.h5
# test for binary output
RUNTEST tbin1.ddl --enable-error-stack -d integer -o $TEXT_OUTPUT_DIR/out1.bin -b LE $REPACK_OUTPUT_DIR/tbinary.h5
# test for string binary output
RUNTEST2B tstr2bin2.exp --enable-error-stack -d /g2/dset2 -b -o $TEXT_OUTPUT_DIR/tstr2bin2.txt $REPACK_OUTPUT_DIR/tstr2.h5
RUNTEST2B tstr2bin6.exp --enable-error-stack -d /g6/dset6 -b -o $TEXT_OUTPUT_DIR/tstr2bin6.txt $REPACK_OUTPUT_DIR/tstr2.h5
# test for dataset region references
# TODO: The tattrreg file fails to repack
#RUNTEST tdatareg.ddl --enable-error-stack $REPACK_OUTPUT_DIR/tdatareg.h5
#RUNTEST_GREP ERRTXT "NULL token size" tdataregR.ddl --enable-error-stack -R $REPACK_OUTPUT_DIR/tdatareg.h5
#RUNTEST tattrreg.ddl --enable-error-stack tattrreg.h5
#RUNTEST_GREP ERRTXT "NULL token size" tattrregR.ddl --enable-error-stack -R tattrreg.h5
#RUNTEST2 tbinregR.exp --enable-error-stack -d /Dataset1 -s 0 -R -y -o $TEXT_OUTPUT_DIR/tbinregR.txt $REPACK_OUTPUT_DIR/tdatareg.h5
# tests for group creation order
# "1" tracked, "2" name, root tracked
#RUNTEST tordergr1.ddl --enable-error-stack --group=1 --sort_by=creation_order --sort_order=ascending $REPACK_OUTPUT_DIR/tordergr.h5
#RUNTEST tordergr2.ddl --enable-error-stack --group=1 --sort_by=creation_order --sort_order=descending $REPACK_OUTPUT_DIR/tordergr.h5
#RUNTEST tordergr3.ddl --enable-error-stack -g 2 -q name -z ascending $REPACK_OUTPUT_DIR/tordergr.h5
#RUNTEST tordergr4.ddl --enable-error-stack -g 2 -q name -z descending $REPACK_OUTPUT_DIR/tordergr.h5
#RUNTEST tordergr5.ddl --enable-error-stack -q creation_order $REPACK_OUTPUT_DIR/tordergr.h5
# tests for attribute order
# TODO: Creation order does not always survive repack
#RUNTEST torderattr1.ddl --enable-error-stack -H --sort_by=name --sort_order=ascending $REPACK_OUTPUT_DIR/torderattr.h5
#RUNTEST torderattr2.ddl --enable-error-stack -H --sort_by=name --sort_order=descending $REPACK_OUTPUT_DIR/torderattr.h5
#RUNTEST torderattr3.ddl --enable-error-stack -H --sort_by=creation_order --sort_order=ascending $REPACK_OUTPUT_DIR/torderattr.h5
#RUNTEST torderattr4.ddl --enable-error-stack -H --sort_by=creation_order --sort_order=descending $REPACK_OUTPUT_DIR/torderattr.h5
# tests for link references and order
#RUNTEST torderlinks1.ddl --enable-error-stack --sort_by=name --sort_order=ascending tfcontents1.h5
#RUNTEST torderlinks2.ddl --enable-error-stack --sort_by=name --sort_order=descending tfcontents1.h5
# tests for floating point user defined printf format
RUNTEST tfpformat.ddl --enable-error-stack -m %.7f $REPACK_OUTPUT_DIR/tfpformat.h5
# tests for traversal of external links
#RUNTEST textlinksrc.ddl --enable-error-stack textlinksrc.h5
#RUNTEST textlinkfar.ddl --enable-error-stack textlinkfar.h5
# test for dangling external links
#RUNTEST textlink.ddl --enable-error-stack textlink.h5
# test for -o -y for dataset with attributes
#RUNTEST2 tall-6.exp --enable-error-stack -y -o tall-6.txt -d /g1/g1.1/dset1.1.1 tall.h5
# test for non-existing file
#RUNTEST non_existing.ddl --enable-error-stack tgroup.h5 non_existing.h5
# test to verify HDFFV-10333: error similar to H5O_attr_decode in the jira issue
# TODO: err_attr_dspace.h5 does not repack (may be a native issue?)
#RUNTEST err_attr_dspace.ddl err_attr_dspace.h5
# test to verify HDFFV-9407: long double full precision
RUNTEST_GREP OUTTXT "1.123456789012345" t128bit_float.ddl -m %.35Lf $REPACK_OUTPUT_DIR/t128bit_float.h5
# Clean up generated files/directories
CLEAN_OUTPUT
# Report test results and exit
if test $nerrors -eq 0 ; then
echo "All $TESTNAME tests passed."
exit $EXIT_SUCCESS
else
echo "$TESTNAME tests failed with $nerrors errors."
exit $EXIT_FAILURE
fi
|