summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Wegner <swegner@hdfgroup.org>2008-05-30 15:54:14 (GMT)
committerScott Wegner <swegner@hdfgroup.org>2008-05-30 15:54:14 (GMT)
commit56caada315bb00450c667e89513ae2eb3d520483 (patch)
tree2b1b1d1887001137ba56163671eb9eabf8c9876c
parent93eb1b897295d6eb6717eeb241cb1a8322077e5e (diff)
downloadhdf5-56caada315bb00450c667e89513ae2eb3d520483.zip
hdf5-56caada315bb00450c667e89513ae2eb3d520483.tar.gz
hdf5-56caada315bb00450c667e89513ae2eb3d520483.tar.bz2
[svn-r15104] Purpose: Work around Windows FC bug in h5dump xml test script
Description: In some rare instances, FC (diff equivalent) command on Windows will fail when comparing ASCII files with opposite line-ending formats (Unix uses LF, while Windows uses CRLF). This was an issue for one test case in our test script. It only came up when testing from a release tarball, because the expected output was not converted to Windows-style. In this situation, FC was reporting false differences. To workaround, we double-check failure cases and convert the EOL characters if neccessary. Tested: VS2005 on WinXP
-rw-r--r--windows/tools/h5dump/testh5dumpxml.bat19
1 files changed, 14 insertions, 5 deletions
diff --git a/windows/tools/h5dump/testh5dumpxml.bat b/windows/tools/h5dump/testh5dumpxml.bat
index 1b7893e..63356aa 100644
--- a/windows/tools/h5dump/testh5dumpxml.bat
+++ b/windows/tools/h5dump/testh5dumpxml.bat
@@ -63,6 +63,7 @@ rem non-zero value.
rem
:tooltest
set expect=%CD%\..\testfiles\%1
+ set expect_eol=%CD%\..\testfiles\%~n1.eol
set actual=%CD%\..\testfiles\%~n1.out
set actual_err=%CD%\..\testfiles\%~n1.err
@@ -93,15 +94,23 @@ rem
if !errorlevel! equ 0 (
call :testing PASSED %params%
) else (
- call :testing *FAILED* %params%
- echo. Expected results ^(*.ddl^) differs from actual results ^(*.out^)
- set /a nerrors=!nerrors!+1
- if "yes"=="%verbose%" fc /w %expect% %actual%
+ rem First, check if the error is caused by Unix-style EOL, because
+ rem FC can fail incorrectly when comparing them. --SJW 5/30/08
+ more < %expect% > %expect_eol%
+ fc /w %expect_eol% %actual% > nul
+ if !errorlevel! equ 0 (
+ call :testing PASSED %params%
+ ) else (
+ call :testing *FAILED* %params%
+ echo. Expected results ^(*.ddl^) differs from actual results ^(*.out^)
+ set /a nerrors=!nerrors!+1
+ if "yes"=="%verbose%" fc /w %expect% %actual%
+ )
)
)
rem Clean up output file
- if not defined HDF5_NOCLEANUP del /f %actual% %actual_err%
+ if not defined HDF5_NOCLEANUP del /f %expect_eol% %actual% %actual_err%
exit /b