#NEWLINE# def main( testing = False ) : #NEWLINE# #INDENT# args = config . parseArguments ( ) #NEWLINE# args = config . mergeConfig ( args , testing ) #NEWLINE# if args . shouldExit : #NEWLINE# #INDENT# return args . exitCode #NEWLINE# #UNINDENT# sys . argv = sys . argv [ : 1 ] #NEWLINE# from green.loader import loadTargets #NEWLINE# from green.runner import run #NEWLINE# from green.output import GreenStream , debug #NEWLINE# import green.output #NEWLINE# from green.suite import GreenTestSuite #NEWLINE# GreenTestSuite . args = args #NEWLINE# if args . debug : #NEWLINE# #INDENT# green . output . debug_level = args . debug #NEWLINE# #UNINDENT# stream = GreenStream ( sys . stdout , disable_windows = args . disable_windows ) #NEWLINE# if args . completion_file : #NEWLINE# #INDENT# print ( os . path . join ( os . path . dirname ( __file__ ) , 'shell_completion.sh' ) ) #NEWLINE# return 0 #NEWLINE# #UNINDENT# if args . completions : #NEWLINE# #INDENT# from green.loader import getCompletions #NEWLINE# print ( getCompletions ( args . targets ) ) #NEWLINE# return 0 #NEWLINE# #UNINDENT# if args . options : #NEWLINE# #INDENT# print ( '\n' . join ( sorted ( args . store_opt . options ) ) ) #NEWLINE# return 0 #NEWLINE# #UNINDENT# if config . files_loaded : #NEWLINE# #INDENT# debug ( 'Loaded config file(s): {}' . format ( ', ' . join ( config . files_loaded ) ) ) #NEWLINE# #UNINDENT# if testing : #NEWLINE# #INDENT# test_suite = None #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# test_suite = loadTargets ( args . targets , file_pattern = args . file_pattern ) #NEWLINE# #UNINDENT# if ( not test_suite ) : #NEWLINE# #INDENT# debug ( 'No test loading attempts succeeded.  Created an empty test suite.' ) #NEWLINE# test_suite = GreenTestSuite ( ) #NEWLINE# #UNINDENT# result = run ( test_suite , stream , args , testing ) #NEWLINE# return int ( ( not result . wasSuccessful ( ) ) )