[svn-r14319] Purpose: Update error handling in h5ls, uncomment test

Description:
Larry was able to track down the bug in the h5ls test script and change it around to check for an expected error code for each test.  With this, we are now able to uncomment the broken test on Windows.

Tested:
VS2005 on WinXP
This commit is contained in:
Scott Wegner 2007-12-04 08:55:40 -05:00
parent ff08547a23
commit 529d974dff

View File

@ -76,6 +76,14 @@ rem %2 and on -- argument for the h5ls tool
set params=%*
set params=%params:* =%
rem Target the first variable in params, retvalexpect
for %%a in (%params%) do (
set retvalexpect=%%a
set params=%params:* =%
goto break1
)
:break1
rem Run test.
rem Stderr is included in stdout so that the diff can detect
rem any unexpected output from that stream too
@ -101,7 +109,7 @@ rem %2 and on -- argument for the h5ls tool
move /y tmp.txt !%%a_parsed! > nul
)
if "%exitcode%" neq "0" (
if "%exitcode%" neq "%retvalexpect%" (
call :testing *FAILED* %params%
set /a nerrors=!nerrors!+1
if "yes"=="%verbose%" (
@ -110,11 +118,11 @@ rem %2 and on -- argument for the h5ls tool
rem Count lines echo'ed, and break out after 20. --SJW 8/28/07
set line=0
for /f "tokens=* delims=" %%a in (%actual%) do (
if !line! geq %nlines% goto break
if !line! geq %nlines% goto break2
echo.%%a
set /a line=!line!+1
)
:break
:break2
echo.***end of test output***
echo.
)
@ -154,67 +162,63 @@ rem ############################################################################
rem Toss in a bunch of tests. Not sure if they are the right kinds.
rem test the help syntax
call :tooltest help-1.ls -w80 -h
call :tooltest help-2.ls -w80 -help
call :tooltest help-3.ls -w80 -?
call :tooltest help-1.ls 0 -w80 -h
call :tooltest help-2.ls 0 -w80 -help
call :tooltest help-3.ls 0 -w80 -?
rem test simple command
call :tooltest tall-1.ls -w80 tall.h5
call :tooltest tall-2.ls -w80 -r -d tall.h5
call :tooltest tgroup.ls -w80 tgroup.h5
call :tooltest tall-1.ls 0 -w80 tall.h5
call :tooltest tall-2.ls 0 -w80 -r -d tall.h5
call :tooltest tgroup.ls 0 -w80 tgroup.h5
rem test for displaying groups
rem Comment this test out for now. h5ls returns an errorlevel of 1, which
rem the test correctly checks and subsequently fails. On Linux, there is a
rem bug in the return-code checking which makes this test fail. We'll wait
rem for them to fix things on their side before we tackle this.
rem call :tooltest tgroup-1.ls -w80 -r -g tgroup.h5
call :tooltest tgroup-2.ls -w80 -g tgroup.h5/g1
call :tooltest tgroup-1.ls 1 -w80 -r -g tgroup.h5
call :tooltest tgroup-2.ls 0 -w80 -g tgroup.h5/g1
rem test for displaying simple space datasets
call :tooltest tdset-1.ls -w80 -r -d tdset.h5
call :tooltest tdset-1.ls 0 -w80 -r -d tdset.h5
rem test for displaying soft links
call :tooltest tslink-1.ls -w80 -r tslink.h5
call :tooltest tslink-1.ls 0 -w80 -r tslink.h5
rem test for displaying external and user-defined links
call :tooltest textlink-1.ls -w80 -r textlink.h5
call :tooltest tudlink-1.ls -w80 -r tudlink.h5
call :tooltest textlink-1.ls 0 -w80 -r textlink.h5
call :tooltest tudlink-1.ls 0 -w80 -r tudlink.h5
rem tests for hard links
call :tooltest thlink-1.ls -w80 thlink.h5
call :tooltest thlink-1.ls 0 -w80 thlink.h5
rem tests for compound data types
call :tooltest tcomp-1.ls -w80 -r -d tcompound.h5
call :tooltest tcomp-1.ls 0 -w80 -r -d tcompound.h5
rem test for the nested compound type
call :tooltest tnestcomp-1.ls -w80 -r -d tnestedcomp.h5
call :tooltest tnestcomp-1.ls 0 -w80 -r -d tnestedcomp.h5
rem test for loop detection
call :tooltest tloop-1.ls -w80 -r -d tloop.h5
call :tooltest tloop-1.ls 0 -w80 -r -d tloop.h5
rem test for string
call :tooltest tstr-1.ls -w80 -r -d tstr.h5
call :tooltest tstr-1.ls 0 -w80 -r -d tstr.h5
rem test test file created from lib SAF team
call :tooltest tsaf.ls -w80 -r -d tsaf.h5
call :tooltest tsaf.ls 0 -w80 -r -d tsaf.h5
rem test for variable length data types
call :tooltest tvldtypes1.ls -w80 -r -d tvldtypes1.h5
call :tooltest tvldtypes1.ls 0 -w80 -r -d tvldtypes1.h5
rem test for array data types
call :tooltest tarray1.ls -w80 -r -d tarray1.h5
call :tooltest tarray1.ls 0 -w80 -r -d tarray1.h5
rem test for empty data
call :tooltest tempty.ls -w80 -d tempty.h5
call :tooltest tempty.ls 0 -w80 -d tempty.h5
rem test for all dataset types written to attributes
rem enable -S for avoiding printing NATIVE types
call :tooltest tattr2.ls -w80 -v -S tattr2.h5
call :tooltest tattr2.ls 0 -w80 -v -S tattr2.h5
rem tests for error handling.
rem test for non-existing file
call :tooltest nosuchfile.ls nosuchfile.h5
call :tooltest nosuchfile.ls 0 nosuchfile.h5
if %nerrors% equ 0 (
echo.All h5ls tests passed.