summaryrefslogtreecommitdiffstats
path: root/windows/tools/dumptest.bat
blob: 5d58e123843ec4102a3d6759ca8b3352a9695b94 (plain)
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
@REM Copyright by the Board of Trustees of the University of Illinois.
@REM All rights reserved.
@REM
@REM This file is part of HDF5.  The full HDF5 copyright notice, including
@REM terms governing use, modification, and redistribution, is contained in
@REM the files COPYING and Copyright.html.  COPYING can be found at the root
@REM of the source code distribution tree; Copyright.html can be found at the
@REM root level of an installed copy of the electronic HDF5 document set and
@REM is linked from the top-level documents page.  It can also be found at
@REM http://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html.  If you do not have
@REM access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu.

@echo off

::This batch file is for h5dump general and xml tests.
::Usage
:: dumptest release  -- release static version
:: dumptest debug  -- debug static version
:: dumptest release dll -- release dll version
:: dumptest debug dll -- debug dll version
:: Written By: Fang GUO
:: Date      : Jan. 12, 2006


:: Track total number of testing errors
   set /A totalerr=0
   set /A totalskip=0


::*******************************************************
:: Generate a new temp directory for test h5dump 
::*******************************************************
		:: Make a temporary directory for h5dump test
    mkdir temptest

::******************************************************************
:: Set the Environment Variables & Change Dir to Dir with h5dump.EXE
::******************************************************************

		:: The first incoming parameter should be configuration (debug or release)
		   set p1=%1
		:: The second parameter should be the types of library (dll or blank)
		   set p2=%2

    :: Before comparison between expected file and the actual outputfile, 
    :: Ignore the first line in actual outputfile and the first four lines
    :: in the expected output file
       
       set ln=1
			 set ln_exp=4

    :: Save the tests output into a temporary file 			
       set tempResults=dumptest%2_%1.txt
       type nul > %tempResults%

    :: Define the .exe file based on the second parameter
       set exefile=h5dump%p2%
    
    :: For convenience, set a variable for the sub batch file 
       set tooltest=..\..\tooltest
   
    :: For convenience, set variable for all testfiles/*.h5 files
       for %%i in (testfiles\t*.h5) do set %%~ni=..\..\%%i
    
    :: Special cases: the following are not .h5 files but needed in the tests       
       for %%i in (tsplit_file tmulti) do (
         set %%i=..\..\testfiles\%%i
       )
       
    :: Havn't find a way to use % inside a variable name
			 set tfamily05d=..\..\testfiles\tfamily%%05d.h5

    :: Change the directory to dir including .exe file
       cd h5dump%p2%\%p1%

::Test h5dump with different options

echo.****************************************************
echo.       h5dump%2 %1   T E S T S            
echo.****************************************************

::--------------------------
::test for displaying groups
::--------------------------
set flag=%tgroup%
call %tooltest% tgroup-1.ddl

::---------------------------------------
::test for displaying the selected groups
::---------------------------------------
set flag=--group=/g2 --group / -g /y %tgroup%
call %tooltest% tgroup-2.ddl

:: -----------------------------------------
:: test for displaying simple space datasets
::------------------------------------------
set flag=%tdset%
call %tooltest% tdset-1.ddl

::--------------------------------------
::test for displaying selected datasets
::--------------------------------------
set flag=-H -d dset1 -d /dset2 --dataset=dset3 %tdset%
call %tooltest% tdset-2.ddl

::------------------------------
::test for displaying attributes
::------------------------------
set flag=%tattr%
call %tooltest% tattr-1.ddl

::---------------------------------------------------------------------------
::test for displaying the selected attributes of string type and scalar space
::---------------------------------------------------------------------------
set flag=-a /attr1 --attribute /attr4 --attribute=/attr5 %tattr%
call %tooltest% tattr-2.ddl

::----------------------------------
::test for header and error messages
::----------------------------------
set flag=--header -a /attr2 --attribute=/attr %tattr%
call %tooltest% tattr-3.ddl

::------------------------------------------------
::test for displaying shared datatype in attribute
::------------------------------------------------
set flag=-A %tnamed_dtype_attr% 
call %tooltest% tnamed_dtype_attr.ddl

::------------------------------
::test for displaying soft links
::------------------------------
set flag=%tslink%
call %tooltest% tslink-1.ddl

::-------------------------------------
::test for displaying the selected link
::-------------------------------------
set flag=-l slink2 %tslink%
call %tooltest% tslink-2.ddl

::--------------------
::tests for hard links
::--------------------
set flag=%thlink%
call %tooltest% thlink-1.ddl

set flag=-d /g1/dset2 --dataset /dset1 --dataset=/g1/g1.1/dset3 %thlink%
call %tooltest% thlink-2.ddl

set flag=-d /g1/g1.1/dset3 --dataset /g1/dset2 --dataset=/dset1 %thlink%
call %tooltest% thlink-3.ddl

set flag=-g /g1 %thlink%
call %tooltest% thlink-4.ddl

set flag=-d /dset1 -g /g2 -d /g1/dset2 %thlink%
call %tooltest% thlink-5.ddl

::-----------------------------
::tests for compound data types
::-----------------------------
set flag=%tcompound%
call %tooltest% tcomp-1.ddl

::-------------------------
::test for named data types
::-------------------------
set flag=-t /type1 --datatype /type2 --datatype=/group1/type3 %tcompound%
call %tooltest% tcomp-2.ddl

::--------------------
::test for unamed type
::--------------------
set flag=-t /#6632:0 -g /group2 %tcompound%
call %tooltest% tcomp-3.ddl

::----------------------------------
::test complicated compound datatype
::----------------------------------
set flag=%tcompound_complex%
call %tooltest% tcomp-4.ddl

::---------------------------------
::test for the nested compound type
::---------------------------------
set flag=%tnestedcomp%
call %tooltest% tnestcomp-1.ddl

::----------------
::test for options
::----------------
set flag=%tall%
call %tooltest% tall-1.ddl

set flag=--header -g /g1/g1.1 -a attr2 %tall%
call %tooltest% tall-2.ddl

set flag=-d /g2/dset2.1 -l /g1/g1.2/g1.2.1/slink %tall%
call %tooltest% tall-3.ddl

::------------------------
::test for loop detection
::------------------------
set flag=%tloop%
call %tooltest% tloop-1.ddl

::---------------
::test for string 
::---------------
set flag=%tstr%
call %tooltest% tstr-1.ddl

set flag=%tstr2%
call %tooltest% tstr-2.ddl

::-------------------------------------
::test for file created by Lib SAF team
::-------------------------------------
set flag=%tsaf%
call %tooltest% tsaf.ddl

::---------------------------------------
::test for file with variable length data
::---------------------------------------
set tvldtypes=..\..\testfiles\tvldtypes
for %%v in (1 2 3 4 5) do (
set flag=%tvldtypes%%%v.h5
call %tooltest% tvldtypes%%v.ddl
)
set tvldtypes=

::----------------------------------------------
::test for file with variable length string data
::----------------------------------------------
set flag=%tvlstr%
call %tooltest% tvlstr.ddl

::------------------------------
::test for files with array data
::------------------------------
set tarray=..\..\testfiles\tarray
for /L %%v in (1,1,7) do (
set flag=%tarray%%%v%.h5
call %tooltest% tarray%%v.ddl
)
set tarray=

::------------------------------
::test for files with empty data
::------------------------------
set flag=%tempty%
call %tooltest% tempty.ddl

::---------------------------------------------
::test for files with groups that have comments
::---------------------------------------------
set flag=%tgrp_comments%
call %tooltest% tgrp_comments.ddl

::---------------------------
::test the --filedriver flag
::---------------------------
set flag=--filedriver=split %tsplit_file%
call %tooltest% tsplit_file.ddl

::Special: Find a way to echo environment
set flag=--filedriver=family %tfamily05d%
call %tooltest% tfamily.ddl

set flag=--filedriver=multi %tmulti%
call %tooltest% tmulti.ddl

::----------------------------------------------------------------
::test for files with group names which reach > 1024 bytes in size
::----------------------------------------------------------------
set flag=-w157 %tlarge_objname%
call %tooltest% tlarge_objname.ddl

::-------------------------------------------
::test '-A' to suppress data but print attr's
::-------------------------------------------
set flag=-A %tall%
call %tooltest% tall-2A.ddl

::---------------------------------------------------------
::test '-r' to print attributes in ASCII instead of decimal
::---------------------------------------------------------
set flag=-A -r %tall%
call %tooltest% tall-2B.ddl

::---------------
::test Subsetting
::---------------
set flag=--dataset=/g1/g1.1/dset1.1.1 --start=1,1 --stride=2,3 --count=3,2 --block=1,1 %tall%
call %tooltest% tall-4s.ddl

::set flag=-d "/g1/g1.1/dset1.1.2[0;2;10;]" %tall%
::call %tooltest% tall-5s.ddl

::set flag=-d "/dset1[1,1;;;]" %tdset%
::call %tooltest% tdset-3s.ddl

::set flag=-d "/dset1[;3,2;4,4;1,4]" %tdset2%
::call %tooltest% tdset2-1s.ddl

::----------------------------------------------------
::test printing characters in ASCII instead of decimal
::----------------------------------------------------
set flag=-r %tchar%
call %tooltest% tchar1.ddl

::---------------------
::test failure handling
::---------------------

::1. Missing file name
set flag= 
call %tooltest% tnofilename.ddl

:: rev. 2004

::---------------------
::tests for super block
::---------------------
set flag=-H -B -d dset %tfcontents1%
call %tooltest% tboot1.ddl

set flag=-B %tfcontents2%
call %tooltest% tboot2.ddl

::------------------------------------
:: test -p with a non existing dataset
::------------------------------------
set flag=-p -d bogus %tfcontents1%
call %tooltest% tperror.ddl

::----------------------
::test for file contents
::----------------------
set flag=-n %tfcontents1%
call %tooltest% tcontents.ddl

::-------------------------
::tests for storage layout
::-------------------------

for %%v in (compact chunked external) do (
set flag=-H -p -d  %%v %tfilters%
call %tooltest% t%%v.ddl
)

::contiguous (tcontiguos.ddl or tcontiguous.ddl)
set flag=-H -p -d contiguous %tfilters%
call %tooltest% tcontiguos.ddl

::-----------
::fill values
::-----------
set flag=-p %tfvalues%
call %tooltest% tfill.ddl

::-----------------------------------------------
::several datatype, with references , print path
::-----------------------------------------------
set flag=%tattr2%
call %tooltest% treference.ddl

::------------------------------------------
::escape/not escape non printable characters
::------------------------------------------
set flag=-e %tstr3%
call %tooltest% tstringe.ddl

set flag=%tstr3%
call %tooltest% tstring.ddl

::----------------------------------
::char data as ASCII with non escape
::----------------------------------
set flag=-r -d str4 %tstr3%
call %tooltest% tstring2.ddl

::-----------------------------
::array indices print/not print
::-----------------------------
set flag=%taindices%
call %tooltest% tindicesyes.ddl

set flag=-y %taindices%
call %tooltest% tindicesno.ddl

::-----------------
::tests for filters
::-----------------

:: SZIP
set flag=-H -p -d szip %tfilters%
call %tooltest% tszip.ddl szip

::deflate
set flag=-H -p -d deflate %tfilters%
call %tooltest% tdeflate.ddl zlib

::shuffle
set flag=-H -p -d shuffle %tfilters%
call %tooltest% tshuffle.ddl

::fletcher32
set flag=-H -p -d fletcher32 %tfilters%
call %tooltest% tfletcher32.ddl

::nbit
set flag=-H -p -d nbit %tfilters%
call %tooltest% tnbit.ddl

::scaleoffset
set flag=-H -p -d scaleoffset %tfilters%
call %tooltest% tscaleoffset.ddl

::all
set flag=-H -p -d all  %tfilters%
call %tooltest% tallfilters.ddl zlib szip

::user defined
set flag=-H  -p -d myfilter  %tfilters%
call %tooltest% tuserfilter.ddl
  
::test for displaying dataset and attribute of null space
set flag=%tnullspace%
call %tooltest% tnullspace.ddl

::test for displaying objects with very long names
set flag=%tlonglinks%
call %tooltest% tlonglinks.ddl


echo. 
echo.****************************************************
echo.       h5dump%2 %1 XML T E S T S            
echo.****************************************************

::test XML
set flag=--xml %tall%
call %tooltest%  tall.h5.xml

set flag=--xml %tattr%
call %tooltest%  tattr.h5.xml 

set flag=--xml %tbitfields%
call %tooltest%  tbitfields.h5.xml

set flag=--xml %tcompound%
call %tooltest%  tcompound.h5.xml

set flag=--xml %tcompound2%
call %tooltest%  tcompound2.h5.xml

set flag=--xml %tdatareg%
call %tooltest%  tdatareg.h5.xml

set flag=--xml %tdset%
call %tooltest%  tdset.h5.xml

set flag=--xml %tdset2%
call %tooltest%  tdset2.h5.xml

set flag=--xml %tenum%
call %tooltest%  tenum.h5.xml

set flag=--xml %tgroup%
call %tooltest%  tgroup.h5.xml

set flag=--xml %thlink%
call %tooltest%  thlink.h5.xml SKIP

set flag=--xml %tloop%
call %tooltest%  tloop.h5.xml

set flag=--xml %tloop2%
call %tooltest%  tloop2.h5.xml

set flag=--xml %tmany%
call %tooltest%  tmany.h5.xml SKIP

set flag=--xml %tnestedcomp%
call %tooltest%  tnestedcomp.h5.xml

set flag=--xml %tcompound_complex%
call %tooltest%  tcompound_complex.h5.xml

set flag=--xml %tobjref%
call %tooltest%  tobjref.h5.xml

set flag=--xml %topaque%
call %tooltest%  topaque.h5.xml

set flag=--xml %tslink%
call %tooltest%  tslink.h5.xml

set flag=--xml %tstr%
call %tooltest%  tstr.h5.xml

set flag=--xml %tstr2%
call %tooltest%  tstr2.h5.xml

set flag=--xml %tref%
call %tooltest%  tref.h5.xml

set flag=--xml %tname-amp%
call %tooltest%  tname-amp.h5.xml

set flag=--xml %tname-apos%
call %tooltest%  tname-apos.h5.xml

set flag=--xml %tname-gt%
call %tooltest%  tname-gt.h5.xml

set flag=--xml %tname-lt%
call %tooltest%  tname-lt.h5.xml

set flag=--xml %tname-quot%
call %tooltest%  tname-quot.h5.xml

set flag=--xml %tname-sp%
call %tooltest%  tname-sp.h5.xml

set flag=--xml %tstring%
call %tooltest%  tstring.h5.xml

set flag=--xml %tstring-at%
call %tooltest%  tstring-at.h5.xml

set flag=--xml %tref-escapes%
call %tooltest%  tref-escapes.h5.xml

set flag=--xml %tref-escapes-at%
call %tooltest%  tref-escapes-at.h5.xml

set flag=--xml %tnodata%
call %tooltest%  tnodata.h5.xml

set flag=--xml %tarray1%
call %tooltest%  tarray1.h5.xml

set flag=--xml %tarray2%
call %tooltest%  tarray2.h5.xml

set flag=--xml %tarray3%
call %tooltest%  tarray3.h5.xml

set flag=--xml %tarray6%
call %tooltest%  tarray6.h5.xml

set flag=--xml %tarray7%
call %tooltest%  tarray7.h5.xml

set flag=--xml %tvldtypes1%
call %tooltest%  tvldtypes1.h5.xml

set flag=--xml %tvldtypes2%
call %tooltest%  tvldtypes2.h5.xml

set flag=--xml %tvldtypes3%
call %tooltest%  tvldtypes3.h5.xml

set flag=--xml %tvldtypes4%
call %tooltest%  tvldtypes4.h5.xml

set flag=--xml %tvldtypes5%
call %tooltest%  tvldtypes5.h5.xml

set flag=--xml %tvlstr%
call %tooltest%  tvlstr.h5.xml

set flag=--xml %tsaf%
call %tooltest%  tsaf.h5.xml

set flag=--xml %tempty%
call %tooltest%  tempty.h5.xml

set flag=--xml %tnamed_dtype_attr%
call %tooltest%  tnamed_dtype_attr.h5.xml


::Test dataset and attribute of null space.  Commented out:
::wait until the XML schema is updated for null space. 
set flag=--xml tnulspace.h5
call %tooltest%  tnullspace.h5.xml SKIP

::other options for xml

set flag=--xml --use-dtd %tempty%
call %tooltest%  tempty-dtd.h5.xml 

set flag=--xml -u %tempty%
call %tooltest%  tempty-dtd-2.h5.xml

set flag=--xml -X ":" %tempty%
call %tooltest%  tempty-nons.h5.xml

set flag=--xml --xml-ns=":" %tempty%
call %tooltest%  tempty-nons-2.h5.xml

::Some of these combinations are syntactically correct but
::the URLs are dummies 

set flag=--xml -X "thing:" %tempty%
call %tooltest%  tempty-ns.h5.xml

set flag=--xml --xml-ns="thing:" %tempty%
call %tooltest%  tempty-ns-2.h5.xml

set flag=--xml --xml-ns=":" --xml-dtd="http://somewhere.net" %tempty%
call %tooltest%  tempty-nons-uri.h5.xml

set flag=--xml --use-dtd --xml-dtd="http://somewhere.net" %tempty%
call %tooltest%  tempty-dtd-uri.h5.xml

set flag=--xml -A %tall%
call %tooltest%  tall-2A.h5.xml

::------------------
::End of -xml Tests
::------------------

cd ..\..

echo.
if %totalerr%==0 (
echo. All of the %exefile% %p1% Tests Passed!
echo. All of the %exefile% %p1% Tests Passed! >> %tempResults%
) else (
echo. %exefile% %p1% Tests Finished with %totalerr% Errors!  
echo. %exefile% %p1% Tests Finished with %totalerr% Errors!>> %tempResults%
)

if not %totalskip%==0 (
echo. %totalskip% Tests in total Skiped!  >> %tempResults%
echo. %totalskip% Tests in total Skiped!
echo. 
find "SKIPED" %tempResults% | more +2
)

rmdir /s/q temptest

for %%i in (testfiles\t*.h5) do set %%~ni=
set test_szip=
set output_szip=
for %%v in (p1 p2 tempResults exefile tooltest ln ln_exp tsplit_file tmulti tfamily05d totalskip) do set %%v=
for %%i in (tsplit_file tmulti) do set %%i=
set tfamily05d=