Add unit tests with top-level Makefile.
@robertsoule-barefoot ,can you please provide the description regarding the issue
It has been a few years since Robert was actively contributing to this repository.
From the title, I think the basic idea is to have some kind of automated unit tests that some subset of the code in this repository can be verified that they pass, or fail if the test finds a bug, that can be run by just running one or two commands from a shell, e.g. cd <some-directory>; make check or something like that.
Note that right now I do not recall there being any such tests in this repository, so there are no existing examples in this repository to work from.
There are automated tests such as PTF tests that exist in other p4lang repositories that might be helpful as ideas to start from, e.g.:
- https://github.com/jafingerhut/p4-guide/blob/master/demo1/README-ptf.md
- https://github.com/jafingerhut/p4-guide/tree/master/ptf-tests
Note that those PTF tests use different Python APIs than the tutorials repository does for adding/modifying/deleting table entries, which can be confusing when you first encounter such differences.