Skip to content

Commit 6648c5b

Browse files
committed
9pm.py move base/cmdl suite creation to function
Purely cosmetic change. Signed-off-by: Richard Alpe <[email protected]>
1 parent e2ff38e commit 6648c5b

File tree

1 file changed

+25
-23
lines changed

1 file changed

+25
-23
lines changed

9pm.py

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -726,6 +726,24 @@ def pr_proj_info(proj):
726726

727727
cprint(pcolor.yellow, str)
728728

729+
def create_base_suite(args):
730+
suite = {'name': 'command-line', 'suite': []}
731+
for filename in args.suites:
732+
fpath = os.path.join(os.getcwd(), filename)
733+
if filename.endswith('.yaml'):
734+
suite['suite'].append(parse_suite(fpath, "command-line", args.option, {}))
735+
else:
736+
test = {}
737+
test['case'] = fpath
738+
test['name'] = gen_name(filename)
739+
test['outfile'] = gen_outfile(test['name'])
740+
741+
if args.option:
742+
test["options"] = args.option
743+
744+
suite['suite'].append(test)
745+
return suite
746+
729747
def main():
730748
global DATABASE
731749
global SCRATCHDIR
@@ -763,39 +781,23 @@ def main():
763781

764782
pr_proj_info(proj)
765783

766-
cmdl = {'name': 'command-line', 'suite': []}
767-
for filename in args.suites:
768-
fpath = os.path.join(os.getcwd(), filename)
769-
if filename.endswith('.yaml'):
770-
cmdl['suite'].append(parse_suite(fpath, "command-line", args.option, {}))
771-
else:
772-
test = {}
773-
test['case'] = fpath
774-
test['name'] = gen_name(filename)
775-
test['outfile'] = gen_outfile(test['name'])
776-
777-
if args.option:
778-
test["options"] = args.option
779-
780-
cmdl['suite'].append(test)
781-
782-
783-
probe_suite(cmdl)
784+
suite = create_base_suite(args)
785+
probe_suite(suite)
784786

785787
setup_env(args)
786788

787-
skip, err = run_suite(args, cmdl, False)
789+
skip, err = run_suite(args, suite, False)
788790
if err:
789791
cprint(pcolor.red, "\nx Execution")
790792
elif skip:
791793
cprint(pcolor.yellow, "\ns Execution")
792794
else:
793795
cprint(pcolor.green, "\no Execution")
794796

795-
print_result_tree(cmdl, "")
796-
write_md_result(cmdl)
797-
write_github_result(cmdl)
798-
write_report(cmdl, proj)
797+
print_result_tree(suite, "")
798+
write_md_result(suite)
799+
write_github_result(suite)
800+
write_report(suite, proj)
799801

800802
db.close()
801803
sys.exit(err)

0 commit comments

Comments
 (0)