File: onetest.cmd

package info (click to toggle)
tidy 20080116cvs-2
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 7,296 kB
  • ctags: 3,259
  • sloc: ansic: 30,069; sh: 9,060; xml: 317; makefile: 41
file content (108 lines) | stat: -rwxr-xr-x 3,117 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
@echo off

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
REM CVS Info:
REM
REM    $Author: arnaud02 $
REM    $Date: 2006/12/28 10:01:45 $
REM    $Revision: 1.5 $

@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% ...
echo Testing %1

%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%
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
@echo Try running alltest.cmd ..\build\msvc\Release\Tidy.exe tmp ...
@echo ==============================================================
@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