2011-11-17 02:44:16 +00:00
|
|
|
@echo off
|
2014-11-22 07:42:28 +00:00
|
|
|
@set TMPTEST=temptest.txt
|
2011-11-17 02:44:16 +00:00
|
|
|
REM onetest.cmd - execute a single test case
|
|
|
|
REM
|
|
|
|
REM (c) 1998-2006 (W3C) MIT, ERCIM, Keio University
|
|
|
|
REM See tidy.c for the copyright notice.
|
|
|
|
REM
|
|
|
|
REM <URL:http://tidy.sourceforge.net/>
|
|
|
|
REM
|
|
|
|
|
|
|
|
@if "%TIDY%." == "." goto Err1
|
|
|
|
@if NOT EXIST %TIDY% goto Err2
|
|
|
|
@if "%TIDYOUT%." == "." goto Err3
|
|
|
|
@if NOT EXIST %TIDYOUT%\nul goto Err4
|
|
|
|
@if NOT EXIST input\nul goto Err5
|
|
|
|
|
|
|
|
set TESTNO=%1
|
|
|
|
set EXPECTED=%2
|
|
|
|
|
|
|
|
set INFILES=input\in_%1.*ml
|
|
|
|
set CFGFILE=input\cfg_%1.txt
|
|
|
|
|
|
|
|
set TIDYFILE=%TIDYOUT%\out_%1.html
|
|
|
|
set MSGFILE=%TIDYOUT%\msg_%1.txt
|
|
|
|
|
|
|
|
set HTML_TIDY=
|
|
|
|
|
|
|
|
REM If no test specific config file, use default.
|
|
|
|
if NOT exist %CFGFILE% set CFGFILE=input\cfg_default.txt
|
|
|
|
|
|
|
|
REM Get specific input file name
|
|
|
|
@set INFILE=
|
|
|
|
for %%F in ( %INFILES% ) do set INFILE=%%F
|
|
|
|
@if "%INFILE%." == "." goto Err6
|
|
|
|
@if NOT EXIST %INFILE% goto Err7
|
|
|
|
|
|
|
|
REM Remove any pre-exising test outputs
|
|
|
|
if exist %MSGFILE% del %MSGFILE%
|
|
|
|
if exist %TIDYFILE% del %TIDYFILE%
|
|
|
|
|
|
|
|
@REM Noisy output, or quiet
|
|
|
|
@REM echo Testing %1 input %INFILE% config %CFGFILE% ...
|
2014-11-22 07:42:28 +00:00
|
|
|
@echo Testing %1, expect %EXPECTED%
|
|
|
|
@echo Testing %1, expect %EXPECTED% >> %TMPTEST%
|
|
|
|
@echo Doing: '%TIDY% -f %MSGFILE% -config %CFGFILE% %3 %4 %5 %6 %7 %8 %9 --tidy-mark no -o %TIDYFILE% %INFILE% >> %TMPTEST%
|
|
|
|
|
|
|
|
@%TIDY% -f %MSGFILE% -config %CFGFILE% %3 %4 %5 %6 %7 %8 %9 --tidy-mark no -o %TIDYFILE% %INFILE%
|
|
|
|
@set STATUS=%ERRORLEVEL%
|
|
|
|
|
|
|
|
@if %STATUS% EQU %EXPECTED% goto done
|
|
|
|
@set ERRTESTS=%ERRTESTS% %TESTNO%
|
|
|
|
@echo *** Failed - got %STATUS%, expected %EXPECTED% ***
|
|
|
|
@type %MSGFILE%
|
|
|
|
@echo *** Failed - got %STATUS%, expected %EXPECTED% *** >> %TMPTEST%
|
|
|
|
@type %MSGFILE% >> %TMPTEST%
|
2011-11-17 02:44:16 +00:00
|
|
|
goto done
|
|
|
|
|
|
|
|
:Err1
|
|
|
|
@echo ==============================================================
|
|
|
|
@echo ERROR: runtime exe not set in TIDY environment variable ...
|
|
|
|
@echo ==============================================================
|
|
|
|
@goto TRYAT
|
|
|
|
|
|
|
|
:Err2
|
|
|
|
@echo ==============================================================
|
|
|
|
@echo ERROR: runtime exe %TIDY% not found ... check name, location ...
|
|
|
|
@echo ==============================================================
|
|
|
|
@goto TRYAT
|
|
|
|
|
|
|
|
:Err3
|
|
|
|
@echo ==============================================================
|
|
|
|
@echo ERROR: output folder TIDYOUT not set in environment ...
|
|
|
|
@echo ==============================================================
|
|
|
|
@goto TRYAT
|
|
|
|
|
|
|
|
:Err4
|
|
|
|
@echo ==============================================================
|
|
|
|
@echo ERROR: output folder %TIDYOUT% does not exist ...
|
|
|
|
@echo ==============================================================
|
|
|
|
@goto TRYAT
|
|
|
|
|
|
|
|
:Err5
|
|
|
|
@echo ==============================================================
|
|
|
|
@echo ERROR: input folder 'input' does not exist ... check name, location ..
|
|
|
|
@echo ==============================================================
|
|
|
|
@goto TRYAT
|
|
|
|
|
|
|
|
:TRYAT
|
2014-11-22 07:42:28 +00:00
|
|
|
@echo Try running alltest1.cmd ..\build\cmake\Release\Tidy5.exe tmp
|
2011-11-17 02:44:16 +00:00
|
|
|
@echo ==============================================================
|
2014-11-22 07:42:28 +00:00
|
|
|
@pause
|
2011-11-17 02:44:16 +00:00
|
|
|
@goto done
|
|
|
|
|
|
|
|
:Err6
|
|
|
|
@echo ==============================================================
|
|
|
|
@echo ERROR: Failed to find input matching '%INFILES%'!!!
|
|
|
|
@echo ==============================================================
|
|
|
|
@pause
|
|
|
|
@goto done
|
|
|
|
|
|
|
|
:Err7
|
|
|
|
@echo ==============================================================
|
|
|
|
@echo ERROR: Failed to find input file '%INFILE%'!!!
|
|
|
|
@echo ==============================================================
|
|
|
|
@pause
|
|
|
|
@goto done
|
|
|
|
|
|
|
|
:done
|