p4lang / p4analyzer

A Language Server Protocol (LSP) compliant analyzer for the P4 language
Apache License 2.0
19 stars 3 forks source link

Cargo Tester: Pre-made File Loader Refactoring #4

Open AndrewF001 opened 1 year ago

AndrewF001 commented 1 year ago

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

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.