From 56caada315bb00450c667e89513ae2eb3d520483 Mon Sep 17 00:00:00 2001 From: Scott Wegner Date: Fri, 30 May 2008 10:54:14 -0500 Subject: [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 --- windows/tools/h5dump/testh5dumpxml.bat | 19 ++++++++++++++----- 1 file 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 -- cgit v0.12