p4c icon indicating copy to clipboard operation
p4c copied to clipboard

[P4Testgen] Improve library support for P4Testgen and the P4Tools framework.

Open fruffy opened this issue 1 year ago • 0 comments

It should be possible to link P4Testgen or P4Tools in general as a library. Currently, we can only call it as a binary. For that to be possible several things need to happen first.

  • [ ] Move ProgramInfo into common. ProgramInfo will become a first-class construct of the framework.
  • [ ] Remove the Singleton patterns from Target and AbstractP4cToolOptions. No construct in the framework should be a static global singleton. Instead they will be members of ProgramInfo (#4286).
  • [ ] Split the options into compiler options and ToolsOptions. These options are currently conflated, which makes it hard to make clean library calls to the tool.
  • [x] Finally, build the P4Testgen library, which takes in CompilerOptions and P4TestgenOptions as arguments and generates tests based on these two classes.

fruffy avatar Dec 16 '23 09:12 fruffy