Exemplo n.º 1
0
def testfile_parse(arguments):
    """
    Using the argparse arguments calls print_test_names
    :param arguments: argparse arguments
    :return: None
    """
    framework = arguments.framework
    nodes = get_component(framework, "nodes")
    strip = get_component(framework, "strip")
    full_name = get_component(framework, "full_name")
    files = get_input_files(arguments.files, arguments.recursive, arguments.pattern)
    print_test_names(files, nodes, full_name, strip, agents=arguments.agents)
Exemplo n.º 2
0
def make_run_command(framework, suite, test_target):
    """
    Creates the command for the framework to run a subset of tests.
    :param framework: The Framework to get the command from
    :param suite: the test suite to run usually $1 in makefile
    :param test_target: path to compiled test file target. ex: tests.dll
    :return: command string
    """
    command = get_component(framework, 'command')
    return command.format(suite=suite, test_file=test_target)
Exemplo n.º 3
0
def makefile_generator(arguments):
    """
    Generates a string of the filled in Makefile template.

    :param arguments: the arguments object created by argparse
    :return: a filled in Makefile template string
    """
    run_test_command = make_run_command(arguments.framework, '$1', arguments.test_target)
    cmd_line = make_command_line_args(arguments.framework, arguments.files,
                                      arguments.recursive, arguments.pattern, arguments.agents)

    entry_point = 'ecparse'
    list_cmd = '{} {}'.format(entry_point, cmd_line)
    makefile_string = get_component(arguments.framework, 'makefile')
    return makefile_string.format(testrunner=arguments.test_runner, list_cmd=list_cmd, run_cmd=run_test_command)