Skip to content
Open
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
1 change: 1 addition & 0 deletions scripts/smoke.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ if ($PSBoundParameters.ContainsKey('Title')) {
}

if (-not (Test-Path $Xcl)) { throw "no $Xcl - build it first (cargo build --release -p xcl)" }
$Xcl = (Resolve-Path -LiteralPath $Xcl).ProviderPath
$root = Split-Path $PSScriptRoot -Parent
$commit = (git -C $root rev-parse HEAD).Trim()
$dirty = [bool](git -C $root status --porcelain --untracked-files=no -- crates Cargo.toml Cargo.lock)
Expand Down
23 changes: 23 additions & 0 deletions scripts/test-smoke-relative-xcl.tests.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Run with powershell.exe or pwsh.exe. -Xcl paths are relative to the shell's location.
$ErrorActionPreference = 'Stop'
$smoke = Join-Path $PSScriptRoot 'smoke.ps1'
$temp = (Resolve-Path -LiteralPath ([IO.Path]::GetTempPath())).Path
$fixture = Join-Path $temp ('xcl-smoke-relative-' + [guid]::NewGuid())
$null = New-Item -ItemType Directory -Path $fixture
try {
$xcl = Join-Path $fixture 'xcl.cmd'
[IO.File]::WriteAllText($xcl, "@echo off`r`necho Log: %~dp0xcl.log`r`n")
[IO.File]::WriteAllText((Join-Path $fixture 'xcl.log'), "(1 frames shown, 1 PresentX calls)`n")
[IO.File]::WriteAllText((Join-Path $fixture 'report.json'), '{"d3d12":{"adapter":"Fixture GPU"}}')
Push-Location -LiteralPath $fixture
try {
$block = & $smoke -Game $fixture -Xcl '.\xcl.cmd' -Seconds 1 -Title 'Fixture'
if (($block -join "`n") -notmatch 'frames shown: 1 \(PresentX 1\)') {
throw 'The relative launcher did not produce its smoke result.'
}
} finally { Pop-Location }
'smoke-relative-xcl: ok'
} finally {
$resolved = (Resolve-Path -LiteralPath $fixture).Path
if ((Split-Path -Parent $resolved) -eq $temp) { Remove-Item -LiteralPath $resolved -Recurse -Force }
}
Loading