hyppotest

Hyppotest is a tool @Paul Gardner-Stephen introduced into the mega65-core repo to run a suite of automated tests on the hypervisor.

  • Source-code is located at src/tools/hyppotest.c

  • Can be built from the base of mega65-core repo with make src/tools/hyppotest

 

To run the tool, just provide the name of a test-script to execute, e.g.:

./hyppotest hyppotest-self.test

[PASS] assemble with acme [PASS] poke directive [PASS] check mem [PASS] ignore reg directives [PASS] clear breakpoint directives [PASS] step and run directives [PASS] let directive [ ] flag directivesAborted (core dumped)

 

Jimbo has made improvements in this PR which has been merged into development branch:

 

I’ll paste the details he shared there into here, as a starting point for documentation on this tool:

Enhancements

  • The lines of hyppotest test files can be freely indented with initial whitespace.

  • hyppotest can run just a specific test in a test file.

    • hyppotest can take a 2nd optional command-line argument, which is the name of a test in the test file.

    • When this 2nd argument is present, hyppotest only runs the named test. hyppotest ignores any other tests in the test file.

  • hyppotest can test the CPU flags as the F register.

  • The instruction log's capacity has been doubled.

  • hyppotest can execute and disassemble all (officially documented) 6502 and 65C02 opcodes.

  • Additional test files

    • src/tools/hyppotest-self.test tests some of hyppotest's directives.

    • src/tools/hyppotest-opcodes.test tests hyppotest's (officially documented) 6502 and 65c02 opcodes.

      • Decimal mode is not tested.

      • This runs the 6502 and 65c02 test suites developed by Klaus Dormann (Klaus2m5).

      • There is a fork of this work for building these test suites so they're suitable for hyppotest.

      • This code has a GPL 3 license, so it can't be incorporated directly into this project.

      • Prebuilt bin and lbl files are available from Releases · jimnicholls/6502_65C02_functional_tests .

New test directives

There are new directives for use in hyppotest test files.

  • allow stack <overflow|underflow>

  • assemble [at <address|symbol>] with acme

  • check regs

    • synonym for check registers

  • check <mem|memory>

    • synonym for check ram

  • clear all breakpoints

  • clear breakpoint (address|symbol)

  • clear flag flag

  • define name as value

  • end assemble

  • end test

    • synonym for test end

  • expect flag flag is <clear|set>

  • forbid stack <overflow|underflow>

  • let reg = value

    • Presets the value of a register

  • poke <address|symbol>, value[, value…]

  • ignore reg name

    • Excludes the named register from the check registers directive.

  • ignore all regs

  • run until <brk|jsr>

  • set flag flag

  • step [count]

Fixes

  • For the jmp and jsr directives:

    • arguments like $nnnn are interpreted as literal addresses; and

    • symbols can be either hyppo or non-hyppo symbols.

  • Negative symbol deltas (eg sym-16 or sym-$0a) calculate the correct address.

  • make clean deletes the tool binaries that had been built and the FAIL and PASS files output by hyppotest.

  • Git ignores the FAIL and PASS files output by hyppotest.

  • hyppotest consistently writes to the simulated ram and leaves the expected ram for the expect and check directives.

  • A test fails if any of the directives in the test fail.

  • The base register is set to 0 when hyppotest starts execution outside the hyppo.

  • When hyppotest can't read the test file, the error message from hyppotest includes the name of the test file.

  • hyppotest shows addresses that exactly match a symbol as that symbol.