'Executes the suite based based the given ``settings`` or ``options``.
:param settings: :class:`~robot.conf.settings.RobotSettings` object
to configure test execution.
:param options: Used to construct new
:class:`~robot.conf.settings.RobotSettings` object if ``settings``
are not given.
:return: :class:`~robot.result.executionresult.Result` object with
information about executed suites and tests.
If ``options`` are used, their names are the same as long command line
options except without hyphens, and they also have the same semantics.
Options that can be given on the command line multiple times can be
passed as lists like ``variable=[\'VAR1:value1\', \'VAR2:value2\']``.
If such an option is used only once, it can be given also as a single
string like ``variable=\'VAR:value\'``.
Additionally listener option allows passing object directly instead of
listener name, e.g. ``run(\'tests.robot\', listener=Listener())``.
To capture stdout and/or stderr streams, pass open file objects in as
special keyword arguments ``stdout`` and ``stderr``, respectively.
Note that this works only in version 2.8.4 and newer.
Only options related to the actual test execution have an effect.
For example, options related to selecting test cases or creating
logs and reports are silently ignored. The output XML generated
as part of the execution can be configured, though. This includes
disabling it with ``output=None``.
Example::
stdout = StringIO()
result = suite.run(variable=\'EXAMPLE:value\',
critical=\'regression\',
output=\'example.xml\',
exitonfailure=True,
stdout=stdout)
print result.return_code
To save memory, the returned
:class:`~robot.result.executionresult.Result` object does not
have any information about the executed keywords. If that information
is needed, the created output XML file needs to be read  using the
:class:`~robot.result.resultbuilder.ExecutionResult` factory method.
See the :mod:`package level <robot.running>` documentation for
more examples, including how to construct executable test suites and
how to create logs and reports based on the execution results.
See the :func:`robot.run <robot.run.run>` function for a higher-level
API for executing tests in files or directories.'

def run(self, settings=None, **options):

    from .namespace import IMPORTER
    from .signalhandler import STOP_SIGNAL_MONITOR
    from .runner import Runner
    with LOGGER:
        if (not settings):
            settings = RobotSettings(options)
            LOGGER.register_console_logger(**settings.console_output_config)
        with pyloggingconf.robot_handler_enabled(settings.log_level):
            with STOP_SIGNAL_MONITOR:
                IMPORTER.reset()
                output = Output(settings)
                runner = Runner(output, settings)
                self.visit(runner)
            output.close(runner.result)
    return runner.result
