You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 line
1.5KB

  1. # E04-S06: parse CALLS.N8, execute the emitted Counter.both, and check n=2.
  2. [CmdletBinding()]
  3. param([int]$Port = 6561, [int]$TimeoutSeconds = 180)
  4. $ErrorActionPreference = "Stop"
  5. $project = Split-Path $PSScriptRoot -Parent
  6. Import-Module (Join-Path $PSScriptRoot "lib\Nova128Test.psm1") -Force
  7. & (Join-Path $PSScriptRoot "build-calls-test.ps1")
  8. $out = Join-Path $project "build\calls-test"
  9. $disk = Join-Path $out "calls-test.d81"
  10. $failures = @()
  11. $session = Start-Nova128X128 -Autostart $disk -Drive8Image $disk -Port $Port `
  12. -Screenshot (Join-Path $out "calls-vicii.png")
  13. try {
  14. $mb = Wait-Nova128Mailbox $session -TimeoutSeconds $TimeoutSeconds
  15. } finally {
  16. Stop-Nova128X128 $session
  17. }
  18. Write-Host ("mailbox: " + (($mb | ForEach-Object { $_.ToString('X2') }) -join ' '))
  19. if ($mb[2] -ne 0x02) { $failures += "producer $($mb[2]) expected 2 (compiler)" }
  20. if ($mb[3] -ne 0xA5) { $failures += ("fixture status {0:X2} failed at stage {1}" -f $mb[3], $mb[4]) }
  21. if ($mb[8] -ne 0) { $failures += "diagnostics present: $($mb[8])" }
  22. if ($mb[9] -ne 0) { $failures += "emitter error $($mb[9])" }
  23. if ($mb[10] -ne 2) { $failures += "n = $($mb[10]), expected 2" }
  24. if ($mb[12] -ne 0) { $failures += "codegen error $($mb[12])" }
  25. if ($mb[13] -ne 0) { $failures += "flow error $($mb[13])" }
  26. if ($failures) { throw ("calls verification failed:`n " + ($failures -join "`n ")) }
  27. Write-Host ("emitted {0} bytes; self.n = 2 after self.tick()" -f $mb[11])
  28. Write-Host "verified self field emission and a forward concrete self-call in x128"

Powered by TurnKey Linux.