A previous patch changed the way tests are run by piping the output
into sed to indent the output. This broke checking the return code of
the test because the return code is really that of sed.
Fix this by taking a dependecy on bash and using PIPESTATUS to get
the return code fo the test.
Similar to gbasm, break the testing into different files for sanity's
sake. This patch also adds a "test" register state which is compared
to the state of the actual CPU registers at the end of the test.
Finally, break the inc and dec tests, but add "ld r8, r8" and "ld dr,
d8" tests.
It's not very good, but it supports all of the options by the
previous far-worse Makefile configure targets, and also now supports
out-of-tree builds.
Also include the relevent updates to the .buildbot script and
.gitignore.
Though not a real register, the operand "(hl)" fits in
better with the 8-bit registers than it does with the
sixteen bit ones. As such, move its definition.
Also, define useful values for the 8-bit operands rather
than arbitrary ones.
When getting the register index, an incorrect shift was being
used. Fix the test case by correcting this.
Signed-off-by: Max Regan <mgregan2@gmail.com>
Since we have direct access to registers via name by "cpu->a" and the
like. Use that notation in a few more places since it is far more concise.
Signed-off-by: Max Regan <mgregan2@gmail.com>
The HL dereference operations cause problems indexing into the
registers array, because it causes a hole in the array that only
exists in the 8-bit register space.
Instead of accessing the registers directly by the same indices used
in in the assembly instructions, create a lookup table to map between
them.
Signed-off-by: Max Regan <mgregan2@gmail.com>
It makes them more amenable to using their names as the
names of the lcov output reports, which complains about
the dashes.
Signed-Off-By: Max Regan <mgregan2@gmail.com>
Using lcov, generate an HTML report via "make coverage-report"
describing the coverage of each file. Ideally, this will get added to
an automated testing pipeline.
Signed-off-by: Max Regan <mgregan2@gmail.com>