-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathsmoke-test.ps1
More file actions
51 lines (41 loc) · 1.13 KB
/
smoke-test.ps1
File metadata and controls
51 lines (41 loc) · 1.13 KB
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
param(
[Parameter(Mandatory = $false)]
[string]$ExePath = "build/Release/renderdoc-mcp.exe"
)
$ErrorActionPreference = "Stop"
if(-not (Test-Path $ExePath))
{
throw "Executable not found: $ExePath"
}
$payload = '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-03-26","capabilities":{},"clientInfo":{"name":"release-smoke-test","version":"1.0"}}}'
$output = $payload | & $ExePath
$jsonText = ($output | Out-String).Trim()
if($LASTEXITCODE -ne 0)
{
throw "Executable exited with code $LASTEXITCODE"
}
if([string]::IsNullOrWhiteSpace($jsonText))
{
throw "Executable produced no JSON-RPC output."
}
try
{
$response = $jsonText | ConvertFrom-Json
}
catch
{
throw "Executable output was not valid JSON: $jsonText"
}
if($response.jsonrpc -ne "2.0")
{
throw "Unexpected JSON-RPC version in response: $jsonText"
}
if($null -ne $response.error)
{
throw "Initialize returned an error: $($response.error | ConvertTo-Json -Compress)"
}
if($null -eq $response.result)
{
throw "Initialize response did not include a result payload: $jsonText"
}
Write-Host "Smoke test passed for $ExePath"