|
8 | 8 | [switch]$NoClean, |
9 | 9 | [switch]$SkipPyInstaller, |
10 | 10 | [switch]$SkipInno, |
11 | | - [switch]$SmokeTest |
| 11 | + [switch]$SmokeTest, |
| 12 | + [switch]$DiagnosticsOnly |
12 | 13 | ) |
13 | 14 |
|
14 | 15 | Set-StrictMode -Version Latest |
|
74 | 75 | Write-Host "DiagDir = $DiagDir" |
75 | 76 | Write-Host "PSVersion = $($PSVersionTable.PSVersion)" |
76 | 77 |
|
| 78 | + if ($DiagnosticsOnly) { |
| 79 | + $SkipPyInstaller = $true |
| 80 | + $SkipInno = $true |
| 81 | + Write-Host "DiagnosticsOnly enabled -> forcing -SkipPyInstaller and -SkipInno" |
| 82 | + } |
| 83 | + |
77 | 84 | $VenvPy = Ensure-Venv -RepoRootPath $RepoRoot |
78 | 85 |
|
79 | 86 | Write-Section "Python / pip sanity" |
@@ -173,24 +180,42 @@ try { |
173 | 180 |
|
174 | 181 | if ($SmokeTest) { |
175 | 182 | Write-Section "Smoke test (IBEIS-console.exe with IBEIS_DLL_DEBUG=1) -> smoke_test.txt" |
176 | | - $SmokeOut = Join-Path $DiagDir "smoke_test.txt" |
| 183 | + $SmokeOut = Join-Path $DiagDir "smoke_test_stdout.txt" |
| 184 | + $SmokeErr = Join-Path $DiagDir "smoke_test_stderr.txt" |
| 185 | + $SmokeMerged = Join-Path $DiagDir "smoke_test.txt" |
177 | 186 | $exe = Join-Path $AppDir "IBEIS-console.exe" |
178 | 187 |
|
179 | 188 | $env:IBEIS_DLL_DEBUG = "1" |
180 | | - $p = Start-Process -FilePath $exe -WorkingDirectory $AppDir -NoNewWindow -PassThru ` |
181 | | - -RedirectStandardOutput $SmokeOut -RedirectStandardError $SmokeOut |
182 | | - |
183 | 189 | try { |
| 190 | + $p = Start-Process -FilePath $exe -WorkingDirectory $AppDir -NoNewWindow -PassThru ` |
| 191 | + -RedirectStandardOutput $SmokeOut -RedirectStandardError $SmokeErr |
| 192 | + |
184 | 193 | Wait-Process -Id $p.Id -Timeout 20 -ErrorAction SilentlyContinue | Out-Null |
185 | 194 | if (-not $p.HasExited) { |
186 | 195 | Write-Warning "Smoke test timed out; stopping process." |
187 | 196 | Stop-Process -Id $p.Id -Force -ErrorAction SilentlyContinue |
188 | 197 | } |
| 198 | + } catch { |
| 199 | + Write-Warning "Smoke test failed to start: $($_.Exception.Message)" |
189 | 200 | } finally { |
190 | 201 | Remove-Item Env:\IBEIS_DLL_DEBUG -ErrorAction SilentlyContinue |
191 | 202 | } |
192 | 203 |
|
193 | | - Write-Host "Wrote: $SmokeOut" |
| 204 | + $parts = @() |
| 205 | + if (Test-Path $SmokeOut) { |
| 206 | + $parts += "===== STDOUT =====" |
| 207 | + $parts += (Get-Content $SmokeOut) |
| 208 | + } |
| 209 | + if (Test-Path $SmokeErr) { |
| 210 | + $parts += "===== STDERR =====" |
| 211 | + $parts += (Get-Content $SmokeErr) |
| 212 | + } |
| 213 | + if ($parts.Count -gt 0) { |
| 214 | + $parts | Set-Content -Path $SmokeMerged |
| 215 | + Write-Host "Wrote: $SmokeMerged" |
| 216 | + } else { |
| 217 | + Write-Warning "Smoke test produced no output files." |
| 218 | + } |
194 | 219 | } |
195 | 220 |
|
196 | 221 | if (-not $SkipInno) { |
|
0 commit comments