diff options
author | MuQun Yang <ymuqun@hdfgroup.org> | 2006-10-20 01:43:43 (GMT) |
---|---|---|
committer | MuQun Yang <ymuqun@hdfgroup.org> | 2006-10-20 01:43:43 (GMT) |
commit | 5d1ebe6b0acc5a9a0de9d8482387178d68fa794b (patch) | |
tree | ebf7087248e5e75f5943ad228bbe3b901fb6b4b5 /windows | |
parent | 2a973f740a3d0f79c315bd7fe4ffac85f4ef67f0 (diff) | |
download | hdf5-5d1ebe6b0acc5a9a0de9d8482387178d68fa794b.zip hdf5-5d1ebe6b0acc5a9a0de9d8482387178d68fa794b.tar.gz hdf5-5d1ebe6b0acc5a9a0de9d8482387178d68fa794b.tar.bz2 |
[svn-r12790] Add a new batch file to test h5stat.
Update repacktest.bat for the new h5repack test.
Update tooltest.bat to include h5stat test.
Diffstat (limited to 'windows')
-rwxr-xr-x | windows/tools/repacktest.BAT | 7 | ||||
-rw-r--r-- | windows/tools/stattest.BAT | 150 | ||||
-rwxr-xr-x | windows/tools/tooltest.bat | 17 |
3 files changed, 167 insertions, 7 deletions
diff --git a/windows/tools/repacktest.BAT b/windows/tools/repacktest.BAT index 0aa41ad..440f5e4 100755 --- a/windows/tools/repacktest.BAT +++ b/windows/tools/repacktest.BAT @@ -168,14 +168,14 @@ call %tooltest% %test0% %nodiff% :: call ..\..\tooltest ..\..\testfiles\test1.h5 ..\..\temptest\notcomp.txt
set flag=-i %test1% -o %output1%
-call %tooltest% %test1% %notcomp%
+call %tooltest% %test1% %nodiff%
::--------------
:: test2.h5
::--------------
set flag=-i %test2% -o %output2%
-call %tooltest% %test2% %notcomp%
+call %tooltest% %test2% %nodiff%
::--------------
:: test3.h5
@@ -469,6 +469,9 @@ call %tooltest% %test4% %nodiff% set flag=-i %test4% -o %output4% -l dset_chunk:CONTI
call %tooltest% %test4% %nodiff%
+set flag=-i %test1% -o %output1% -n
+call %tooltest% %test4% %nodiff%
+
cd ..\..
echo.
diff --git a/windows/tools/stattest.BAT b/windows/tools/stattest.BAT new file mode 100644 index 0000000..613237f --- /dev/null +++ b/windows/tools/stattest.BAT @@ -0,0 +1,150 @@ +@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 h5stat tests.
+::Usage
+:: stattest release -- release static version
+:: stattest debug -- debug static version
+:: stattest release dll -- release dll version
+:: stattest debug dll -- debug dll version
+:: Written By:MuQun Yang
+:: Date : Oct. 18, 2006
+
+:: Track total number of testing errors
+ set /A totalerr=0
+ set /A totalskip=0
+
+::**********************************************
+:: Generate a new temp directory for test h5stat
+::**********************************************
+
+:: Make a tempory directory for stattest
+ mkdir temptest
+
+::****************************************************
+:: Set the Environment Variables & Change Dir to .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
+
+ :: Set up some variables for convenience
+ :: tempResults will contain the tests results temporarily
+ set tempResults=stattest%p2%_%p1%.txt
+ :: exefile will contain the file name of the executable file
+ set exefile=h5stat%p2%
+ :: tooltest is the sub-batch file which will be called by tool test
+ set tooltest=..\..\tooltest
+ ::Handle the expected file and the actual output file
+ ::ln is the total line numbers to be deleted from the actual output
+ set ln=1
+ ::ln_exp is the total line numbers to be deleted from the expected output
+ set ln_exp=4
+
+ :: NOTE1
+ ::Set some variables to contain .h5 file and its path for convenience
+
+ set file1=..\..\misc\testfiles\h5stat_filters.h5
+
+ ::Create the file to contain the tests output
+ type nul > %tempResults%
+
+ ::Change directory to the directory where the .exe file is located
+ cd h5stat%p2%\%p1%
+
+::*********************************************
+:: Test each function by calling TOOLTEST.BAT
+::*********************************************
+::USAGE of stattest.bat
+::1. Set flag
+::2. Call batch file tooltest.bat followed with the expected file name
+::3. Example
+::If we want to test h5stat \testfiles\file1.h5
+::At first, we need to set the flag like
+::set flag=%file1%
+::Secondly, we call batch file tooltest.bat by
+::call %tooltest% h5stat_1.txt
+
+echo.
+echo.****************************************************
+echo. H5stat%2 %1 T E S T S
+echo.****************************************************
+
+::--------------
+::Common usage
+::--------------
+
+::1.0 help message
+set flag=-h
+call %tooltest% h5stat_help1.ddl
+
+::1.1 another way to generate "help message"
+set flag=--help
+call %tooltest% h5stat_help2.ddl
+
+::1.2 all statisical information
+set flag=%file1%
+call %tooltest% h5stat_filters.ddl
+
+::1.3 print file information
+set flag=-f %file1%
+call %tooltest% h5stat_filters-file.ddl
+
+::1.4 print file metadata information
+set flag=-F %file1%
+call %tooltest% h5stat_filters-F.ddl
+
+::1.5 print dataset information
+set flag=-d %file1%
+call %tooltest% h5stat_filters-d.ddl
+
+::1.6 print group information
+set flag=-g %file1%
+call %tooltest% h5stat_filters-g.ddl
+
+::1.7 print datatype metadata
+set flag=%file1% -dT
+::call %tooltest% h5stat_filters-dT.ddl
+
+
+::Change directory to hdf5\tools
+cd ..\..
+
+::Check if any of tests failed or skiped for the time being
+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!
+find "SKIPED" %tempResults% | more +2
+)
+
+::NOTE1 CLEAN
+::Clean up Environment Variables
+for %%i in (p1 p2 tempResults exefile tooltest ln ln_exp totalskip totalerr file1) do set %%i=
+set flag=
+
+::Clean up Temporary Files
+:: rmdir /s/q temptest
+
+
diff --git a/windows/tools/tooltest.bat b/windows/tools/tooltest.bat index b3e648a..2a9d448 100755 --- a/windows/tools/tooltest.bat +++ b/windows/tools/tooltest.bat @@ -18,8 +18,11 @@ ::---importtest.bat
::---lstest.bat
::---repacktest.bat
+::---stattest.bat
:: Written By: Fang GUO
:: Date : Jan. 12, 2006
+:: Modified By: MuQun Yang
+:: Date : Oct. 19, 2006
:: Setting the starting column number for "PASSED/FAILED/SKIPED"
@@ -35,6 +38,7 @@ if %test_exefile%==h5diff goto COMMON
if %test_exefile%==h5dump goto DUMP
if %test_exefile%==h5ls goto COMMON
+ if %test_exefile%==h5stat goto COMMON
if %test_exefile%==h5import goto IMPORT
:: This block is for Repack test
@@ -177,11 +181,10 @@ :: Call tooltest with the following parameters set in difftest.bat
:: 1. expected_outputfile.txt
:: 2. flags
-
+
::Set a flaghandle for output tests results
set flagout=%flag:..\..\testfiles\=%
- set flagout=%flagout:..\..\temptest\=%
-
+ set flagout=%flagout:..\..\temptest\=%
if "%2%"=="SKIP" goto SKIP
::Set the file name and path for the expected and actual outputs
set exp_file=..\..\temptest\%1
@@ -193,8 +196,12 @@ if "%2%"=="MASK" goto MASK
more /e +%ln% ..\..\temptest\temp.txt > %actual_output%
- more /e +%ln_exp% ..\..\testfiles\%1 > %exp_file%
-
+
+ if %test_exefile%==h5stat (
+ more /e +%ln_exp% ..\..\misc\testfiles\%1 > %exp_file%
+ ) else (
+ more /e +%ln_exp% ..\..\testfiles\%1 > %exp_file%
+ )
::Clean up temporary file
del ..\..\temptest\temp.txt
goto RESULTS
|