ruen-ui/docs/DEVELOPMENT.md

71 lines
3.9 KiB
Markdown
Raw Permalink Normal View History

# Reproducing checks
Run installer tests from the repository root:
```sh
PYTHONDONTWRITEBYTECODE=1 python3 -m unittest discover -s tests -v
RUEN_PWSH=/path/to/pwsh PYTHONDONTWRITEBYTECODE=1 python3 -m unittest discover -s tests -v
```
These use tiny offline companion archives and disposable fake game directories, never the installed game. Native Windows remains a separate manual test requirement.
Lua harnesses require LuaJIT (Lua 5.1 semantics and `bit`). `tests/check-timers-optimizer.lua` runs with the addon directory as its first argument, including a trailing slash.
The other layout/pet/meter harnesses load selected matching Blizzard UI source files. Those files are **not redistributed**. Set `RUEN_NATIVE_UI` to a directory containing the matching Forever client exports:
```text
EditModeManagerConstantsDocumentation.lua
NamePlateConstantsDocumentation.lua
Mainline-ContainerFrame.lua
PetActionBar.lua
MultiActionBars.lua
SecureTemplates.lua
DamageMeter.lua
DamageMeterSessionWindow.lua
CooldownViewer.lua
CooldownViewerSettingsDataProvider.lua
ActionButtonUtil.lua
Blizzard_SpellSearchUtil.lua
AddOnProfilerConstantsDocumentation.lua
```
Example:
```sh
export RUEN_NATIVE_UI=/path/to/matching-native-fixtures
luajit tests/check-layout.lua "$PWD/RuenUI/" unused /tmp/ruen-matrix.txt
luajit tests/check-pet-actions.lua "$PWD/RuenUI/"
luajit tests/check-meter.lua "$PWD/RuenUI/"
luajit tests/check-benchmark.lua "$PWD/RuenUI/"
luajit tests/check-timers-optimizer.lua "$PWD/RuenUI/"
```
The gun test accepts a directory containing both `RuenUI/` and an author-downloaded `GunSilencerForever/`:
```sh
luajit tests/check-gun-audio.lua /path/to/test-addons
```
These harnesses simulate engine state and execute selected native methods. They are not a substitute for live rendering or the secure game VM. Review changes against the exact client UI revision rather than making tests pass against a different branch.
The coordinated release runner requires all runtimes and fixtures explicitly, records each suite's exit status, and stops at the first failure:
```sh
python3 scripts/check_release.py --native-ui /path/to/matching-native-fixtures \
--audio-fixtures /path/to/test-addons --pwsh /path/to/pwsh --output /path/to/check-results
```
The two new standalone checks are `luajit tests/check-profiles.lua "$PWD/RuenUI/"` and `luajit tests/check-layout-policy.lua "$PWD/RuenUI/"`. The profile fixture executes the actual restricted binding snippet against a modeled engine, including native-control transitions in combat. It does not emulate the live secure VM or certify binding priority there.
For a pure geometry comparison, preserve the preceding `OverlayLayout.lua` and run `luajit tests/benchmark-layout.lua "$PWD/RuenUI/" /path/to/baseline/OverlayLayout.lua`. This measures only bounded rectangle searches, not live FPS, GPU load or allocations from the complete UI. A live `/ruen bench` comparison needs the same scene/settings and a continuously focused game window.
Build the downloadable installer:
```sh
python3 scripts/build_release.py /path/to/output
```
The allowlist excludes tests, third-party payloads, caches, account saves and Git metadata. The ZIP includes the launcher source and installer helpers. `SHA256SUMS.txt` verifies the ZIP; `manifest.json` verifies its extracted files. Neither is a digital signature. Publish the named ZIP and checksum as Gitea prerelease assets. A Gitea source archive is for development and lacks the generated installer manifest.
The Windows launcher can be rebuilt with Clang targeting x86_64-pc-windows-msvc and LLD in link mode. Compile `Tools/Ruen-Setup.c` with `-Os -ffreestanding -fno-stack-protector -fshort-wchar`; create a KERNEL32 import library from `Tools/kernel32.def`; link with `/entry:entry /subsystem:console /machine:x64 /nodefaultlib /opt:ref /timestamp:0`. It uses only KERNEL32 imports, no bundled runtime. The included binary is unsigned.