Re: [xml] XPath Regression Fails on Win32 for libxml2-2.6.19



Um, I wrote those a while ago while playing with windows cmd scripting to mimic
the *nix shell equivalents with the hope of having make tests run on win32
also.  Since then I've probably used 10+ versions of libx.* and frankly haven't
run those tests once, so no shock if it's broken.  

I can't validate if those proposed changes are correct or not, it would be a
good exerciise to properly implement the existing regression test on win32, but
I rely on my own tests instead.  If someone cares about this they should speak
up, otherwise a disclaimer is perhaps in order, b/c to be honest I don't use
'em and the implementation certainly isn't maintained.

--- Rush Manbert <rush manbert com> wrote:

Hello,

I have built libxml2 version 2.6.19 on Windows XP using the method 
described in the win32 subdirectory. The library builds, but it fails if 
I run the tests by specifying the tests target to nmake.

After a lot of fooling around, I finally modified win32\Makefile.msvc so 
I could see what was happening.

I replaced lines 347 through 360 with the following:
    @echo ## XPath regression tests part 2
    @for %%I in ($(XML_SRCDIR)\test\XPath\docs\*.*) do @( \
        @echo I: %%I &&\
        for %%J in ($(XML_SRCDIR)\test\XPath\tests\%%~nxI*.*) do @( \
            @echo   J: %%J &&\
            if not exist $(XML_SRCDIR)\result\XPath\tests\%%~nxJ ( \
                $(BINDIR)\testXPath.exe -f -i %%I %%J > 
$(XML_SRCDIR)\result\XPath\tests\%%~nxJ &&\
                findstr /C:"MEMORY ALLOCATED" .memdump | findstr 
/C:"MEMORY ALLOCATED : 0" > nul \
            ) ELSE ( \
                @echo   ELSE: &&\
                @echo     testXPAth &&\
                $(BINDIR)\testXPAth.exe -f -i %%I %%J 2>&1 > 
result.%%~nxJ &&\
                copy .memdump .memdump.%%~nxJ &\
                @echo     findstr &&\
                findstr /C:"MEMORY ALLOCATED" .memdump | findstr 
/C:"MEMORY ALLOCATED : 0">null &&\
                @echo     fc &&\
                fc $(XML_SRCDIR)\result\XPath\tests\%%~nxJ result.%%~nxJ 
 >null & \
                @echo IF ERRORLEVEL: &\
                IF ERRORLEVEL 1 (echo Error: %%I %%J & exit 1) & \
                del result.%%~nxJ \
            )\
        )\
    )

With these changes, here is the interesting part of the output:
## XPath regression tests
## XPath regression tests part 2
I: ..\test\XPath\docs\chapters
J: ..\test\XPath\tests\chaptersbase
ELSE:
testXPAth
        1 file(s) copied.
findstr
J: ..\test\XPath\tests\chaptersprefol
ELSE:
testXPAth
        1 file(s) copied.
findstr
I: ..\test\XPath\docs\id
J: ..\test\XPath\tests\idsimple
ELSE:
testXPAth
        1 file(s) copied.
findstr
I: ..\test\XPath\docs\simple
J: ..\test\XPath\tests\simpleabbr
ELSE:
testXPAth
        1 file(s) copied.
findstr
J: ..\test\XPath\tests\simplebase
ELSE:
testXPAth
        1 file(s) copied.
findstr
I: ..\test\XPath\docs\str
I: ..\test\XPath\docs\usr1
J: ..\test\XPath\tests\usr1check
ELSE:
testXPAth
        1 file(s) copied.
findstr
I: ..\test\XPath\docs\vid
J: ..\test\XPath\tests\vidbase
ELSE:
testXPAth
        1 file(s) copied.
findstr
NMAKE : fatal error U1077: 'for' : return code '0x1'
Stop.

Each of my .memdump.* files is empty, which appears to make findstr 
fail, because fc never gets run. I guess the error return from findstr 
at the end of the for loop must be what makes nmake quit, because the IF 
ERRORLVEL was never executed.

If I change the "&&" at the end of the findstr line to "&", so that the 
fc always gets run, the tests pass and I get this output:
## XPath regression tests
## XPath regression tests part 2
I: ..\test\XPath\docs\chapters
J: ..\test\XPath\tests\chaptersbase
ELSE:
testXPAth
        1 file(s) copied.
findstr
fc
IF ERRORLEVEL:
J: ..\test\XPath\tests\chaptersprefol
ELSE:
testXPAth
        1 file(s) copied.
findstr
fc
IF ERRORLEVEL:
I: ..\test\XPath\docs\id
J: ..\test\XPath\tests\idsimple
ELSE:
testXPAth
        1 file(s) copied.
findstr
fc
IF ERRORLEVEL:
I: ..\test\XPath\docs\simple
J: ..\test\XPath\tests\simpleabbr
ELSE:
testXPAth
        1 file(s) copied.
findstr
fc
IF ERRORLEVEL:
J: ..\test\XPath\tests\simplebase
ELSE:
testXPAth
        1 file(s) copied.
findstr
fc
IF ERRORLEVEL:
I: ..\test\XPath\docs\str
I: ..\test\XPath\docs\usr1
J: ..\test\XPath\tests\usr1check
ELSE:
testXPAth
        1 file(s) copied.
findstr
fc
IF ERRORLEVEL:
I: ..\test\XPath\docs\vid
J: ..\test\XPath\tests\vidbase
ELSE:
testXPAth
        1 file(s) copied.
findstr
fc
IF ERRORLEVEL:


After making this change, I went and modified one of the files in 
..\test\XPath\tests and verified that the test fails as expected.

My conclusion is that if I just make the change from "&&" to "&" on the 
findstr command line, then things will work, but I really don't 
understand what the intent is for the findstr command. If I make the 
change, then we will discard the result of the findstr.

I didn't see anything in the archives about this, which makes me a 
little nervous. Has anyone else seen this under Windows and can anyone 
tell me whether the change I have made is the correct fix?

Thanks,
Rush
_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
xml gnome org
http://mail.gnome.org/mailman/listinfo/xml





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]