Пример #1
0
def get_parser():
    here = os.path.abspath(os.path.dirname(__file__))
    build_obj = MozbuildObject.from_environment(cwd=here)
    if conditions.is_android(build_obj):
        return reftestcommandline.RemoteArgumentsParser()
    else:
        return reftestcommandline.DesktopArgumentsParser()
Пример #2
0
def run(**kwargs):
    parser = reftestcommandline.DesktopArgumentsParser()

    # Mach gives us kwargs; this is a way to turn them back into an
    # options object
    parser.set_defaults(**kwargs)

    if 'tests' in kwargs:
        options = parser.parse_args(kwargs["tests"])
    else:
        options = parser.parse_args()

    reftest = RefTest()
    parser.validate(options, reftest)

    # We have to validate options.app here for the case when the mach
    # command is able to find it after argument parsing. This can happen
    # when running from a tests.zip.
    if not options.app:
        parser.error(
            "could not find the application path, --appname must be specified")

    options.app = reftest.getFullPath(options.app)
    if not os.path.exists(options.app):
        parser.error("Error: Path %(app)s doesn't exist. Are you executing "
                     "$objdir/_tests/reftest/runreftest.py?" %
                     {"app": options.app})

    if options.xrePath is None:
        options.xrePath = os.path.dirname(options.app)

    return reftest.runTests(options.tests, options)
Пример #3
0
def main():
    parser = reftestcommandline.DesktopArgumentsParser()
    reftest = RefTest()

    options = parser.parse_args()
    parser.validate(options, reftest)

    sys.exit(reftest.runTests(options.tests, options))
Пример #4
0
def setup_argument_parser():
    import mozinfo
    import reftestcommandline

    global parser
    mozinfo.find_and_update_from_json(here)
    parser = reftestcommandline.DesktopArgumentsParser()
    return parser
Пример #5
0
def run(**kwargs):
    # Mach gives us kwargs; this is a way to turn them back into an
    # options object
    parser = reftestcommandline.DesktopArgumentsParser()
    reftest = RefTest()
    parser.set_defaults(**kwargs)
    options = parser.parse_args(kwargs["tests"])
    parser.validate(options, reftest)
    return reftest.runTests(options.tests, options)
Пример #6
0
def setup_argument_parser():
    import mozinfo
    import reftestcommandline

    global parser
    mozinfo.find_and_update_from_json(here)
    if mozinfo.info.get('buildapp') == 'mobile/android':
        parser = reftestcommandline.RemoteArgumentsParser()
    else:
        parser = reftestcommandline.DesktopArgumentsParser()
    return parser
Пример #7
0
                continue


def run_test_harness(parser, options):
    reftest = RefTest()
    parser.validate(options, reftest)

    # We have to validate options.app here for the case when the mach
    # command is able to find it after argument parsing. This can happen
    # when running from a tests.zip.
    if not options.app:
        parser.error(
            "could not find the application path, --appname must be specified")

    options.app = reftest.getFullPath(options.app)
    if not os.path.exists(options.app):
        parser.error("Error: Path %(app)s doesn't exist. Are you executing "
                     "$objdir/_tests/reftest/runreftest.py?" %
                     {"app": options.app})

    if options.xrePath is None:
        options.xrePath = os.path.dirname(options.app)

    return reftest.runTests(options.tests, options)


if __name__ == "__main__":
    parser = reftestcommandline.DesktopArgumentsParser()
    options = parser.parse_args()
    sys.exit(run_test_harness(parser, options))
Пример #8
0
def get_parser():
    global parser
    here = os.path.abspath(os.path.dirname(__file__))
    build_obj = MozbuildObject.from_environment(cwd=here)
    parser = reftestcommandline.DesktopArgumentsParser()
    return parser