# Smoke test of Section 2.4 for Windows PowerShell: version banner, data checks and base-model fit of the demo project. # .\smoke-test.ps1 # uses the nlmx found on the PATH # .\smoke-test.ps1 C:\path\to\nlmx.exe # or a specific executable param([string]$Nlmx = "nlmx") $ErrorActionPreference = "Stop" if (-not (Get-Command $Nlmx -ErrorAction SilentlyContinue)) { throw "nlmx not found: $Nlmx" } Write-Host "== smoke test" & $Nlmx version --no-color | Select-Object -Skip 1 -First 5 $work = Join-Path ([System.IO.Path]::GetTempPath()) ("nlmx-smoke-" + [guid]::NewGuid().ToString("N")) New-Item -ItemType Directory -Path $work | Out-Null Push-Location $work try { & $Nlmx generate --output demo --no-color *> generate.txt Select-String -Path generate.txt -SimpleMatch "Example project written to demo" | Select-Object -First 1 | ForEach-Object { $_.Line } Set-Location demo & $Nlmx qc-data data/analysis.csv --no-color -o out_qcd *> qcd.txt Select-String -Path qcd.txt -SimpleMatch "99 checks" | Select-Object -First 1 | ForEach-Object { $_.Line } & $Nlmx fit models/run101.ctl --no-color -o out_fit *> fit.txt $ofv = Select-String -Path fit.txt -SimpleMatch "OBJECTIVE FUNCTION VALUE (OFV): -2880.2130" | Select-Object -First 1 if (-not $ofv) { throw "OFV -2880.2130 not found in fit.txt" } $ofv.Line Write-Host "smoke test passed in $work" } finally { Pop-Location }