-
Notifications
You must be signed in to change notification settings - Fork 0
/
autotesterr.bat
101 lines (81 loc) · 1.92 KB
/
autotesterr.bat
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
@echo off
rem
rem -- This batch automatically tests ccsc and ccsrc so that fatal bugs can be found more easily.
rem
pushd %0\..
cls
set FAIL=bat\fail2.tmp
echo Do you want to read error messages?
set show=
set /p show= Yes(y + Enter)/ No (Enter)
if not '%show%'=='' set show=%show:~0,1%
echo ---Making ccsc.hs---
stack build :ccsc --copy-bins --local-bin-path .
echo ---Finished---
echo.
echo ---Making ccsrc.hs---
stack build :ccsrc --copy-bins --local-bin-path .
echo ---Finished---
echo.
call bat\setlogname terrresult
type nul > %LOG%
if exist %FAIL% del %FAIL%
for /F "usebackq" %%i in (`dir /A-D /s /b examples\error\Step1_*.txt`) do (
call :filename %%i -E
)
for /F "usebackq" %%i in (`dir /A-D /s /b examples\error\Step2_*.txt`) do (
call :filename %%i -C22
)
for /F "usebackq" %%i in (`dir /A-D /s /b examples\error\Step4_*.txt`) do (
call :filename %%i -C44
)
for /F "usebackq" %%i in (`dir /A-D /s /b examples\error\Step7_*.txt`) do (
call :filename %%i -C78
)
echo %LOG2%: > bat\terrresult.tmp
type %LOG% >> bat\terrresult.tmp
echo. >> bat\terrresult.tmp
type terrresult.log >> bat\terrresult.tmp
type bat\terrresult.tmp > terrresult.log
echo.
echo %LOG2%:
type %LOG%
del %LOG%
if exist %FAIL% (
del %FAIL%
) else (
del bat\*.tmp
echo ---Deleted temporary files.---
)
pause
exit
rem #$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$
rem #$#$#$#$#$#$# MAIN THINGS END HERE $#$#$#$#$#$#$
rem #$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$#$
:filename
call :compileErr ccsc %2 %~n1.txt
exit /b
:compileErr
setlocal
set /p out=testing %3: < nul
endlocal
%1 %2 examples\error\%3 -o bat\k.tmp > bat\%~n3.tmp 2>&1
call :output2 "%1 %2 examples\error\%3 -o bat\k.tmp" bat\%~n3.tmp
exit /b
:output2
if exist bat\k.tmp (
echo SUCCEEDED
echo SUCCEEDED %1 >> %LOG%
del bat\k.tmp
type nul > %FAIL%
) else (
echo failed
echo failed %1 >> %LOG%
if '%show%' == 'y' (
type %2
echo.
type %2 >> %LOG%
echo. >> %LOG%
)
)
exit /b