diff options
| author | Jan Trencansky <jan.trencansky@protonmail.com> | 2026-11-24 17:15:53 -0500 |
|---|---|---|
| committer | Jan Trencansky <jan.trencansky@protonmail.com> | 2026-11-24 17:15:53 -0500 |
| commit | de3027cff49f10ae6b5df650d09ed0a3bde9a4e6 (patch) | |
| tree | a2e09fcc5dc84141ed26f23e4b853101aa715b0d /docs/testing.md | |
| parent | 4a50cafc7af8b5a842c85a3794b286232495068d (diff) | |
run_wine_tests: keep one wineserver, disable winedbg, add --jobs
Run one after another, each Windows test under Wine took several seconds,
most of it a wineserver starting and stopping around every test. The
runner now keeps one wineserver alive for the run (`wineserver -p`, the
one $WINESERVER or the --wine command uses) and stops it at the end,
also after a failure or Ctrl+C. It starts the prefix's services first
with `wine wineboot` and no output: the first program a server runs
starts them, they inherit its output pipe, and with a kept server they
hold it open until the timeout.
Each test's WINEDLLOVERRIDES gains winedbg.exe=d (a crash fails at once
instead of waiting in the debugger) and winemenubuilder.exe=d (no menu
entries or file associations in the user's profile); an entry of the
caller's or the test's for the same program wins.
--jobs N (default 1) runs N tests at a time, keeping RUN_SERIAL tests
alone, tests that share a RESOURCE_LOCK apart and DEPENDS in order, and
reports them in the same order as --jobs 1.
docs/testing.md gains the fast local recipe for the cross-build with
measured times, the menu-builder note and --jobs.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'docs/testing.md')
| -rw-r--r-- | docs/testing.md | 50 |
1 files changed, 49 insertions, 1 deletions
diff --git a/docs/testing.md b/docs/testing.md index f8246f888..4c15f08c7 100644 --- a/docs/testing.md +++ b/docs/testing.md | |||
| @@ -218,6 +218,49 @@ and `vk_presenter_sync`, `xbox_present` and `dxgi_swapchain` pass, while they fa | |||
| 218 | compositor for those three. Six still failed with a real display: `device_proxy`, `d3d12_xs_root_signature`, | 218 | compositor for those three. Six still failed with a real display: `device_proxy`, `d3d12_xs_root_signature`, |
| 219 | `xdxr_build`, `d3d12_xdxr_rt`, `d3d12_present` and `d3d12_compute`. | 219 | `xdxr_build`, `d3d12_xdxr_rt`, `d3d12_present` and `d3d12_compute`. |
| 220 | 220 | ||
| 221 | Run one after another as above, the suite takes several seconds per test, although a test started by hand takes 0.1 to | ||
| 222 | 1 second. Four settings make a local run of the cross-build much faster: | ||
| 223 | |||
| 224 | ```sh | ||
| 225 | export WINEPREFIX="$HOME/.local/share/leonida-wine" WINEDEBUG=-all \ | ||
| 226 | WINEDLLOVERRIDES="winedbg.exe=d;winemenubuilder.exe=d" | ||
| 227 | mkdir -p "$WINEPREFIX" | ||
| 228 | xvfb-run -a sh -c 'wineserver -p; wine wineboot -u </dev/null >/dev/null 2>&1 | ||
| 229 | ctest --test-dir runtime/build/windows -j 6 --timeout 120; wineserver -k' | ||
| 230 | ``` | ||
| 231 | |||
| 232 | Start the server before `wineboot`: `wineserver -p` does nothing while another server runs for the prefix. Run | ||
| 233 | `wineboot` after it, with its output thrown away: the first Wine program a server runs starts the prefix's services, | ||
| 234 | which keep that program's output open for as long as the server lives, so a first test that started them would wait | ||
| 235 | for the end of its output until the timeout. | ||
| 236 | |||
| 237 | - `wineserver -p` keeps one Wine server for the whole run; without it a new one starts for each test. | ||
| 238 | - `winedbg.exe=d`: a test that crashes otherwise waits in Wine's debugger until its timeout. | ||
| 239 | - `winemenubuilder.exe=d`: without it `wineboot` on a fresh prefix writes `wine-extension-*.desktop` files and the MIME | ||
| 240 | cache into `~/.local/share/applications`, pointing your file associations at the test prefix. Set it before the | ||
| 241 | prefix is first made. | ||
| 242 | - `ctest -j 6` runs six tests at a time. The tests that share files under the temp directory (see "Known problems") | ||
| 243 | can then fail now and then; rerun such a failure on its own before you count it. | ||
| 244 | |||
| 245 | Measured with Wine 11.22 on llvmpipe, 40 tests of a clang-cl build (`ctest -R '^(d3d12_[a-c]|vk_[a-d]|xg)'`), adding | ||
| 246 | one setting at a time: | ||
| 247 | |||
| 248 | | Settings | Seconds | | ||
| 249 | |---|---| | ||
| 250 | | As above: one test after another | 179 | | ||
| 251 | | `wineserver -p` (and `wineboot` after it) | 35 | | ||
| 252 | | and `WINEDEBUG=-all` | 35 | | ||
| 253 | | and `winedbg.exe=d` | 35 | | ||
| 254 | | and `ctest -j 6` | 5.6 | | ||
| 255 | | `ctest -j 6` and the overrides, without `wineserver -p` | 18 | | ||
| 256 | |||
| 257 | The kept server is most of it: a test that takes 0.05 seconds with it took about 3.4 without, the time of a server | ||
| 258 | starting and stopping. `WINEDEBUG=-all` and `winedbg.exe=d` changed nothing here because no test crashed; with a crash, | ||
| 259 | `winedbg.exe=d` saves the rest of that test's timeout. The full suite (about 310 tests) took about 28 minutes run one | ||
| 260 | after another, and 67 seconds with all four settings for two devices (llvmpipe and an integrated GPU) run at the same | ||
| 261 | time. `scripts/run_wine_tests.py` (below) does the same: 32 seconds for those 40 tests with `--jobs 1`, 6 with | ||
| 262 | `--jobs 6`, and 19 seconds for all 312 tests with `--jobs 6`. | ||
| 263 | |||
| 221 | The build type defaults to `RelWithDebInfo`: xwin leaves out the debug CRT, so `Debug` needs `--include-debug-libs`. | 264 | The build type defaults to `RelWithDebInfo`: xwin leaves out the debug CRT, so `Debug` needs `--include-debug-libs`. |
| 222 | `make_game.py`'s `runtime` stage makes this same build on Linux when the tools and the SDK are there (`--runtime-build | 265 | `make_game.py`'s `runtime` stage makes this same build on Linux when the tools and the SDK are there (`--runtime-build |
| 223 | runtime/build/windows` takes a folder made by hand like a Windows build). CMake packages are | 266 | runtime/build/windows` takes a folder made by hand like a Windows build). CMake packages are |
| @@ -290,7 +333,12 @@ WINE=wine WINEPREFIX="$(mktemp -d)" WINEDLLOVERRIDES="mscoree,mshtml=" WINEDEBUG | |||
| 290 | 333 | ||
| 291 | The session script initializes a dedicated prefix and stops its Wine processes at exit. On a headless host, | 334 | The session script initializes a dedicated prefix and stops its Wine processes at exit. On a headless host, |
| 292 | put `xvfb-run -a` before `bash` so prefix initialization and the tests share one virtual display. The test runner | 335 | put `xvfb-run -a` before `bash` so prefix initialization and the tests share one virtual display. The test runner |
| 293 | maps the recorded Windows drive to the Linux checkout for shaders referenced by absolute Windows paths. It prints | 336 | maps the recorded Windows drive to the Linux checkout for shaders referenced by absolute Windows paths. It keeps one |
| 337 | wineserver alive for the run and stops it at the end, and adds `winedbg.exe=d;winemenubuilder.exe=d` to each test's | ||
| 338 | `WINEDLLOVERRIDES` (an entry of yours for the same program wins). `--jobs N` runs N tests at a time (default 1): tests | ||
| 339 | marked `RUN_SERIAL` run alone, tests that share a `RESOURCE_LOCK` never overlap, and the verdicts are printed in the | ||
| 340 | same order as with `--jobs 1`; the tests that share temp files can fail now and then in parallel (see "Known | ||
| 341 | problems"). It prints | ||
| 294 | every verdict and returns a failure status if any required test fails, skips or is missing. Check the printed | 342 | every verdict and returns a failure status if any required test fails, skips or is missing. Check the printed |
| 295 | verdicts for failures outside the required set. | 343 | verdicts for failures outside the required set. |
| 296 | 344 | ||