Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/game_gate.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ The script is `scripts/game-gate.ps1` (Windows, PowerShell 7). The parser is `to

## Running it

It needs PowerShell 7 (`pwsh`). Windows PowerShell 5.1 (`powershell.exe`) refuses the script with a message before anything runs, from its `#Requires -Version 7.0` line.

Build the runtime first (`d3d12\scripts\build-nvidia.ps1`). The gate refuses to start without `d3d12\target\diag\leonida.exe`, because the play script would build it inside the timed run.

Make a data template once:
Expand Down
1 change: 1 addition & 0 deletions scripts/game-gate.ps1
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#Requires -Version 7.0
# The in-game gate for the D3D12 runtime (leonida.exe): one run, measured the same way on every machine.
#
# pwsh -NoProfile -File scripts\game-gate.ps1 run -Game <dir> -Data <dir> -DataTemplate <dir> -Name <label> [options]
Expand Down
5 changes: 5 additions & 0 deletions tests/test_game_gate.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,11 @@ def test_state_tells_the_supervisor_the_world_time(self):


class Script(unittest.TestCase):
def test_it_needs_powershell_7(self):
# Under Windows PowerShell 5.1 it failed in about 2 s without saying why: it now says so before running.
with open(os.path.join(ROOT, "scripts", "game-gate.ps1"), encoding="utf-8") as f:
self.assertEqual(f.readline().strip(), "#Requires -Version 7.0")

def test_no_variable_takes_a_parameters_name_in_another_case(self):
# PowerShell names ignore case: a `$game` process held in the `[string]$Game` parameter became its name,
# and the stop could not wait for it.
Expand Down
Loading