1@echo off
2
3REM onetest.cmd - execute a single test case
4REM
5REM (c) 1998-2005 (W3C) MIT, ERCIM, Keio University
6REM See tidy.c for the copyright notice.
7REM
8REM <URL:http://tidy.sourceforge.net/>
9REM
10REM CVS Info:
11REM
12REM    $Author: iccir $
13REM    $Date: 2007/01/31 02:33:39 $
14REM    $Revision: 1.1 $
15
16set VERSION='%Id'
17
18echo Testing %1
19set TESTNO=%1
20set EXPECTED=%2
21
22set TIDY=..\bin\tidy
23set INFILES=.\input\in_%1.*ml
24set CFGFILE=.\input\cfg_%1.txt
25
26set TIDYFILE=.\tmp\out_%1.html
27set MSGFILE=.\tmp\msg_%1.txt
28
29set HTML_TIDY=
30
31REM If no test specific config file, use default.
32if NOT exist %CFGFILE% set CFGFILE=.\input\cfg_default.txt
33
34REM Get specific input file name
35for %%F in ( %INFILES% ) do set INFILE=%%F 
36
37REM $T set TIDYFILE=.\tmp\out_%1%%~xF
38
39REM Remove any pre-exising test outputs
40if exist %MSGFILE%  del %MSGFILE%
41if exist %TIDYFILE% del %TIDYFILE%
42
43REM Make sure output directory exists
44if NOT exist .\tmp  md .\tmp
45
46%TIDY% -f %MSGFILE% -config %CFGFILE% %3 %4 %5 %6 %7 %8 %9 --tidy-mark no -o %TIDYFILE% %INFILE%
47set STATUS=%ERRORLEVEL%
48
49if %STATUS% EQU %EXPECTED% goto done
50echo ^^^Failed
51type %MSGFILE%
52
53:done
54