From b3b538cf581ecf0a5ce9fa883a16061fda84b881 Mon Sep 17 00:00:00 2001 From: Scott Wegner Date: Mon, 17 Nov 2008 14:12:14 -0500 Subject: [svn-r16084] Purpose: Update Windows tool test scripts Description: Bring changes from the various tool test scripts to Windows. testh5copy.bat: add syntax for tests which expect h5diff to fail, and apply them to existing tests testh5diff.bat: add a new test for "contents mode" testh5dump.bat: modify some tests to use the new "-b *" and "-b NATIVE" syntax h5repack.bat: call h5dump without the -c switch Tested: VS2005 on WinXP --- windows/tools/h5copy/testh5copy.bat | 65 ++++++++++++++++++++++++++++++++++--- windows/tools/h5diff/testh5diff.bat | 6 +--- windows/tools/h5dump/testh5dump.bat | 15 ++++++--- windows/tools/h5repack/h5repack.bat | 2 +- 4 files changed, 72 insertions(+), 16 deletions(-) diff --git a/windows/tools/h5copy/testh5copy.bat b/windows/tools/h5copy/testh5copy.bat index 120b03a..6207521 100644 --- a/windows/tools/h5copy/testh5copy.bat +++ b/windows/tools/h5copy/testh5copy.bat @@ -148,7 +148,48 @@ rem $* everything else arguments for h5copy. ) if %runh5diff% neq no ( - call :h5difftest %inputfile% %outputfile% + call :h5difftest %inputfile% %outputfile% %7 %9 + ) + + exit /b + + +:tooltest_fail + set runh5diff=yes + if "%1"=="-i" ( + set inputfile=%2 + ) else ( + set runh5diff=no + ) + if "%3"=="-o" ( + set outputfile=%4 + ) else ( + set h5diff=no + ) + + ( + echo.############################# + echo. output for %h5copy% %* + echo.############################# + %h5copy_bin% %* + ) > output.out + + if %errorlevel% neq 0 ( + call :testing *FAILED* %h5copy% %* + echo.failed result is: + type output.out + set /a nerrors=!nerrors!+1 + ) else ( + call :testing PASSED %h5copy% %* + + rem Clean up output file + if not defined HDF5_NOCLEANUP ( + del /f output.out + ) + ) + + if %runh5diff% neq no ( + call :h5difftest_fail %inputfile% %outputfile% %7 %9 ) exit /b @@ -168,6 +209,20 @@ rem exit /b +rem Call the h5diff tool with a call that is expected to fail +rem +:h5difftest_fail + %h5diff_bin% -q %* + if %errorlevel% neq 1 ( + call :verify *FAILED* %* + set /a nerrors=!nerrors!+1 + ) else ( + call :verify PASSED %* + ) + + exit /b + + rem Call the h5ls tool to verify the correct output data in the destination file rem :h5lstest @@ -268,17 +323,17 @@ rem call :tooltest -i %testfile% -o %fileout% -v -s /grp_dsets/simple -d /grp_dsets/simple_group echo.Test copying ^& renaming group - call :tooltest -i %testfile% -o %fileout% -v -s grp_dsets -d grp_rename + call :tooltest_fail -i %testfile% -o %fileout% -v -s grp_dsets -d grp_rename echo.Test copying 'full' group hierarchy into group in destination file - call :tooltest -i %testfile% -o %fileout% -v -s grp_dsets -d /grp_rename/grp_dsets + call :tooltest_fail -i %testfile% -o %fileout% -v -s grp_dsets -d /grp_rename/grp_dsets echo.Test copying objects into group hier. that doesn't exist yet in destination file call :tooltest -i %testfile% -o %fileout% -vp -s simple -d /A/B1/simple call :tooltest -i %testfile% -o %fileout% -vp -s simple -d /A/B2/simple2 call :tooltest -i %testfile% -o %fileout% -vp -s /grp_dsets/simple -d /C/D/simple - call :tooltest -i %testfile% -o %fileout% -vp -s /grp_dsets -d /E/F/grp_dsets - call :tooltest -i %testfile% -o %fileout% -vp -s /grp_nested -d /G/H/grp_nested + call :tooltest_fail -i %testfile% -o %fileout% -vp -s /grp_dsets -d /E/F/grp_dsets + call :tooltest_fail -i %testfile% -o %fileout% -vp -s /grp_nested -d /G/H/grp_nested rem Verify that the file created above is correct call :h5lstest %fileout% diff --git a/windows/tools/h5diff/testh5diff.bat b/windows/tools/h5diff/testh5diff.bat index cf178b1..350e7c2 100644 --- a/windows/tools/h5diff/testh5diff.bat +++ b/windows/tools/h5diff/testh5diff.bat @@ -248,10 +248,6 @@ rem ############################################################################ rem 1.8 quiet mode call :testing %h5diff% -q %srcfile1% %srcfile2% call :tooltest h5diff_18.txt -q %file1% %file2% - - rem 1.9 contents mode - call :testing %h5diff% -v -c %srcfile1% %srcfile11% - call :tooltest h5diff_19.txt -v -c %file1% %file11% rem ############################################################################## rem # not comparable types @@ -495,7 +491,7 @@ rem ############################################################################ call :testing h5diff_101.txt -v %srcfile1% %srcfile1% g1/d1 g1/d2 rem call :tooltest h5diff_101.txt -v %file1% %file1% g1/d1 g1/d2 call :results -SKIP- - rem + call :testing %h5diff% -v %srcfile1% %srcfile1% g1/fp1 g1/fp2 rem call :tooltest h5diff_102.txt -v %file1% %file1% g1/fp1 g1/fp2 call :results -SKIP- diff --git a/windows/tools/h5dump/testh5dump.bat b/windows/tools/h5dump/testh5dump.bat index 487db64..afad801 100644 --- a/windows/tools/h5dump/testh5dump.bat +++ b/windows/tools/h5dump/testh5dump.bat @@ -557,21 +557,26 @@ rem ############################################################################ rem directory, and using it only gets in the way of the output formatting. rem --SJW 8/24/07 call :tooltest1 tbin1.ddl -d integer -o out1.bin -b LE tbinary.h5 - call :tooltest1 tbin2.ddl -d float -o out2.bin -b BE tbinary.h5 - rem the MEMORY test can be validated with h5import/h5diff - call :tooltest1 tbin3.ddl -d integer -o out3.bin -b MEMORY tbinary.h5 + rem NATIVE default. the NATIVE test can be validated with h5import/h5diff + call :tooltest1 tbin1.ddl -d integer -o out1.bin -b MEMORY tbinary.h5 + call :importtest out1.bin -c out3.h5import -o out1.h5 + call :difftest tbinary.h5 out1.h5 /integer /integer + + call :tooltest1 tbin2.ddl -b BE -d float -o out2.bin tbinary.h5 + + rem the NATIVE test can be validated with h5import/h5diff + call :tooltest1 tbin3.ddl -d integer -o out3.bin -b NATIVE tbinary.h5 call :importtest out3.bin -c out3.h5import -o out3.h5 call :difftest tbinary.h5 out3.h5 /integer /integer - call :tooltest1 tbin4.ddl -d double -o out4.bin -b FILE tbinary.h5 + call :tooltest1 tbin4.ddl -d double -b FILE -o out4.bin tbinary.h5 rem Clean up binary output files if not defined hdf5_nocleanup ( for /l %%a in (1,1,4) do del /f %testdir%\out%%a.bin del /f %testdir%\out3.h5 ) - rem test for dataset region references call :tooltest tdatareg.ddl tdatareg.h5 diff --git a/windows/tools/h5repack/h5repack.bat b/windows/tools/h5repack/h5repack.bat index b5122f2..eb4da34 100644 --- a/windows/tools/h5repack/h5repack.bat +++ b/windows/tools/h5repack/h5repack.bat @@ -114,7 +114,7 @@ rem was unavailable) rem Call the h5diff tool rem :difftest - %h5diff_bin% -q -c %* + %h5diff_bin% -q %* if %errorlevel% neq 0 ( call :verify *FAILED* %* set /a nerrors=!nerrors!+1 -- cgit v0.12