Update test framework documentation

This commit is contained in:
Dr. Chat 2017-05-12 18:34:01 -05:00
parent 8aac7a6007
commit 6990d21a8d
2 changed files with 17 additions and 13 deletions

View File

@ -5,25 +5,29 @@ runner.
Each test is structured as a source `[name].s` PPC assembly file and the Each test is structured as a source `[name].s` PPC assembly file and the
generated outputs. The outputs are made using the custom build of binutils generated outputs. The outputs are made using the custom build of binutils
setup when `xenia-build setup` is called and are checked in to make it easier setup when `xenia-build gentests` is called and are checked in to make it easier
to run the tests on Windows. to run the tests on Windows.
Tests are run using the `xenia-test` app or via `xenia-build test`. Tests are run using the `xenia-test` app or via `xenia-build test`.
## Execution ## Execution
The test binary is placed into memory at `0x82010000` and all other memory is **On Xenia**: The test binary is placed into memory at `0x82010000` and all other
zeroed. memory is zeroed.
All registers are reset to zero. In order to provide useful inputs tests can All registers are reset to zero. In order to provide useful inputs tests can
specify `# REGISTER_IN` values. specify `#_ REGISTER_IN` values.
The code is jumped into at the starting address and executed until the last The code is jumped into at the starting address and executed until a `blr`
instruction in the input file is reached. instruction is encountered.
After all instructions complete any `# REGISTER_OUT` values are checked and if After all instructions complete any `#_ REGISTER_OUT` values are checked and if
they do not match the test is failed. they do not match the test is failed.
## Registers
All registers **except lr, r1, and r13** are available for usage by tests.
## Annotations ## Annotations
Annotations can appear at any line in a file. If a number is required it can Annotations can appear at any line in a file. If a number is required it can
@ -32,21 +36,21 @@ be in either hex or decimal form, or IEEE if floating-point.
### REGISTER_IN ### REGISTER_IN
``` ```
# REGISTER_IN [register name] [register value] #_ REGISTER_IN [register name] [register value]
``` ```
Sets the value of a register prior to executing the instructions. Sets the value of a register prior to executing the instructions.
Examples: Examples:
``` ```
# REGISTER_IN r4 0x1234 #_ REGISTER_IN r4 0x1234
# REGISTER_IN r4 5678 #_ REGISTER_IN r4 5678
``` ```
### REGISTER_OUT ### REGISTER_OUT
``` ```
# REGISTER_OUT [register name] [register value] #_ REGISTER_OUT [register name] [register value]
``` ```
Defines the expected register value when the instructions have executed. Defines the expected register value when the instructions have executed.
@ -55,7 +59,7 @@ the value given here the test will fail.
Examples: Examples:
``` ```
# REGISTER_OUT r3 123 #_ REGISTER_OUT r3 123
``` ```
TODO: memory setup/assertions TODO: memory setup/assertions

View File

@ -4,7 +4,7 @@
# 1 = PACK_TYPE_SHORT_2 # 1 = PACK_TYPE_SHORT_2
# 2 = PACK_TYPE_2_10_10_10 # 2 = PACK_TYPE_2_10_10_10
# 3 = PACK_TYPE_FLOAT16_2 # 3 = PACK_TYPE_FLOAT16_2
# 4 = ? # 4 = PACK_TYPE_SHORT_4
# 5 = PACK_TYPE_FLOAT16_4 # 5 = PACK_TYPE_FLOAT16_4
# mask: # mask:
# must not be zero # must not be zero