diff --git a/tools/ci/New-SummaryImage.ps1 b/tools/ci/New-SummaryImage.ps1 index dd9b554..d00b780 100644 --- a/tools/ci/New-SummaryImage.ps1 +++ b/tools/ci/New-SummaryImage.ps1 @@ -96,6 +96,9 @@ try { } finally { $g.Dispose() } + # .NET resolves a relative path against the process directory, not the + # PowerShell location, so resolve it here. + $OutFile = $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($OutFile) $dir = Split-Path -Parent $OutFile if ($dir -and -not (Test-Path $dir)) { New-Item -ItemType Directory -Force $dir | Out-Null } $out.Save($OutFile, [System.Drawing.Imaging.ImageFormat]::Png) diff --git a/tools/ci/New-ViDiffReport.ps1 b/tools/ci/New-ViDiffReport.ps1 index e538442..6ea90e5 100644 --- a/tools/ci/New-ViDiffReport.ps1 +++ b/tools/ci/New-ViDiffReport.ps1 @@ -37,8 +37,8 @@ param( [Parameter(Mandatory = $true)][string]$BaseRef, [Parameter(Mandatory = $true)][string]$OutDir, [string]$HeadDir = (Resolve-Path (Join-Path $PSScriptRoot '..\..')).Path, - [string]$LabVIEWPath = 'C:\Program Files\National Instruments\LabVIEW 2020\LabVIEW.exe', - [int]$PortNumber = 3365 + [string]$LabVIEWPath = 'C:\Program Files (x86)\National Instruments\LabVIEW 2026\LabVIEW.exe', + [int]$PortNumber = 3363 ) $ErrorActionPreference = 'Stop' diff --git a/tools/ci/Test-InstalledPackage.ps1 b/tools/ci/Test-InstalledPackage.ps1 index 68b7260..421f305 100644 --- a/tools/ci/Test-InstalledPackage.ps1 +++ b/tools/ci/Test-InstalledPackage.ps1 @@ -116,6 +116,7 @@ if (-not $LabVIEWPath) { if (-not $lv) { Write-Host '::error::No -LabVIEWPath given and no LabVIEW 2020 64-bit found.'; exit 1 } $LabVIEWPath = $lv.Path } +if (-not (Test-Path -LiteralPath $LabVIEWPath -PathType Leaf)) { Write-Host "::error::$LabVIEWPath does not exist."; exit 1 } $lvInfo = Get-LabVIEWInstall | Where-Object { $_.Path -ieq (Resolve-Path -LiteralPath $LabVIEWPath).Path } | Select-Object -First 1 if (-not $lvInfo) { Write-Host "::error::$LabVIEWPath is not a LabVIEW installation."; exit 1 } $lvDir = Split-Path $lvInfo.Path -Parent @@ -238,7 +239,10 @@ try { Write-Step 'Protocol tests against the installed example' $tester = Join-Path $RepoDir 'tools\test\Test-McpServer.ps1' $code = Invoke-Native 'powershell.exe' @('-NoProfile', '-ExecutionPolicy', 'Bypass', '-File', $tester, '-Url', $ServerUrl) - if ($code -ne 0) { Write-Failure "Test-McpServer.ps1: $code required checks failed against the installed example." } + # Test-McpServer.ps1 exits with the number of failed required checks, or 99 + # when the server does not answer at all. + if ($code -eq 99) { Write-Failure "Test-McpServer.ps1: the installed example did not answer at $ServerUrl." } + elseif ($code -ne 0) { Write-Failure "Test-McpServer.ps1: $code required checks failed against the installed example." } else { Write-Line 'PASS: every required protocol check passed against the installed example.' } } catch { diff --git a/tools/icons/New-VIIcon.ps1 b/tools/icons/New-VIIcon.ps1 index ea5a850..ee82709 100644 --- a/tools/icons/New-VIIcon.ps1 +++ b/tools/icons/New-VIIcon.ps1 @@ -120,6 +120,9 @@ switch ($Style) { $tops = switch ($Lines.Count) { 1 { , 19 } 2 { 15, 23 } 3 { 13, 19, 25 } } for ($i = 0; $i -lt $Lines.Count; $i++) { Write-Ink $Lines[$i] $tops[$i] } +# .NET resolves a relative path against the process directory, not the +# PowerShell location, so resolve it here. +$OutFile = $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($OutFile) $dir = Split-Path -Parent $OutFile if ($dir -and -not (Test-Path $dir)) { New-Item -ItemType Directory -Path $dir | Out-Null } $bmp.Save($OutFile, [System.Drawing.Imaging.ImageFormat]::Png)