diff --git a/newLang/planning/claims/E07-S05.md b/newLang/planning/claims/E07-S05.md index 786b177..f8ef7c6 100644 --- a/newLang/planning/claims/E07-S05.md +++ b/newLang/planning/claims/E07-S05.md @@ -36,8 +36,10 @@ are diagnostics, and never overwrite an earlier output. - [x] `build/n128c.prg` is produced by `scripts/build-driver.ps1` and is the exact path `prepare-disk.ps1` injects as `n128c` and - `launch-compiler.ps1` autostarts by default; the verifier drives those same - scripts. The build asserts the entry label is `$1C0D`. + `launch-compiler.ps1` autostarts by default; the verifier runs + `prepare-disk.ps1 -RequireCompiler` and compares the injected `n128c` + byte-for-byte with `build/n128c.prg`, then drives the launcher. The build + asserts the entry label is `$1C0D`. - [x] On `x128` the driver takes one source name (`SOURCE: counter.n8`), loads it from the session disk with `src_load` and no host conversion, runs the lexer, parser and emitter, and writes `COUNTER.PRG` (263 bytes) and @@ -96,15 +98,19 @@ are diagnostics, and never overwrite an earlier output. ## Completion -- Tests run: `scripts/verify-driver-test.ps1` (builds the driver, then five - x128 sessions: summary monitor run, success launcher run, syntax-failure - launcher run, collision launcher run, generated-PRG monitor run). +- Tests run: `scripts/verify-driver-test.ps1` (builds the driver, checks the + `prepare-disk.ps1` injection, then five x128 sessions: summary monitor run, + success launcher run, syntax-failure launcher run, collision launcher run, + generated-PRG monitor run), and the same script through the regression + harness: `run-regression.ps1 -Filter driver`. - Results: `summary: SOURCE COUNTER.N8 / OUTPUT COUNTER.PRG / 0 ERRORS`; `success: COUNTER.PRG 263 bytes, COUNTER.MAP 95 bytes, no COUNTER.ERR`; `failure: BAD.ERR E024 BAD.N8 3 1 END PROGRAM EXPECTED, E227 ... CANNOT EMIT THIS CODE YET, no BAD.PRG, COUNTER.PRG unchanged`; `collision: OUTPUT EXISTS - and COUNTER.PRG unchanged`; `run: generated COUNTER.PRG reported MB_ST_PASS in - x128`. + and COUNTER.PRG unchanged`; `injection: prepare-disk.ps1 wrote build/n128c.prg + byte-identically as n128c`; `run: generated COUNTER.PRG reported MB_ST_PASS in + x128`. The harness run reports `driver pass 82.5s` and `1 passed, 0 failed`, + with `driver` now listed in `tests/regression/suites.ps1`. - Remaining risks: text `print` needs the generated-program print runtime; the code buffer stays at 255 bytes, so larger programs fail with a diagnostic rather than a partial file; the summary check reads screen RAM through a diff --git a/newLang/scripts/verify-driver-test.ps1 b/newLang/scripts/verify-driver-test.ps1 index 74ef298..25475fc 100644 --- a/newLang/scripts/verify-driver-test.ps1 +++ b/newLang/scripts/verify-driver-test.ps1 @@ -21,6 +21,19 @@ $work = Join-Path $root "work.d81" $c1541 = Get-ViceTool "c1541" $failures = @() +# 0: prepare-disk.ps1 injects exactly the build the driver was made from. +$prepared = Join-Path $root "prepared.d81" +& (Join-Path $PSScriptRoot "prepare-disk.ps1") -OutputImage $prepared ` + -CompilerPrg $driver -RequireCompiler | Out-Host +$injectedPath = Join-Path $root "prepared-n128c" +& $c1541 $prepared -read "n128c" $injectedPath 2>&1 | Out-Null +if (-not (Test-Path -LiteralPath $injectedPath)) { + $failures += "prepare-disk.ps1 did not inject n128c" +} elseif ([Convert]::ToBase64String([IO.File]::ReadAllBytes($injectedPath)) -ne + [Convert]::ToBase64String([IO.File]::ReadAllBytes($driver))) { + $failures += "prepare-disk.ps1 injected a different n128c" +} + $counterPet = Join-Path $root "counter.pet" [IO.File]::WriteAllBytes($counterPet, (ConvertTo-Nova128Petscii ` (Get-Content -Raw -LiteralPath (Join-Path $project "tests\compiler\counter.n8")))) @@ -183,5 +196,6 @@ Write-Host ("summary: SOURCE COUNTER.N8 / OUTPUT COUNTER.PRG / 0 ERRORS") Write-Host ("success: COUNTER.PRG {0} bytes, COUNTER.MAP {1} bytes, no COUNTER.ERR" -f $prg.Length, $map.Length) Write-Host ("failure: BAD.ERR {0}, no BAD.PRG, COUNTER.PRG unchanged" -f $errText.Trim()) +Write-Host "injection: prepare-disk.ps1 wrote build/n128c.prg byte-identically as n128c" Write-Host "collision: OUTPUT EXISTS and COUNTER.PRG unchanged" Write-Host "run: generated COUNTER.PRG reported MB_ST_PASS in x128" diff --git a/newLang/tests/regression/suites.ps1 b/newLang/tests/regression/suites.ps1 index 013163f..15618e2 100644 --- a/newLang/tests/regression/suites.ps1 +++ b/newLang/tests/regression/suites.ps1 @@ -27,4 +27,5 @@ @{ Name = "ifcall"; Script = "scripts\verify-ifcall-test.ps1"; BuildDir = "ifcall-test"; Timeout = 300 } @{ Name = "iftable"; Script = "scripts\verify-iftable-test.ps1"; BuildDir = "iftable-test"; Timeout = 300 } @{ Name = "lifetime"; Script = "scripts\verify-lifetime-test.ps1"; BuildDir = "lifetime-test"; Timeout = 300 } + @{ Name = "driver"; Script = "scripts\verify-driver-test.ps1"; BuildDir = "driver-test"; Timeout = 900; Success = "run: generated COUNTER.PRG reported MB_ST_PASS" } )