コード例 #1
0
ファイル: __init__.py プロジェクト: rchande/nanaimo
    def on_visit_test_arguments(cls, arguments: nanaimo.Arguments) -> None:
        arguments.add_argument('--port', help='The port to monitor.')

        arguments.add_argument(
            '--port-speed',
            default=9600,
            help='the speed of the port (e.g. baud rate for serial ports).')
コード例 #2
0
 def on_visit_test_arguments(cls, arguments: nanaimo.Arguments) -> None:
     arguments.add_argument('--port',
                            enable_default_from_environ=True,
                            default='10429',
                            help='TCP port for the logic socket server.')
     arguments.add_argument('--host',
                            enable_default_from_environ=True,
                            default='localhost',
                            help='hostname for the logic socket server.')
コード例 #3
0
 def on_visit_test_arguments(cls, arguments: nanaimo.Arguments) -> None:
     super().on_visit_test_arguments(arguments)
     arguments.add_argument('--file', help='The file to upload.')
     arguments.add_argument('--remote-dir',
                            help='The directory to upload to.')
     arguments.add_argument(
         '--target', help='The IP or hostname for the target system.')
     arguments.add_argument('--as-user', help='The user to upload as.')
     arguments.add_argument('--identity', help='The identify file to use')
コード例 #4
0
ファイル: fixtures.py プロジェクト: karlin/nanaimo
    def visit_test_arguments(cls, arguments: nanaimo.Arguments) -> None:
        """
        Visit this fixture's :meth:`on_visit_test_arguments` but with the
        proper :data:`nanaimo.Arguments.required_prefix` set.
        """

        previous_required_prefix = arguments.required_prefix
        arguments.required_prefix = cls.get_argument_prefix().replace('_', '-')
        cls.on_visit_test_arguments(arguments)
        arguments.required_prefix = previous_required_prefix
コード例 #5
0
 def on_visit_test_arguments(cls, arguments: nanaimo.Arguments) -> None:
     nanaimo.connections.uart.ConcurrentUart.on_visit_test_arguments(
         arguments)
     arguments.add_argument('--pattern',
                            default='.*',
                            enable_default_from_environ=True,
                            help=textwrap.dedent('''
             A Python regular expression that will be matched against each line of
             serial input received. This fixture gathers input until either this
             pattern is matched or the gather times out.''').lstrip())
     arguments.add_argument('--disruption',
                            default='\r\n',
                            help=textwrap.dedent('''
             Characters to send periodically on the serial link in an attempt to wake
             up connected hosts and get a default response.''').lstrip())
     arguments.add_argument('--disturb-rate',
                            type=float,
                            help=textwrap.dedent('''
             The rate at which the watcher will input the disruption characters to try
             to get the device on the other end of the serial pipe to respond
             (in fractional seconds)''').lstrip())
     arguments.add_argument('--update-period',
                            type=float,
                            help=textwrap.dedent('''
             The rate at which a message is logged when waiting for a log time. This
             provides feedback that the fixture is still active but that the pattern
             has not yet been matched. Omit to squelch the update message.
             (This argument is in fractional seconds).
                         ''').lstrip())
コード例 #6
0
 def on_visit_test_arguments(cls, arguments: nanaimo.Arguments) -> None:
     super().on_visit_test_arguments(arguments)
     arguments.add_argument(
         '--target', help='The IP or hostname for the target system.')
     arguments.add_argument('--as-user', help='The user to upload as.')
     arguments.add_argument('--command', help='The command to run.')
     arguments.add_argument('--identity', help='The identify file to use')
コード例 #7
0
ファイル: fixtures.py プロジェクト: rchande/nanaimo
 def on_visit_test_arguments(cls, arguments: nanaimo.Arguments) -> None:
     arguments.add_argument('--cwd', help='The working directory to launch the subprocess at.')
     arguments.add_argument('--logfile', help='Path to a file to write stdout, stderr, and test logs to.')
     arguments.add_argument('--logfile-amend',
                            default=False,
                            help=textwrap.dedent('''
                            If True then the logfile will be amended otherwise it will be overwritten
                            (the default)
                            ''').strip())
     arguments.add_argument('--logfile-format',
                            default='%(asctime)s %(levelname)s %(name)s: %(message)s',
                            help='Logger format to use for the logfile.')
     arguments.add_argument('--logfile-date-format',
                            default='%Y-%m-%d %H:%M:%S',
                            help='Logger date format to use for the logfile.')
コード例 #8
0
ファイル: __init__.py プロジェクト: rchande/nanaimo
 def on_visit_test_arguments(cls, arguments: nanaimo.Arguments) -> None:
     arguments.add_argument('--model',
                            default='ykush3',
                            help='The ykush board type.')
     arguments.add_argument('--serial',
                            help='A serial number of the board to send the command to.')
     arguments.add_argument('--command',
                            help='Simple pass through of arguments to {}'.format(cls.ykush_cmd))
     arguments.add_argument('--all-on',
                            action='store_true',
                            help='Turn on power to all ports (--{}-command will be ignored)'
                            .format(cls.argument_prefix))
     arguments.add_argument('--all-off',
                            action='store_true',
                            help='Turn on power to all ports (--{}-command will be ignored)'
                            .format(cls.argument_prefix))
コード例 #9
0
ファイル: fixtures.py プロジェクト: karlin/nanaimo
    def on_visit_test_arguments(cls, arguments: nanaimo.Arguments) -> None:
        arguments.add_argument(
            '--cwd', help='The working directory to launch the subprocess at.')
        arguments.add_argument(
            '--logfile',
            help='Path to a file to write stdout, stderr, and test logs to.')
        arguments.add_argument('--logfile-amend',
                               default=False,
                               help=textwrap.dedent('''
                               If True then the logfile will be amended otherwise it will be overwritten
                               (the default)
                               ''').strip())
        arguments.add_argument(
            '--logfile-format',
            default='%(asctime)s %(levelname)s %(name)s: %(message)s',
            help='Logger format to use for the logfile.')
        arguments.add_argument(
            '--logfile-date-format',
            default='%Y-%m-%d %H:%M:%S',
            help='Logger date format to use for the logfile.')
        arguments.add_argument('--log-stdout',
                               action='store_true',
                               help=textwrap.dedent('''
                               Log stdout to the logfile as INFO logs. This also makes the stdout text
                               available to the stdout_filter for this fixture.

                               WARNING: Setting this flag may impact performance if the subprocess sends
                               a significant amount of data through stdout. The fixture buffers all
                               data sent through pipes in-memory when this flag is set. Prefer subprocesses
                               that log data directly to disk and filter on that file instead.
                               ''').strip())
        arguments.add_argument('--log-stderr',
                               action='store_true',
                               help=textwrap.dedent('''
                               Log stderr to the logfile as ERROR logs. This also makes the stderr text
                               available to the stderr_filter for this fixture.

                               WARNING: Setting this flag may impact performance if the subprocess sends
                               a significant amount of data through stderr. The fixture buffers all
                               data sent through pipes in-memory when this flag is set. Prefer subprocesses
                               that log data directly to disk and filter on that file instead.
                               ''').strip())
コード例 #10
0
 def on_visit_test_arguments(cls, arguments: nanaimo.Arguments) -> None:
     arguments.add_argument('--serial-port', help='The serial port the character display is attached to.')
コード例 #11
0
 def on_visit_test_arguments(cls, arguments: nanaimo.Arguments) -> None:
     _CharacterDisplayAdafruitSerialBackpack.on_visit_test_arguments(arguments)
     arguments.add_argument('--default-message', help='A message to display when the screen is cleared.')
     arguments.add_argument('--columns', default=16, help='The number of characters in a line of text for '
                            'this display.')
     arguments.add_argument('--lines', default=2, help='The number of lines on the display.')
     arguments.add_argument('--write', help='A string to write to the display.')
     arguments.add_argument('--configure', action='store_true', help='Configures the display to use '
                            'configured values (e.g. columns and lines).')
     arguments.add_argument('--clear', action='store_true', help='Clear the screen.')
     arguments.add_argument('--clear-to-default',
                            action='store_true',
                            help='Clear the screen and display the default message.')
     arguments.add_argument('--status',
                            choices=['okay', 'busy', 'fail'],
                            help='Display an overall status for the tests. How this is represented is dependant'
                                 ' on the display.')
コード例 #12
0
    def on_visit_test_arguments(cls, arguments: nanaimo.Arguments) -> None:
        super().on_visit_test_arguments(arguments)
        arguments.add_argument(
            '--exe',
            default='JLinkExe',
            help='A path to the jlink commander executable.')
        arguments.add_argument('--hexfile',
                               help='Path to a hex file to upload.')
        arguments.add_argument('--device', help='The target device.')
        arguments.add_argument('--interface-speed-khz',
                               help='The interface speed in kilohertz',
                               default='default')
        arguments.add_argument(
            '--serial-interface',
            help='The serial interface to use (e.g. swd, jtag)',
            default='swd')
        arguments.add_argument(
            '--reset-delay-millis',
            default=400,
            help=
            'Milliseconds to wait after reset before starting to load the new image.'
        )
        arguments.add_argument('--script',
                               default=None,
                               help=textwrap.dedent('''
                            Path to a jlink script to use. If not provided then an script will be generated using an
                            internal default. The following template parameters are supported but optional:

                                {device}             = The target device.
                                {speed}              = The interface speed in kilohertz
                                {serial_interface}   = The serial interface to use.
                                {reset_delay_millis} = An optional delay to include after reset.
                                {hexfile}            = The hexfile to upload.
                            ''').lstrip())
コード例 #13
0
 def on_visit_test_arguments(cls, arguments: nanaimo.Arguments) -> None:
     super().on_visit_test_arguments(arguments)
     arguments.add_argument('--shell', '-C', help='A shell command to run as a subprocess.')
コード例 #14
0
 def on_visit_test_arguments(cls, arguments: nanaimo.Arguments) -> None:
     arguments.add_argument('--port',
                            enable_default_from_environ=True,
                            help='The port the BK Precision power supply is connected to.')
     arguments.add_argument('--command', '--BC',
                            help='command', default='?')
     arguments.add_argument('--command-timeout',
                            enable_default_from_environ=True,
                            help='time out for individual commands.', default=4.0)
     arguments.add_argument('--target-voltage',
                            enable_default_from_environ=True,
                            type=float,
                            help='The target voltage')
     arguments.add_argument('--target-voltage-threshold-rising',
                            enable_default_from_environ=True,
                            type=float,
                            default=0.2,
                            help='Voltage offset from the target voltage to trigger on when the voltage is rising.')
     arguments.add_argument('--target-voltage-threshold-falling',
                            enable_default_from_environ=True,
                            type=float,
                            default=0.01,
                            help='Voltage offset from the target voltage to trigger on when the voltage is falling.')
コード例 #15
0
ファイル: nanaimo_gather.py プロジェクト: rchande/nanaimo
 def on_visit_test_arguments(cls, arguments: nanaimo.Arguments) -> None:
     arguments.add_argument('--coroutine', action='append')