From 56bd3a685eb47c96623e148989e5a94cf14e84ba Mon Sep 17 00:00:00 2001 From: Grant Likely Date: Wed, 18 Aug 2021 11:37:01 +0100 Subject: [PATCH 1/3] Add a quickstart guide. Adds some simple instructions to the top of the README file so that a users doesn't need to go searching for the instructions. Signed-off-by: Grant Likely --- README.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d44c60e..717e092 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# SCT_Parser +# EDK2 SCT Results Parser This is an external parser script for [UEFI SCT]. (WIP) @@ -9,6 +9,19 @@ It will proceed to generate a Markdown file listing number of failures, passes, [UEFI SCT]: https://uefi.org/testtools +## Quick Start + +If you're using this tool to analyze EBBR test results, use the following +command. The parsed report can be found in `result.md`. + +``` {.sh} +$ ./parser.py --config EBBR.yaml \ + \ + +INFO apply_rules: Updated 200 test(s) out of 12206 after applying 124 rule(s) +INFO main: 0 dropped(s), 1 failure(s), 93 ignored(s), 106 known u-boot limitation(s), 12006 pass(s), 0 warning(s) +``` + ## Usage Usage to generate a "result md" is such. `python3 parser.py ` If you do no provided any command line arguments it will use `sample.ekl` and `sample.seq`. -- GitLab From 8c5be594103e4389112862210d7384a99c77564a Mon Sep 17 00:00:00 2001 From: Grant Likely Date: Wed, 18 Aug 2021 11:56:22 +0100 Subject: [PATCH 2/3] Use __init__ == '__main__' pattern in script Use the typical __init__ == '__main__' pattern to determine if the code is being run as a script, and only execute the main code if true. This makes the code more portable to other projects. Signed-off-by: Grant Likely --- parser.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/parser.py b/parser.py index 62be4ba..6d2855b 100755 --- a/parser.py +++ b/parser.py @@ -578,7 +578,7 @@ def combine_dbs(db1, db2): return cross_check -def main(): +if __name__ == '__main__': parser = argparse.ArgumentParser( description='Process SCT results.' ' This program takes the SCT summary and sequence files,' @@ -751,6 +751,3 @@ def main(): print( x["guid"], ":", x["name"], "with", args.find_key, ":", x[args.find_key]) - - -main() -- GitLab From 023d030c1290c495da6933aa481543ac5fe21e3b Mon Sep 17 00:00:00 2001 From: Grant Likely Date: Wed, 18 Aug 2021 11:57:43 +0100 Subject: [PATCH 3/3] Don't use sample.ekl and sample.seq by default. The sample files are just for testing. Using them by default could hide from the user that they are calling the script wrong. Make it required to supply the .ekl and .seq files. Signed-off-by: Grant Likely --- parser.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/parser.py b/parser.py index 6d2855b..7cd9789 100755 --- a/parser.py +++ b/parser.py @@ -604,12 +604,8 @@ if __name__ == '__main__': '--uniq', action='store_true', help='Collapse duplicates') parser.add_argument( '--print', action='store_true', help='Print results to stdout') - parser.add_argument( - 'log_file', nargs='?', default='sample.ekl', - help='Input .ekl filename') - parser.add_argument( - 'seq_file', nargs='?', default='sample.seq', - help='Input .seq filename') + parser.add_argument('log_file', help='Input .ekl filename') + parser.add_argument('seq_file', help='Input .seq filename') parser.add_argument('find_key', nargs='?', help='Search key') parser.add_argument('find_value', nargs='?', help='Search value') -- GitLab