Page 1 of 1

Integrating CSE validator in hudson CI

Posted: Tue Mar 29, 2011 3:47 am
by sudheshna
Hi,

I have to integrate cse validator in hudson for html validation of the pages. Here we will have each html project folder under a root folder and by specifying the folder location hudson builds the files, but I need to integrate cse validator along with each build. This can be done with batch wizard in hudson. I have created one and executed, validations are working fine and im getting the results in mentioned output file, but its not returning actual error code even if there is error in the validated html files,

following is my code for validation,

Code: Select all

@echo on
setlocal enableextensions enabledelayedexpansion

PUSHD "F:\Solutions\GND\Documents\Design\html\ValTest"
For %%X in (*.html) do 
(
	"C:\Program Files\HTMLValidator100\cmdlineprocessor"  -outputfile output.txt   -r1 %%X

	SET HTML_VAL_ERROR=!ERRORLEVEL!
	echo !HTML_VAL_ERROR!

	type output.txt >> result.txt
	IF !HTML_VAL_ERROR! GEQ 1 
	(
		SET HTML_VAL_ERROR = 1 
		GOTO :EOF
	)
)

POPD
EndLocal
:EOF

 EXIT !HTML_VAL_ERROR!

Please any one can look in to this and help me to solve this, we have purchased a licence of validator but are unable to use it due to this issue.

Thanks
Sudheshna K

Re: Integrating CSE validator in hudson CI

Posted: Tue Mar 29, 2011 8:44 am
by Albert Wiersch
Hello,

Just to confirm, CSE HTML Validator is working as expected (with the expected return values) but your issue is with the script? Is that correct?

By the way, you may want to make sure that "%%X" is passing files enclosed in quotes, in case there is a space character.

Thank you.