@@ -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+
729747def 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 , "\n x Execution" )
790792 elif skip :
791793 cprint (pcolor .yellow , "\n s Execution" )
792794 else :
793795 cprint (pcolor .green , "\n o 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