예제 #1
0
    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)
예제 #2
0
    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)
예제 #3
0
    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)
예제 #4
0
    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)
예제 #5
0
    def __init__(self, options):
        """! ctor
        """
        self.options = options

        self.logger = HtrunLogger('HTST')

        self.registry = HostRegistry()
        self.registry.register_host_test("echo", EchoTest())
        self.registry.register_host_test("default", DefaultAuto())
        self.registry.register_host_test("rtc_auto", RTCTest())
        self.registry.register_host_test("hello_auto", HelloTest())
        self.registry.register_host_test("detect_auto", DetectPlatformTest())
        self.registry.register_host_test("default_auto", DefaultAuto())
        self.registry.register_host_test("wait_us_auto", WaitusTest())
        self.registry.register_host_test("dev_null_auto", DevNullTest())

        # Handle extra command from
        if options:
            if options.enum_host_tests:
                for path in options.enum_host_tests:
                    self.registry.register_from_path(path,
                                                     verbose=options.verbose)

            if options.list_reg_hts:  # --list option
                print(self.registry.table(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 or options.fast_model_connection:
                # If Global/Simulator 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)