OSDN Git Service

設定変更。
[wordring-tm/wordring-tm.git] / third-party / tidy-html5-master / test / html5 / testhtml5.cmd
1 @setlocal
2
3 @set TMPEXE=..\..\build\cmake\Release\tidy5.exe
4 @if NOT EXIST %TMPEXE% goto NOEXE
5 @set TMPINP=temphtml5.cfg
6 @set TMPDIR=tempout
7
8 @%TMPEXE% -h > nul
9 @if ERRORLEVEL 1 goto NOEXE
10
11 @if EXIST %TMPDIR%\nul goto GOTOUT
12 @echo Will create the folder %TMPDIR% for output...
13 @pause
14 @md %TMPDIR%
15 @if ERRORLEVEL 1 goto NOOUT
16 @if NOT EXIST %TMPDIR%\nul goto NODIR
17 :GOTOUT
18
19 @REM This option would be nice, but at present it is FARRRR TOOOOO agressive,
20 @REM dropping <html>, <body>, etc...  because they are marked CM_OPT
21 @REM which causes WARNINGS when tidy is run on the tidied file!!!
22 @REM echo omit-optional-tags: yes >> %TMPINP%
23
24 @if EXIST %TMPINP% goto GOTINP
25 @echo Creating a CONFIG file %TMPINP%
26 @pause
27 @echo wrap: 99 > %TMPINP%
28 @echo tidy-mark: no >> %TMPINP%
29 @echo indent: yes >> %TMPINP%
30 @echo break-before-br: yes >> %TMPINP%
31 @echo indent-attributes: yes >> %TMPINP%
32 @echo vertical-space: yes >> %TMPINP%
33 @echo indent-spaces: 1 >> %TMPINP%
34 @echo indent-cdata: no >> %TMPINP%
35 @echo wrap-asp: no >> %TMPINP%
36 @echo wrap-attributes: no >> %TMPINP%
37 @echo wrap-jste: no >> %TMPINP%
38 @echo wrap-php: no >> %TMPINP%
39 @echo wrap-script-literals: no >> %TMPINP%
40 @echo wrap-sections: no >> %TMPINP%
41 @echo tab-size: 4 >> %TMPINP%
42 @echo show-info: no >> %TMPINP%
43 @if NOT EXIST %TMPINP% goto NOINP
44 :GOTINP
45 @set TMPCNT1=0
46 @set TMPCNT2=0
47 @set TMPCNT3=0
48
49 @for %%i in (*.org.html) do @(call :CNTIT %%i)
50 @echo.
51 @echo Will process %TMPCNT1% files found...
52 @echo All should exit with NO WARNINGS or ERRORS
53 @echo *** CONTINUE? *** Only Ctlr+C aborts... all other keys continue...
54 @pause
55
56 @for %%i in (*.org.html) do @(call :DOONE %%i)
57
58 @echo.
59 @echo Done %TMPCNT2% files. See tidied output in %TMPDIR%...
60 @if "%TMPCNT3%x" == "0x" (
61 @echo With NO WARNINGS or ERRORS! This is a *** SUCCESS ***.
62 ) ELSE (
63 @echo However have %TMPCNT3% WARNINGS or ERRORS! This is a *** FAILURE ***
64 )
65 @echo.
66
67 @goto END
68
69 :CNTIT
70 @if "%~1x" == "x" goto :EOF
71 @set /A TMPCNT1+=1
72 @goto :EOF
73
74 :DOONE
75 @if "%~1x" == "x" goto :EOF
76 @set /A TMPCNT2+=1
77 @echo %TMPCNT2% of %TMPCNT1%: %1
78 @set TMPOUT=%TMPDIR%\%~nx1
79 @%TMPEXE% -config %TMPINP% -o %TMPOUT% %1
80 @if ERRORLEVEL 1 goto FAILED
81 @goto :EOF
82
83 :FAILED
84 @echo The test of %1 FAILED!
85 @set /A TMPCNT3+=1
86 @pause
87 @goto :EOF
88
89 :NODIR
90 :NOOUT
91 @echo Error: Unable to create %TMPDIR%!
92 @goto END
93
94
95 :NOEXE
96 @echo Unable to find/run exe %TMPEXE%! *** FIX ME ***
97 @echo Set the name of the 'tidy' executable to use...
98 @goto END
99
100 :NOINP
101 @echo Error: Unable to create config file %TMPINP%!
102 @goto END
103
104
105 :END