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

tests: aot: Reuse as much of existing runtime tests as possible for AOT #2035

merged 9 commits into from Oct 21, 2021


Copy link

@danobi danobi commented Oct 13, 2021

This PR adds support to the runtime test framework for reusing as many
runtime test cases as possible for testing AOT.

Not all the AOT tests pass yet. I'll work on getting them all to pass next.
Once they all pass I'll add the AOT tests to the CI.

See individual commits for more details.

  • Language changes are updated in man/adoc/bpftrace.adoc and if needed in docs/
  • User-visible and non-trivial changes updated in
  • The new behaviour is covered by tests

Copy link
Member Author

danobi commented Oct 13, 2021

I did consider doing TestStruct fixups in but it would make the code kinda ugly if we wanted to run AOT tests and regular tests in the same runtime test run. The way I ended up choosing isn't amazing but at least everything looks ok from a style point of view (IMO).

tests/ Outdated Show resolved Hide resolved
"Utils" is not very descriptive, especially when that file contains all
the code for running the runtime tests. I think it's better to rename it
to "Runner".
Most runtime tests were doing something like:

  RUN {{BPFTRACE}} -e '<some program>'

The new directive simplifies the above line to:

  PROG <some program>

This is more terse and also lets us reuse existing tests for AOT
It's more terse and lets use reuse the test cases for AOT tests.
This commit adds support into the runtime tests to reuse
PROG-directive based test cases as AOT tests.

This is nice b/c this will ensure over time AOT does not regress
new and existing features.
Will use this in the following commits to skip AOT tests in the runtime
test suite.
A bunch of bpftrace features are currently disabled cuz they need
additional work. Skip runtime tests that use those features for now.
These were just selectively copied from existing runtime tests anyways.

Let's rely on the new reused AOT test framework.
Will be good for people new to the runtime test framework
No need to apply filter during parse. More flexible to filter later.
This also fixes the interaction between --run-aot-tests and --filter b/c
previously the AOT test creation was done in the parser after the
Copy link
Member Author

danobi commented Oct 21, 2021


@danobi danobi merged commit feb965c into bpftrace:master Oct 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

Successfully merging this pull request may close these issues.

None yet

3 participants