-
Notifications
You must be signed in to change notification settings - Fork 444
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
Restructure P4Tools to easily add new modules. #3646
Conversation
e393a29
to
f5e4a24
Compare
bceeb92
to
11aa399
Compare
${TESTGEN_LIBS} | ||
) | ||
|
||
add_p4tools_executable(p4testgen main.cpp) | ||
|
||
target_link_libraries( | ||
p4testgen |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should p4testgen
be removed?
|
||
try { | ||
P4Tools::P4Testgen::Testgen().main(args); | ||
} catch (const Util::CompilerBug& e) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should add a util function and replace CompilerBug
to ToolsBug
, TestgenBug
or something (not in this PR).
@@ -3,7 +3,7 @@ include(${CMAKE_CURRENT_LIST_DIR}/../../../cmake/TestUtils.cmake) | |||
# Add v1model tests from the p4c submodule | |||
set(P4TOOLS_BINARY_DIR ${CMAKE_SOURCE_DIR}/build) | |||
set(P4TESTGEN_DIR ${CMAKE_SOURCE_DIR}/build/testgen) | |||
set(P4TESTGEN_DRIVER "${P4TOOLS_BINARY_DIR}/p4check testgen") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So p4check
doesn't exist at all now. Any module needs to be invoked via it's name like p4testgen
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, after this PR p4check
does not exist any more. All tests are run with the p4testgen
binary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thank you!
11aa399
to
6c9def4
Compare
6c9def4
to
aadb401
Compare
This PR restructures P4Tools such that it is easier to add new modules to the framework. The PR removes the p4check binary and instead adds a binary per module. This means, instead of
p4check testgen
one can now callp4testgen
directly.To add a new module, a folder inside
p4tools/modules
with a correspondingCMakelists
file needs to be created. The CMake script should pick this up directly.