示例#1
0
文件: __init__.py 项目: Patater/htrun
    def __init__(self, options=None):
        """! ctor
        """
        self.options = options

        # 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
                self.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)
                self.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)
示例#2
0
    def __init__(self, options):
        """! ctor
        """
        self.options = options

        # 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
                self.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)
                self.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)
示例#3
0
    def __init__(self, options=None):
        """! ctor
        """
        self.options = options

        # Handle extra command from
        if options:
            if options.list_reg_hts:    # --list option
                self.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)

        DefaultTestSelectorBase.__init__(self, options)
示例#4
0
    def __init__(self, options):
        """! ctor
        """
        self.options = options

        # 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
                self.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)
                self.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)

        # Following flag is to indicate to this selector that parent process wants it to abort.
        # It would to set by self.abort() by parent_monitor_thread() thread in mbedhtrun.py.
        # Since this selector does not employ a loop and immediate exit is not necessary we don't need locking around it
        self.aborted = False