Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use parametrized tests #47

Merged
merged 10 commits into from
May 22, 2024
Merged

Use parametrized tests #47

merged 10 commits into from
May 22, 2024

Conversation

janvrany
Copy link
Owner

No description provided.

This commit fixes old bugs in shells caused (probably) by renaming
instance variables.
This commit introduces POWER-specific `TRPPCRegister` class. The main
reason is that different tools use different register names:

 * Tinyrossa (as well as Testarossa) use `gr0`, `gr1` for GPRs,
 * GDB uses just `r0`, `r1` and so on and
 * in assembly (and ArchC) plain `0`, `1` is used.

Having a custom subclass allows for having multiple methods returning
register names suitable for given tool.
This commit implements `#call` and `#call:` to reduce code duplication
in tests. These methods care for injecting the code, setting up
parameters (in registers) and extracting return value (from return
register). All this is done in target and linkage neutral way, though
some extra support in linkages is needed.

In order to do that, shell objects now hold on whole compilation rather
than just the target.
This commit turns `TRCompilationTestCase` to parametrized testcase
without changing tests themselves.
This commit update RISC-V compilation tests to use new shell helper
methods introduced in previous commit.
This commit update POWER compilation tests to use new shell helper
methods introduced in previous commit.
...to reduce code duplication. Tests that do now work on all targets
are selectively skipped. This has the nice side-effect of documenting
what's missing in particular for particular architectures.
@janvrany janvrany merged commit 1e47ec1 into master May 22, 2024
2 checks passed
@janvrany janvrany deleted the pr/use-parametrized-tests branch May 22, 2024 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant