diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2009-10-22 21:23:59 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2009-10-22 21:23:59 (GMT) |
commit | 5d27012937307b5027ae28d17715b12ea959cc29 (patch) | |
tree | 479538b56d79dae19dccdb295c85822872482d67 /windows/test | |
parent | 3916f4ef4d59da0d8939ec06dcd6dc5079c2cc70 (diff) | |
download | hdf5-5d27012937307b5027ae28d17715b12ea959cc29.zip hdf5-5d27012937307b5027ae28d17715b12ea959cc29.tar.gz hdf5-5d27012937307b5027ae28d17715b12ea959cc29.tar.bz2 |
[svn-r17726] Updated the errorlevel checking for better error handling in the windows batch files.
Diffstat (limited to 'windows/test')
-rw-r--r-- | windows/test/checktests.bat | 21 | ||||
-rw-r--r-- | windows/test/testerror.bat | 10 |
2 files changed, 22 insertions, 9 deletions
diff --git a/windows/test/checktests.bat b/windows/test/checktests.bat index 6b11615..2665836 100644 --- a/windows/test/checktests.bat +++ b/windows/test/checktests.bat @@ -22,6 +22,8 @@ rem setlocal enabledelayedexpansion
pushd %~dp0
+set /a nerrors=0
+
rem Clean any variables starting with "HDF5_LIBTEST_", as we use these for our
rem tests. Also clear "HDF5_LIBTEST_TESTS", as we will be addding all of our tests
rem to this variable.
@@ -61,12 +63,16 @@ rem %2 - "dll" or nothing rem Only add our parameters for batch scripts.
call !hdf5_libtest_%%a_test:.bat= %1 %2!
rem Exit early if test fails.
- if !errorlevel! neq 0 exit /b
+ if errorlevel 1 (
+ set /a nerrors=!nerrors!+1
+ echo.
+ echo.************************************
+ echo. Testing %%a ^(%1 %2^) FAILED
+ exit /b 1
+ )
)
rem If we get here, that means all of our tests passed.
- echo.All library tests passed.
-
exit /b
@@ -131,6 +137,11 @@ rem on it for sending parameters. --SJW 9/6/07 rem Run the tests, passing in which version to run
call :run_tests %*
+ if "%nerrors%"=="0" (
+ echo.All library tests passed.
+ ) else (
+ echo.** FAILED Library tests.
+ )
+
popd
- endlocal & exit /b
-
\ No newline at end of file + endlocal & exit /b %nerrors%
diff --git a/windows/test/testerror.bat b/windows/test/testerror.bat index 844e69c..24d39e0 100644 --- a/windows/test/testerror.bat +++ b/windows/test/testerror.bat @@ -146,11 +146,11 @@ rem )
fc /w %expect1_parsed% %actual% > nul
- if %errorlevel% equ 0 (
+ if errorlevel 0 (
call :testing PASSED %test_err%
) else (
fc /w %expect2_parsed% %actual% > nul
- if !errorlevel! equ 0 (
+ if errorlevel 0 (
call :testing PASSED %test_err%
) else (
call :testing *FAILED* %test_err%
@@ -193,9 +193,11 @@ rem ############################################################################ rem test for error_test
call :test error_test %1 %2
- if %nerrors% equ 0 (
+ if "%nerrors%"=="0" (
echo.All Error API tests passed.
- )
+ ) else (
+ echo.** FAILED Error API tests
+ )
popd
endlocal & exit /b %nerrors%
|