-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Pytest] Add pytests to verify output from L3-dump script
This commit adds extensive Python pytests to verify that the output decoded by the Python L3-dump script, l3_dump.py, is correct and as expected based on what was logged in source files. We also add test-cases that will invoke the unit-test and use-case sample programs with L3_LOC_ENABLED=1, which will trigger default LOC-encoding. Python test machinery is provided to either validate expected outputs hard-coded in the test-case. Or, validate against expected outputs generated by running `grep` on the source-files to look for L3-logging APIs, and re-constructing the expected decoded LOC-entry (as string). In order to facilitate verifying L3-dump outputs using pytests, we do slight refactoring of main() in l3_dump.py into a separate do_main() method that returns actual-output lists used by the pytest cases to verify against expected-lists. Sample use-case programs are mildly altered to receive a `--unit-tests` argument, to only run the part of the program that generates a small # of slow and fast logging entries. (The logging done for perf-throughput measurements is skipped under this arg, to keep pytests running fast.) Apply minor corrections arising from review feedback.
- Loading branch information
Showing
7 changed files
with
711 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,6 @@ build* | |
# Skip LOC-generated files | ||
loc*h | ||
loc_filenames.c | ||
|
||
# Skip pytests cached files | ||
*__pycache__* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Oops, something went wrong.