Skip to content

Commit e6e45c9

Browse files
committed
tests: guard Windows-only arg-echo discovery for Linux CI
The native arg-echo Describe built its csc.exe candidate paths with Join-Path $env:WINDIR at Pester discovery time, which threw on Linux so discovery is null-safe; the tests already skip when csc.exe and powershell.exe are absent. Relates to #24 All 102 tests pass. v1.2.7
1 parent 5652460 commit e6e45c9

3 files changed

Lines changed: 15 additions & 6 deletions

File tree

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## [1.2.7]
6+
7+
- Fix Linux CI: the native arg-echo test built its `csc.exe` candidate paths
8+
with `Join-Path $env:WINDIR` at Pester discovery time, which threw on Linux
9+
runners where `$env:WINDIR` is null. The Windows-only paths are now inside the
10+
existing guard; the tests already skip cleanly when the toolchain is absent.
11+
[#24](https://github.com/continuous-delphi/delphi-msbuild/issues/24)
12+
513
## [1.2.6]
614

715
- Fix native-argument quoting for `/p:` values ending in a backslash. Values

source/delphi-msbuild.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ $ExitRootDirError = 3
190190
$ExitProjectNotFound = 4
191191
$ExitBuildFailed = 5
192192

193-
$script:Version = '1.2.6'
193+
$script:Version = '1.2.7'
194194

195195
# Resolve the Delphi root dir from the explicit -RootDir parameter or from a
196196
# piped delphi-inspect result object (.rootDir property).

tests/pwsh/delphi-msbuild.Tests.ps1

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1255,11 +1255,12 @@ Describe 'Native argument passing (real arg-echo exe)' {
12551255
# Requires the .NET Framework C# compiler (csc.exe); on machines/CI without it
12561256
# (e.g. Linux runners) every test here skips. Evaluated at Pester discovery
12571257
# time so -Skip: can capture it.
1258-
$frameworkRoots = @(
1259-
(Join-Path $env:WINDIR 'Microsoft.NET\Framework64\v4.0.30319\csc.exe'),
1260-
(Join-Path $env:WINDIR 'Microsoft.NET\Framework\v4.0.30319\csc.exe')
1261-
)
1262-
$cscDiscover = if ($env:WINDIR) { $frameworkRoots | Where-Object { Test-Path -LiteralPath $_ } | Select-Object -First 1 } else { $null }
1258+
$cscDiscover = if ($env:WINDIR) {
1259+
@(
1260+
(Join-Path $env:WINDIR 'Microsoft.NET\Framework64\v4.0.30319\csc.exe'),
1261+
(Join-Path $env:WINDIR 'Microsoft.NET\Framework\v4.0.30319\csc.exe')
1262+
) | Where-Object { Test-Path -LiteralPath $_ } | Select-Object -First 1
1263+
} else { $null }
12631264
$skipNative = -not $cscDiscover
12641265

12651266
# Windows PowerShell 5.1, located via its fixed path (see WindowsPS51Compat.Tests.ps1).

0 commit comments

Comments
 (0)