def __init__(self, options): """! ctor """ self.options = options self.logger = HtrunLogger('HTST') # Handle extra command from if options: if options.enum_host_tests: path = self.options.enum_host_tests enum_host_tests(path, verbose=options.verbose) if options.list_reg_hts: # --list option print_ht_list(verbose=options.verbose) sys.exit(0) if options.list_plugins: # --plugins option host_tests_plugins.print_plugin_info() sys.exit(0) if options.version: # --version import pkg_resources # part of setuptools version = pkg_resources.require("mbed-host-tests")[0].version print version sys.exit(0) if options.send_break_cmd: # -b with -p PORT (and optional -r RESET_TYPE) handle_send_break_cmd(port=options.port, disk=options.disk, reset_type=options.forced_reset_type, baudrate=options.baud_rate, verbose=options.verbose) sys.exit(0) if options.global_resource_mgr: # If Global Resource Mgr is working it will handle reset/flashing workflow # So local plugins are offline self.options.skip_reset = True self.options.skip_flashing = True if options.compare_log: with open(options.compare_log, "r") as f: self.compare_log = f.read().splitlines() else: self.compare_log = None self.serial_output_file = options.serial_output_file self.compare_log_idx = 0 DefaultTestSelectorBase.__init__(self, options)
def __init__(self, options): """! ctor """ self.options = options self.logger = HtrunLogger("HTST") # Handle extra command from if options: if options.enum_host_tests: path = self.options.enum_host_tests enum_host_tests(path, verbose=options.verbose) if options.list_reg_hts: # --list option print_ht_list(verbose=options.verbose) sys.exit(0) if options.list_plugins: # --plugins option host_tests_plugins.print_plugin_info() sys.exit(0) if options.version: # --version import pkg_resources # part of setuptools version = pkg_resources.require("mbed-host-tests")[0].version print version sys.exit(0) if options.send_break_cmd: # -b with -p PORT (and optional -r RESET_TYPE) handle_send_break_cmd( port=options.port, disk=options.disk, reset_type=options.forced_reset_type, baudrate=options.baud_rate, verbose=options.verbose, ) sys.exit(0) if options.global_resource_mgr: # If Global Resource Mgr is working it will handle reset/flashing workflow # So local plugins are offline self.options.skip_reset = True self.options.skip_flashing = True DefaultTestSelectorBase.__init__(self, options)
def __init__(self, options): """! ctor """ self.options = options self.prn_lock = Lock() self.logger = HtrunLogger(self.prn_lock, 'HTST') # Handle extra command from if options: if options.enum_host_tests: path = self.options.enum_host_tests enum_host_tests(path, verbose=options.verbose) if options.list_reg_hts: # --list option print_ht_list() sys.exit(0) if options.list_plugins: # --plugins option host_tests_plugins.print_plugin_info() sys.exit(0) if options.version: # --version import pkg_resources # part of setuptools version = pkg_resources.require("mbed-host-tests")[0].version print version sys.exit(0) if options.send_break_cmd: # -b with -p PORT (and optional -r RESET_TYPE) handle_send_break_cmd(port=options.port, disk=options.disk, reset_type=options.forced_reset_type, verbose=options.verbose) sys.exit(0) DefaultTestSelectorBase.__init__(self, options)