The Tester cargo is intended to make testing easier & standardized. The feature in question is the loading of pre-made P4 files. Current implementation is a built in-house with fs::read_to_string and loads files dynamically from a resource folder based on a file name or array index. The proposed change is to swap to resource_str macro.
Pros
Not built in-house, so can rely on it
Can load files statically
Cons
Files could be large for them to be stored statically
CRLF/LF formatting behavior (discussed below)
Other
There is a lack of standard for line endings in LSP 1.7 and Wasm which has created a platform-specific discrepancies between files for whether to use CRLF or LF. Because of this, I believe the testing process should support both to iron out parser bugs!
In the future I would also like to add an extra confirmation stage to the CI/CD that given the same files P4 analyzer can spot compiler errors the same as P4 compiler. This issues shouldn't affect the prospect of this but something to be mindful of.
Proposal
The Tester cargo is intended to make testing easier & standardized. The feature in question is the loading of pre-made P4 files. Current implementation is a built in-house with
fs::read_to_string
and loads files dynamically from a resource folder based on a file name or array index. The proposed change is to swap to resource_str macro.Pros
Cons
Other
There is a lack of standard for line endings in LSP 1.7 and Wasm which has created a platform-specific discrepancies between files for whether to use CRLF or LF. Because of this, I believe the testing process should support both to iron out parser bugs!
In the future I would also like to add an extra confirmation stage to the CI/CD that given the same files P4 analyzer can spot compiler errors the same as P4 compiler. This issues shouldn't affect the prospect of this but something to be mindful of.