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

[P4Testgen] Add a test case generation API to P4Testgen. #4374

Merged
merged 1 commit into from
Feb 13, 2024

Conversation

fruffy
Copy link
Collaborator

@fruffy fruffy commented Jan 29, 2024

This PR adds the functionality to directly call into P4Testgen to generate tests, instead of writing the tests out to a file. This is useful for calling into P4Testgen directly in case you do not have memory constraints or consider the generated tests temporary objects. There is much more to be done to make this pleasant to use but this PR adds basic support. The newly added test api_test.cpp shows how this API could be used.

The changes mostly involve refactoring to the test framework infrastructure. Currently, this functionality is only supported for Protobuf tests in BMv2, but can be extended to others.

This PR depends on #4372, #4369, and #4303.

@fruffy fruffy added the p4tools Topics related to the P4Tools back end label Jan 29, 2024
@fruffy fruffy force-pushed the fruffy/testgen_library_api branch 4 times, most recently from 14c6eb2 to 7a19dce Compare February 1, 2024 14:16
@fruffy fruffy changed the base branch from main to fruffy/metrics February 5, 2024 21:21
@fruffy fruffy force-pushed the fruffy/metrics branch 3 times, most recently from c623011 to 44b677b Compare February 8, 2024 23:14
Base automatically changed from fruffy/metrics to main February 9, 2024 00:46
@fruffy fruffy force-pushed the fruffy/testgen_library_api branch 5 times, most recently from 1c0f91c to 54d8110 Compare February 12, 2024 14:59
@fruffy fruffy changed the base branch from main to fruffy/bazel_buildifier February 12, 2024 15:00
@fruffy fruffy marked this pull request as ready for review February 12, 2024 15:01
@fruffy fruffy changed the title [P4Testgen][WiP] Add a test case generation API to P4Testgen. [P4Testgen] Add a test case generation API to P4Testgen. Feb 12, 2024
Copy link
Member

@smolkaj smolkaj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, this is a welcome addition!

Base automatically changed from fruffy/bazel_buildifier to main February 12, 2024 21:37
@fruffy fruffy force-pushed the fruffy/testgen_library_api branch 2 times, most recently from 6544bdb to 378f47e Compare February 12, 2024 22:13
@fruffy fruffy enabled auto-merge (squash) February 12, 2024 22:13
@fruffy fruffy merged commit 1b33bbc into main Feb 13, 2024
16 checks passed
@fruffy fruffy deleted the fruffy/testgen_library_api branch February 13, 2024 02:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p4tools Topics related to the P4Tools back end
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants