summaryrefslogtreecommitdiffstats
path: root/windows/hl
diff options
context:
space:
mode:
authorScott Wegner <swegner@hdfgroup.org>2007-09-10 19:14:08 (GMT)
committerScott Wegner <swegner@hdfgroup.org>2007-09-10 19:14:08 (GMT)
commit43bb1ba8e53c3eb23448baba68485222514ab992 (patch)
treee32be74f0faad61cb3c3b29ead9849be5dc59a4d /windows/hl
parent33efca34cb30bcf7e17f6e3aa580233bd58a0075 (diff)
downloadhdf5-43bb1ba8e53c3eb23448baba68485222514ab992.zip
hdf5-43bb1ba8e53c3eb23448baba68485222514ab992.tar.gz
hdf5-43bb1ba8e53c3eb23448baba68485222514ab992.tar.bz2
[svn-r14138]
Diffstat (limited to 'windows/hl')
-rw-r--r--windows/hl/c++/test/checkhlcpptests.bat87
-rwxr-xr-xwindows/hl/c++/test/test_hdf5_hl_cpp.bat24
-rw-r--r--windows/hl/fortran/test/checkhlfortrantests.bat89
-rwxr-xr-xwindows/hl/fortran/test/test_hdf5_hl_fortran.BAT36
-rw-r--r--windows/hl/test/checkhltests.bat139
-rwxr-xr-xwindows/hl/test/test_hdf5_hl.BAT56
-rw-r--r--windows/hl/tools/gif2h5/h52giftest.bat134
7 files changed, 393 insertions, 172 deletions
diff --git a/windows/hl/c++/test/checkhlcpptests.bat b/windows/hl/c++/test/checkhlcpptests.bat
new file mode 100644
index 0000000..24b7f55
--- /dev/null
+++ b/windows/hl/c++/test/checkhlcpptests.bat
@@ -0,0 +1,87 @@
+@echo off
+rem
+rem Copyright by The HDF Group.
+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://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have
+rem access to either file, you may request a copy from help@hdfgroup.org.
+rem
+rem Tests for the hdf5 hl c++ library
+rem
+rem Created: Scott Wegner, 9/7/07
+rem Modified:
+rem
+
+setlocal enabledelayedexpansion
+pushd %~dp0
+
+rem Clean any variables starting with "HDF5_HLCPPTEST_", as we use these for our
+rem tests. Also clear "HDF5_HLCPPTEST_TESTS", as we will be addding all of our tests
+rem to this variable.
+rem Set at least one variable in set beforehand to avoid error message.
+rem --SJW 9/5/07
+set hdf5_hlcpptest_=foo
+for /f "tokens=1 delims==" %%a in ('set hdf5_hlcpptest_') do set %%a=
+set hdf5_hlcpptest_tests=
+
+goto main
+
+
+rem Function to add a test to the test suite.
+rem Expects the following parameters:
+rem %1 - Name of the hlcpptest being tested
+rem %2 - Relative path of script
+:add_test
+
+ set hdf5_hlcpptest_tests=%hdf5_hlcpptest_tests% %1
+ set hdf5_hlcpptest_%1_test=%CD%\%2\%1
+
+ exit /b
+
+
+rem Run all of the tests that have been added to the suite. Print a header
+rem at the beginning of each one. Short-circuit if a test fails.
+rem Expects the following parameters:
+rem %1 - release or debug version
+rem %2 - "dll" or nothing
+:run_tests
+ for %%a in (%hdf5_hlcpptest_tests%) do (
+ echo.
+ echo.************************************
+ echo. Testing %%a ^(%1 %2^)
+ echo.************************************
+
+ rem Only add our parameters for batch scripts.
+ call !hdf5_hlcpptest_%%a_test:.bat= %1 %2!
+ rem Exit early if test fails.
+ if !errorlevel! neq 0 exit /b
+ )
+
+ rem If we get here, that means all of our tests passed.
+ echo.All HL C++ library tests passed.
+
+ exit /b
+
+
+rem This is where we add tests to the suite, and run them all at the end.
+rem Make sure only to run dll versions of tests you build dll for
+rem Also make sure to add *.bat to batch scripts, as the above functions rely
+rem on it for sending parameters. --SJW 9/6/07
+:main
+
+ call :add_test hl_test_table_cpp%2 .\hl_test_table_cpp%2\%1
+
+
+ rem Run the tests, passing in which version to run
+ call :run_tests %*
+
+ popd
+ endlocal & exit /b
+ \ No newline at end of file
diff --git a/windows/hl/c++/test/test_hdf5_hl_cpp.bat b/windows/hl/c++/test/test_hdf5_hl_cpp.bat
deleted file mode 100755
index bf9b70c..0000000
--- a/windows/hl/c++/test/test_hdf5_hl_cpp.bat
+++ /dev/null
@@ -1,24 +0,0 @@
-@REM Copyright by The HDF Group.
-@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://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have
-@REM access to either file, you may request a copy from help@hdfgroup.org.
-
-@ECHO OFF
-
-@REM This batch file will be used to test HDF5 High Level C++ Library.
-@REM By Fang GUO
-@REM Created on: 05/27/2005
-
-echo.
-echo ===============================================
-echo Testing hl_test_table_cpp%2 -- %1
-echo ===============================================
-hl_test_table_cpp%2\%1\hl_test_table_cpp%2 \ No newline at end of file
diff --git a/windows/hl/fortran/test/checkhlfortrantests.bat b/windows/hl/fortran/test/checkhlfortrantests.bat
new file mode 100644
index 0000000..98d9c38
--- /dev/null
+++ b/windows/hl/fortran/test/checkhlfortrantests.bat
@@ -0,0 +1,89 @@
+@echo off
+rem
+rem Copyright by The HDF Group.
+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://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have
+rem access to either file, you may request a copy from help@hdfgroup.org.
+rem
+rem Tests for the hdf5 hl fortran library
+rem
+rem Created: Scott Wegner, 9/6/07
+rem Modified:
+rem
+
+setlocal enabledelayedexpansion
+pushd %~dp0
+
+rem Clean any variables starting with "HDF5_HLFORTTEST_", as we use these for our
+rem tests. Also clear "HDF5_HLFORTTEST_TESTS", as we will be addding all of our tests
+rem to this variable.
+rem Set at least one variable in set beforehand to avoid error message.
+rem --SJW 9/5/07
+set hdf5_hlforttest_=foo
+for /f "tokens=1 delims==" %%a in ('set hdf5_hlforttest_') do set %%a=
+set hdf5_hlforttest_tests=
+
+goto main
+
+
+rem Function to add a test to the test suite.
+rem Expects the following parameters:
+rem %1 - Name of the hlforttest being tested
+rem %2 - Relative path of script
+:add_test
+
+ set hdf5_hlforttest_tests=%hdf5_hlforttest_tests% %1
+ set hdf5_hlforttest_%1_test=%CD%\%2\%1
+
+ exit /b
+
+
+rem Run all of the tests that have been added to the suite. Print a header
+rem at the beginning of each one. Short-circuit if a test fails.
+rem Expects the following parameters:
+rem %1 - release or debug version
+rem %2 - "dll" or nothing
+:run_tests
+ for %%a in (%hdf5_hlforttest_tests%) do (
+ echo.
+ echo.************************************
+ echo. Testing %%a ^(%1 %2^)
+ echo.************************************
+
+ rem Only add our parameters for batch scripts.
+ call !hdf5_hlforttest_%%a_test:.bat= %1 %2!
+ rem Exit early if test fails.
+ if !errorlevel! neq 0 exit /b
+ )
+
+ rem If we get here, that means all of our tests passed.
+ echo.All HL Fortran library tests passed.
+
+ exit /b
+
+
+rem This is where we add tests to the suite, and run them all at the end.
+rem Make sure only to run dll versions of tests you build dll for
+rem Also make sure to add *.bat to batch scripts, as the above functions rely
+rem on it for sending parameters. --SJW 9/6/07
+:main
+
+ call :add_test hl_test_lite_fortran%2 .\hl_test_lite_fortran%2\%1
+ call :add_test hl_test_image_fortran%2 .\hl_test_image_fortran%2\%1
+ call :add_test hl_test_table_fortran%2 .\hl_test_table_fortran%2\%1
+
+
+ rem Run the tests, passing in which version to run
+ call :run_tests %*
+
+ popd
+ endlocal & exit /b
+ \ No newline at end of file
diff --git a/windows/hl/fortran/test/test_hdf5_hl_fortran.BAT b/windows/hl/fortran/test/test_hdf5_hl_fortran.BAT
deleted file mode 100755
index 95e4539..0000000
--- a/windows/hl/fortran/test/test_hdf5_hl_fortran.BAT
+++ /dev/null
@@ -1,36 +0,0 @@
-@REM Copyright by The HDF Group.
-@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://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have
-@REM access to either file, you may request a copy from help@hdfgroup.org.
-
-@ECHO OFF
-
-REM This batch file will be used to test HDF5 High Level Fortran Library.
-REM By Xuan Bai
-REM Last Modified on: 07/15/2005
-
-echo.
-echo ===============================================
-echo Testing hl_test_lite_fortran%2 -- %1
-echo ===============================================
-hl_test_lite_fortran%2\%1\hl_test_lite_fortran%2
-
-echo.
-echo ===============================================
-echo Testing hl_test_image_fortran%2 -- %1
-echo ===============================================
-hl_test_image_fortran%2\%1\hl_test_image_fortran%2
-
-echo.
-echo ===============================================
-echo Testing hl_test_table_fortran%2 -- %1
-echo ===============================================
-hl_test_table_fortran%2\%1\hl_test_table_fortran%2 \ No newline at end of file
diff --git a/windows/hl/test/checkhltests.bat b/windows/hl/test/checkhltests.bat
new file mode 100644
index 0000000..925c245
--- /dev/null
+++ b/windows/hl/test/checkhltests.bat
@@ -0,0 +1,139 @@
+@echo off
+rem
+rem Copyright by The HDF Group.
+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://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have
+rem access to either file, you may request a copy from help@hdfgroup.org.
+rem
+rem Tests for the hdf5 HL library
+rem
+rem Created: Scott Wegner, 9/10/07
+rem Modified:
+rem
+
+setlocal enabledelayedexpansion
+pushd %~dp0
+
+rem Clean any variables starting with "HDF5_HLTEST_", as we use these for our
+rem tests. Also clear "HDF5_HLTEST_TESTS", as we will be addding all of our tests
+rem to this variable.
+rem Set at least one variable in set beforehand to avoid error message.
+rem --SJW 9/5/07
+set hdf5_hltest_=foo
+for /f "tokens=1 delims==" %%a in ('set hdf5_hltest_') do set %%a=
+set hdf5_hltest_tests=
+
+rem See if we have built the HL C++ / Fortran libraries, and set
+rem BUILD_*_CONDITIONAL appropriately
+call :check_built fortran %*
+call :check_built cxx %*
+
+goto main
+
+
+rem Function to add a test to the test suite.
+rem Expects the following parameters:
+rem %1 - Name of the hltest being tested
+rem %2 - Relative path of script
+:add_test
+
+ set hdf5_hltest_tests=%hdf5_hltest_tests% %1
+ set hdf5_hltest_%1_test=%CD%\%2\%1
+
+ exit /b
+
+
+rem Run all of the tests that have been added to the suite. Print a header
+rem at the beginning of each one. Short-circuit if a test fails.
+rem Expects the following parameters:
+rem %1 - release or debug version
+rem %2 - "dll" or nothing
+:run_tests
+ for %%a in (%hdf5_hltest_tests%) do (
+ echo.
+ echo.************************************
+ echo. Testing %%a ^(%1 %2^)
+ echo.************************************
+
+ rem Only add our parameters for batch scripts.
+ call !hdf5_hltest_%%a_test:.bat= %1 %2!
+ rem Exit early if test fails.
+ if !errorlevel! neq 0 exit /b
+ )
+
+ rem If we get here, that means all of our tests passed.
+ echo.All HL library tests passed.
+
+ exit /b
+
+
+rem Check to see if one of our output files exist for the given parameter. If
+rem it does, we can assume that that set of files were set to build, and we can
+rem test them. In Linux, the corresponding variable is set by the Makefile.
+rem Expects the following parameters:
+rem %1 - fortran or cxx
+rem %2 - debug or release
+rem %3 - dll or nothing
+:check_built
+
+ rem diffuse early if the variable is already defined
+ if defined build_%1_conditional exit /b
+
+ if /i "%1" equ "cxx" (
+ if "%2"=="release" (
+ set hdf5_hl_cpp=hdf5_hl_cpp%3.lib
+ ) else (
+ set hdf5_hl_cpp=hdf5_hl_cppd%3.lib
+ )
+
+ if exist %CD%\..\..\proj\hdf5_hl_cpp%3\%2\!hdf5_hl_cpp! (
+ set build_cxx_conditional=true
+ )
+ ) else if /i "%1" equ "fortran" (
+ if "%2"=="release" (
+ set hdf5_hl_fortran=hdf5_hl_fortran%3.lib
+ ) else (
+ set hdf5_hl_fortran=hdf5_hl_fortrand%3.lib
+ )
+
+ if exist %CD%\..\..\proj\hdf5_hl_fortran%3\%2\!hdf5_hl_fortran! (
+ set build_fortran_conditional=true
+ )
+ )
+
+ exit /b
+
+rem This is where we add tests to the suite, and run them all at the end.
+rem Make sure only to run dll versions of tests you build dll for
+rem Also make sure to add *.bat to batch scripts, as the above functions rely
+rem on it for sending parameters. --SJW 9/6/07
+:main
+
+ call :add_test hl_test_lite%2 .\hl_test_lite%2\%1
+ call :add_test hl_test_image%2 .\hl_test_image%2\%1
+ call :add_test hl_test_table%2 .\hl_test_table%2\%1
+ call :add_test hl_test_ds%2 .\hl_test_ds%2\%1
+ call :add_test hl_test_packet%2 .\hl_test_packet%2\%1
+
+ rem Only check HL C++/Fortran if they are set to build.
+ if defined build_cxx_conditional (
+ call :add_test checkhlcpptests.bat ..\c++\test
+ )
+ if defined build_fortran_conditional (
+ call :add_test checkhlfortrantests.bat ..\fortran\test
+ )
+
+ rem Run the tests, passing in which version to run
+ call :run_tests %*
+
+ popd
+ endlocal & exit /b
+ \ No newline at end of file
diff --git a/windows/hl/test/test_hdf5_hl.BAT b/windows/hl/test/test_hdf5_hl.BAT
deleted file mode 100755
index d42aa86..0000000
--- a/windows/hl/test/test_hdf5_hl.BAT
+++ /dev/null
@@ -1,56 +0,0 @@
-@REM Copyright by The HDF Group.
-@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://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have
-@REM access to either file, you may request a copy from help@hdfgroup.org.
-
-@ECHO OFF
-
-@REM This batch file will be used to test HDF5 High Level Library.
-@REM By Xuan Bai
-@REM Last Modified on: 07/14/2005 by Fang GUO
-
-echo.
-echo ===============================================
-echo Testing hl_test_ds%2 -- %1
-echo ===============================================
-hl_test_ds%2\%1\hl_test_ds%2
-
-echo.
-echo ===============================================
-echo Testing hl_test_lite%2 -- %1
-echo ===============================================
-hl_test_lite%2\%1\hl_test_lite%2
-
-echo.
-echo ===============================================
-echo Testing hl_test_image%2 -- %1
-echo ===============================================
-hl_test_image%2\%1\hl_test_image%2
-
-echo.
-echo ===============================================
-echo Testing hl_test_table%2 -- %1
-echo ===============================================
-hl_test_table%2\%1\hl_test_table%2
-
-echo.
-echo ===============================================
-echo Testing hl_test_packet%2 -- %1
-echo ===============================================
-hl_test_packet%2\%1\hl_test_packet%2
-
-echo.
-echo ===============================================
-echo Testing h52gif and gif2h5 -- %1 %2
-echo ===============================================
-cd ..\tools\gif2h5
-call h52giftest %1 %2
-cd ..\..\test \ No newline at end of file
diff --git a/windows/hl/tools/gif2h5/h52giftest.bat b/windows/hl/tools/gif2h5/h52giftest.bat
index a28b484..80a5391 100644
--- a/windows/hl/tools/gif2h5/h52giftest.bat
+++ b/windows/hl/tools/gif2h5/h52giftest.bat
@@ -1,67 +1,89 @@
-@REM Copyright by The HDF Group.
-@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://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have
-@REM access to either file, you may request a copy from help@hdfgroup.org.
-
@echo off
+rem
+rem Copyright by The HDF Group.
+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://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have
+rem access to either file, you may request a copy from help@hdfgroup.org.
+rem
+rem HDF Utilities Test script
+rem
+rem Created: Scott Wegner, 4/5/07
+rem Modified: Scott Wegner, 8/22/07
+rem
-::This batch file is for h52gif tests.
-::Usage
-:: h52giftest release -- release static version
-:: h52giftest debug -- debug static version
-:: h52giftest release dll -- release dll version
-:: h52giftest debug dll -- debug dll version
-:: Written By: Scott Wegner
-:: Date : April 5, 2005
-
-
-REM Set up our environment
-
-mkdir temptest
-
-set TESTFILE1=..\testfiles\h52giftst.h5
-set TESTFILE2=..\testfiles\image1.gif
+setlocal enabledelayedexpansion
+pushd %~dp0
-set H52GIF=..\gifconv%2\h52gif%2\%1\h52gif%2.exe
-set GIF2H5=..\gifconv%2\gif2h5%2\%1\gif2h5%2.exe
+rem h52gif name
+set h52gif=h52gif%2
+rem The path to the h52gif binary
+set h52gif_bin=%CD%\..\gifconv%2\%h52gif%\%1\%h52gif%
+rem gif2h5 name
+set gif2h5=gif2h5%2
+rem The path to the gif2h5 binary
+set gif2h5_bin=%CD%\..\gifconv%2\%gif2h5%\%1\%gif2h5%
+set testfile1=%CD%\..\testfiles\h52giftst.h5
+set testfile2=%CD%\..\testfiles\image1.gif
-REM The tests
+rem initialze errors variable
+set errors=0
-REM TOOLTEST1 $TESTFILE1 image1.gif -i image
-%H52GIF% %TESTFILE1% image1.gif -i image 2>%1 > temptest\gifconv_1.results
-if %ERRORLEVEL% NEQ 0 (
- echo Testing h52gif h52giftst.h5 image1.gif -i image FAILED
- type temptest\gifconv_1.results
-) else (
- echo Testing h52gif h52giftst.h5 image1.gif -i image PASSED
-)
-del temptest\gifconv_1.results
+goto main
-REM TOOLTEST2 $TESTFILE2 image1.h5
-%GIF2H5% %TESTFILE2% image1.h5 2>%1 > temptest\gifconv_2.results
-if %ERRORLEVEL% NEQ 0 (
- echo Testing gif2h5 image1.gif image1.h5 FAILED
- type temptest\gifconv_2.results
-) else (
- echo Testing gif2h5 image1.gif image1.h5 PASSED
-)
-del temptest\gifconv_2.results
+:testing
+ set test_msg=Testing
+ for %%a in (%*) do (
+ if %%a neq PASSED (
+ if %%a neq *FAILED* (
+ set test_msg=!test_msg! %%~nxa
+ ) )
+ )
+ set test_msg=%test_msg%
+ echo.%test_msg:~0,69% %1
+
+ exit /b
-REM Cleanup
-set TESTFILE1=
-set TESTFILE2=
-set H52GIF=
-set GIF2H5=
+:tooltest1
+ %h52gif_bin% %*
+
+ if %errorlevel% neq 0 (
+ call :testing *FAILED* %h52gif_bin% %*
+ set /a errors=!errors!+1
+ ) else (
+ call :testing PASSED %h52gif_bin% %*
+ )
+
+ exit /b
+
-rmdir /s/q temptest \ No newline at end of file
+:tooltest2
+ %gif2h5_bin% %*
+
+ if %errorlevel% neq 0 (
+ call :testing *FAILED* %gif2h5_bin% %*
+ set /a errors=!errors!+1
+ ) else (
+ call :testing PASSED %gif2h5_bin% %*
+ )
+
+ exit /b
+
+
+:main
+ call :tooltest1 %testfile1% image1.gif -i image
+ call :tooltest2 %testfile2% image1.h5
+
+ popd
+ endlocal & exit /b %errors%
+ \ No newline at end of file