Ver código fonte

Close the driver story's injection and regression checks.

The verifier proved the launcher path but never ran prepare-disk.ps1 itself,
so it now compares the injected n128c byte-for-byte with build/n128c.prg, and
the driver suite is part of the regression manifest.

Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
main
Daniel Covington 4 dias atrás
pai
commit
167a7d2aad
3 arquivos alterados com 28 adições e 7 exclusões
  1. +13
    -7
      newLang/planning/claims/E07-S05.md
  2. +14
    -0
      newLang/scripts/verify-driver-test.ps1
  3. +1
    -0
      newLang/tests/regression/suites.ps1

+ 13
- 7
newLang/planning/claims/E07-S05.md Ver arquivo

@@ -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


+ 14
- 0
newLang/scripts/verify-driver-test.ps1 Ver arquivo

@@ -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"

+ 1
- 0
newLang/tests/regression/suites.ps1 Ver arquivo

@@ -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" }
)

Carregando…
Cancelar
Salvar

Powered by TurnKey Linux.