2 @set TMPTEST=temptest.txt
3 REM onetest.cmd - execute a single test case
5 REM (c) 1998-2006 (W3C) MIT, ERCIM, Keio University
6 REM See tidy.c for the copyright notice.
8 REM <URL:http://www.html-tidy.org/>
11 @if "%TIDY%." == "." goto Err1
12 @if NOT EXIST %TIDY% goto Err2
13 @if "%TIDYOUT%." == "." goto Err3
14 @if NOT EXIST %TIDYOUT%\nul goto Err4
15 @if NOT EXIST input\nul goto Err5
20 set INFILES=input\in_%1.*ml
21 set CFGFILE=input\cfg_%1.txt
23 set TIDYFILE=%TIDYOUT%\out_%1.html
24 set MSGFILE=%TIDYOUT%\msg_%1.txt
28 REM If no test specific config file, use default.
29 if NOT exist %CFGFILE% set CFGFILE=input\cfg_default.txt
31 REM Get specific input file name
33 for %%F in ( %INFILES% ) do set INFILE=%%F
34 @if "%INFILE%." == "." goto Err6
35 @if NOT EXIST %INFILE% goto Err7
37 REM Remove any pre-exising test outputs
38 if exist %MSGFILE% del %MSGFILE%
39 if exist %TIDYFILE% del %TIDYFILE%
41 @REM Noisy output, or quiet
42 @REM echo Testing %1 input %INFILE% config %CFGFILE% ...
43 @echo Doing: '%TIDY% -f %MSGFILE% -config %CFGFILE% %3 %4 %5 %6 %7 %8 %9 --tidy-mark no -o %TIDYFILE% %INFILE% >> %TMPTEST%
45 @%TIDY% -f %MSGFILE% -config %CFGFILE% %3 %4 %5 %6 %7 %8 %9 --tidy-mark no -o %TIDYFILE% %INFILE%
46 @set STATUS=%ERRORLEVEL%
47 @echo Testing %1, expect %EXPECTED%, got %STATUS%
48 @echo Testing %1, expect %EXPECTED%, got %STATUS% >> %TMPTEST%
50 @if %STATUS% EQU %EXPECTED% goto done
51 @set ERRTESTS=%ERRTESTS% %TESTNO%
52 @echo *** Failed - got %STATUS%, expected %EXPECTED% ***
54 @echo *** Failed - got %STATUS%, expected %EXPECTED% *** >> %TMPTEST%
55 @type %MSGFILE% >> %TMPTEST%
59 @echo ==============================================================
60 @echo ERROR: runtime exe not set in TIDY environment variable ...
61 @echo ==============================================================
65 @echo ==============================================================
66 @echo ERROR: runtime exe %TIDY% not found ... check name, location ...
67 @echo ==============================================================
71 @echo ==============================================================
72 @echo ERROR: output folder TIDYOUT not set in environment ...
73 @echo ==============================================================
77 @echo ==============================================================
78 @echo ERROR: output folder %TIDYOUT% does not exist ...
79 @echo ==============================================================
83 @echo ==============================================================
84 @echo ERROR: input folder 'input' does not exist ... check name, location ..
85 @echo ==============================================================
89 @echo Try running alltest1.cmd ..\build\cmake\Release\Tidy5.exe tmp
90 @echo ==============================================================
95 @echo ==============================================================
96 @echo ERROR: Failed to find input matching '%INFILES%'!!!
97 @echo ==============================================================
102 @echo ==============================================================
103 @echo ERROR: Failed to find input file '%INFILE%'!!!
104 @echo ==============================================================