Skip to content

Commit

Permalink
tests/lone/types: improve test generation macros
Browse files Browse the repository at this point in the history
Exhaustively generate every possible test case symbol by defining
a macro with every possible parameter and then repeatedly defining
partially applied variants for every possible parameter value.
The eventual result is a zero arity function which generates a
list of test function symbols containing every possible test.
The list is comma separated, making it ideal for initializing
an array of test cases.

If a function is defined in the source code but is not in the
test cases array, the compiler emits a warning. If undefined
function names are generated by these macros, the compiler
emits an error.

Also, decompose the lone types into signedness and bits parameters.
This also allows generating tests for unaligned 8 bit operations
with no unnecessary packed attribute warnings. I know that bytewise
memory access is always aligned but test it anyway for completeness.
  • Loading branch information
matheusmoreira committed Jul 11, 2024
1 parent a423e6d commit 98dc063
Showing 1 changed file with 360 additions and 403 deletions.
Loading

0 comments on commit 98dc063

Please sign in to comment.