-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwt-daily.bat.template
169 lines (136 loc) · 5.58 KB
/
wt-daily.bat.template
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
REM Copyright (C) 2012-2016 Francois Gouget
REM
REM Downloads and runs WineTest.
REM
REM This program is free software; you can redistribute it and/or modify
REM it under the terms of the GNU General Public License as published by
REM the Free Software Foundation; either version 2 of the License, or
REM (at your option) any later version.
REM
REM This program is distributed in the hope that it will be useful,
REM but WITHOUT ANY WARRANTY; without even the implied warranty of
REM MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
REM GNU General Public License for more details.
REM
REM You should have received a copy of the GNU General Public License
REM along with this program. If not, see <http://www.gnu.org/licenses/>.
REM One would typically set up Windows to log in automatically and then put
REM this script in the shell:startup folder. On Windows >= Vista one could use
REM the command below instead to run the script with elevated privileges:
REM schtasks /create /sc onlogon /tn wt-daily /rl highest /tr "c:\path\to\wt-daily.bat"
REM Figure out on what host and Windows version we are running on.
for /f "tokens=2 delims=[]" %%i in ('ver') do set WINVER=%%i
set WINVER=%WINVER:Version =%
for /f "tokens=1-2 delims=." %%i in ("%WINVER%") do set WINVER=%%i.%%j
for /f "tokens=*" %%i in ('hostname') do set HOSTNAME=%%i
REM **** DO NOT QUOTE EMPTY CONFIGURATION VALUES *****
REM But do quote values containing spaces.
REM How long to wait for the network in minutes.
set netwait=30
REM WineTest needs a valid email address so Wine developers can contact you
REM if they have questions about a failing Wine test.
set email=
REM If you have a development WineTest website you can set this if you want
REM the results to be sent there too.
set extrasubmit=
REM It is possible to consolidate multiple scripts into one by checking
REM the %HOSTNAME% and %WINVER% environment variables. For instance:
REM if %HOSTNAME% neq host1 goto host2
REM if %WINVER% neq 6.2 goto host1v2
REM For each test specify:
REM - tag
REM WineTest's tag identifying this test configuration.
REM - desc
REM A string describing this test configuration. This is meant to help Wine
REM developers figure out what could impact the test results like which
REM graphics card you have, the graphics driver, your locale if non-English,
REM etc.
REM - exclude
REM A space-separated list of tests to exclude. Tests should only be
REM excluded if they cause Windows to crash.
REM If tag32 is non empty then the 32 bit tests will be run.
set tag32=
set desc32=
set exclude32=
REM If tag64 is non empty then the 64 bit tests will be run.
set tag64=
set desc64=
set exclude64=
REM If set to -s the computer will be powered off after the tests.
REM If set to -r it will be rebooted. Otherwise it will keep running.
set shutdown=-s
goto start
REM :host2
REM set tag32=
REM set desc32=
REM set exclude32=
REM set tag64=
REM set desc64=
REM set exclude64=
REM set shutdown=-s
REM goto start
:unknown
echo Unknown host + Windows version combination: %HOSTNAME% - %WINVER%
goto shutdown
:start
set /A netwait=netwait*2
:netloop
REM Remember to disable the anti-virus and any other
REM application that may interfere with the tests.
REM *** Now is you chance to abort the tests ***
ping -n 61 127.0.0.1 >nul
REM Wait until the network is up.
ping -n 1 test.winehq.org
if %errorlevel% equ 0 goto download
if %netwait% equ 1 goto download
set /A netwait=netwait-1
goto netloop
:download
REM Place the files on the desktop so they are easy to
REM find in case they need to be reviewed later on.
for /f "delims='" %%i in ('powershell.exe -Command "[Environment]::GetFolderPath(\"Desktop\")"') do set DESKTOPDIR=%%i
cd /d "%DESKTOPDIR%"
set tries32=3
set tries64=3
REM Download the latest version of winetest
:download32
if "%tag32%" == "" goto download64
powershell.exe -Command "(new-object System.Net.WebClient).DownloadFile('https://test.winehq.org/builds/winetest-latest.exe', 'winetest32.exe')"
if %errorlevel% equ 0 goto download64
if %tries32% equ 1 goto download64
set /A tries32=tries32-1
goto download32
:download64
if "%tag64%" == "" goto run32
powershell.exe -Command "(new-object System.Net.WebClient).DownloadFile('https://test.winehq.org/builds/winetest64-latest.exe', 'winetest64.exe')"
if %errorlevel% equ 0 goto run32
if %tries64% equ 1 goto run32
set /A tries64=tries64-1
goto download64
:run32
ping -n 61 127.0.0.1 >nul
REM Run the 32-bit tests and store the report locally
if "%tag32%" == "" goto run64
if NOT "%exclude32%" == "" set exclude32=-n %exclude32%
mkdir tests32
winetest32.exe -c -d tests32 -o winetest32.report -t %tag32% -m %email% -i %desc32% %exclude32% >winetest32.log 2>&1
REM Send the 32-bit report to the official WineTest website
winetest32.exe -c -s winetest32.report
if "%extrasubmit%" == "" goto run64
REM And then to the development one
winetest32.exe -c -s winetest32.report -S %extrasubmit%
:run64
REM Run the 64-bit tests and store the report locally
if "%tag64%" == "" goto shutdown
if NOT "%exclude64%" == "" set exclude64=-n %exclude64%
mkdir tests64
winetest64.exe -c -d tests64 -o winetest64.report -t %tag64% -m %email% -i %desc64% %exclude64% >winetest64.log 2>&1
REM Send the 64-bit report to the official WineTest website
winetest64.exe -c -s winetest64.report
if "%extrasubmit%" == "" goto shutdown
REM And then to the development one
winetest64.exe -c -s winetest64.report -S %extrasubmit%
:shutdown
if "%shutdown%" == "" goto done
shutdown %shutdown%
:done