summaryrefslogtreecommitdiffstats
path: root/windows/tools/lstest.BAT
blob: 1bb933e07b149298df3faff35f3f1ce51e902809 (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
@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 h5ls tests
::Usage
:: lstest release  -- release static version
:: lstest debug  -- debug static version
:: lstest release dll -- release dll version
:: lstest debug dll -- debug dll version
:: Written By: Fang GUO
:: Date      : Jan. 27, 2006


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


::*******************************************************
:: Generate a new temp directory for test h5dump 
::*******************************************************
		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=0
			 set ln_exp=3

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

    :: Define the .exe file based on the second parameter
       set exefile=h5ls%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\*.h5) do set %%~ni=..\..\%%i
    
    :: Change the directory to dir including .exe file
       cd h5ls%p2%\%p1%

::Test h5ls with different options

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

:: The paramter following %tooltest% is the expected output file
:: Path of the expected output file is not needed

:: Toss in a bunch of tests.  Not sure if they are the right kinds.
:: test the help syntax
set flag=-w80 -h
call %tooltest% help-1.ls

set flag=-w80 -help
call %tooltest% help-2.ls

set flag=-w80 -?
call %tooltest% help-3.ls

:: test simple command
set flag=-w80 %tall%
call %tooltest% tall-1.ls

set flag=-w80 -r -d %tall%
call %tooltest% tall-2.ls

set flag=-w80 %tgroup%
call %tooltest% tgroup.ls

:: test for displaying groups
set flag=-w80 -r -g %tgroup%
call %tooltest% tgroup-1.ls

:: test for displaying simple space datasets
set flag=-w80 -r -d %tdset%
call %tooltest% tdset-1.ls

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

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

:: tests for compound data types
set flag=-w80 -r -d %tcompound%
call %tooltest% tcomp-1.ls

::test for the nested compound type
set flag=-w80 -r -d %tnestedcomp%
call %tooltest% tnestcomp-1.ls

:: test for loop detection
set flag=-w80 -r -d %tloop%
call %tooltest% tloop-1.ls

:: test for string 
set flag=-w80 -r -d %tstr%
call %tooltest% tstr-1.ls

:: test test file created from lib SAF team
set flag=-w80 -r -d %tsaf%
call %tooltest% tsaf.ls

:: test for variable length data types
set flag=-w80 -r -d %tvldtypes1%
call %tooltest% tvldtypes1.ls

:: test for array data types
set flag=-w80 -r -d %tarray1%
call %tooltest% tarray1.ls

:: test for empty data
set flag=-w80 -d %tempty%
call %tooltest% tempty.ls

:: test for all dataset types written to attributes
:: enable -S for avoiding printing NATIVE types
:: need batch mask.bat
set flag=-w80 -v -S %tattr2%
call %tooltest% tattr2.ls MASK

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
)


cd ..\..
rmdir /s/q temptest

for %%i in (testfiles\*.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=