예제 #1
0
def benchmark(git_repo,
              src_dir,
              branches,
              git_origin,
              images,
              qmake_file,
              binary,
              clone_url=None):
    if (not os.path.exists(git_repo)):
        if (clone_url != None):
            git.clone_repo(clone_url, git_repo)
            git.fetch(git_repo)
            git.replace_remote(git_repo, clone_url)
        else:
            git.clone_repo(git_origin, git_repo)
    git.fetch_all(git_repo)
    results = {"computer_name": computer_name()}
    for branch in branches:
        git.checkout_branch(git_repo, branch)
        git.clean(src_dir)
        compile.compile(qmake_file, cwd=src_dir)

        r = {"revision": git.current_revision(git_repo)}
        r["results"] = run(src_dir + "/" + binary, images)
        results[branch] = r

    return results
예제 #2
0
def main():
    image_dir = default_image_dir
    files = [image_dir+"/"+f for f in os.listdir(image_dir) if os.path.isfile(os.path.join(image_dir, f)) and f.endswith(".png")]
    git.clone_repo(REFERENCE_IMAGES_GIT, TEST_DIR)
    for method, arguments in test_arguments.iteritems():
        for args in arguments:
            # Prepend a "-" for every key in the arguments dict and then flatten the list
            command_arguments = [i for tuple in args.items() for i in ("-"+str(tuple[0]),str(tuple[1]))]
            for f in files:
                tester.run_test(test_binary, reference_binary, method, command_arguments, f, run_reference_program=False, test_dir=TEST_DIR)
예제 #3
0
def benchmark(git_repo, src_dir, branches, git_origin, images, qmake_file, binary, clone_url=None):
    if (not os.path.exists(git_repo)):
        if (clone_url != None):
            git.clone_repo(clone_url, git_repo)
            git.fetch(git_repo)
            git.replace_remote(git_repo, clone_url)
        else:
            git.clone_repo(git_origin, git_repo)
    git.fetch_all(git_repo)
    results = {"computer_name": computer_name()}
    for branch in branches:
        git.checkout_branch(git_repo, branch)
        git.clean(src_dir)
        compile.compile(qmake_file,cwd=src_dir)

        r = {"revision": git.current_revision(git_repo)}
        r["results"] = run(src_dir+"/"+binary, images)
        results[branch] = r

    return results
예제 #4
0
def main():
    image_dir = default_image_dir
    files = [
        image_dir + "/" + f for f in os.listdir(image_dir)
        if os.path.isfile(os.path.join(image_dir, f)) and f.endswith(".png")
    ]
    git.clone_repo(REFERENCE_IMAGES_GIT, TEST_DIR)
    for method, arguments in test_arguments.iteritems():
        for args in arguments:
            # Prepend a "-" for every key in the arguments dict and then flatten the list
            command_arguments = [
                i for tuple in args.items()
                for i in ("-" + str(tuple[0]), str(tuple[1]))
            ]
            for f in files:
                tester.run_test(test_binary,
                                reference_binary,
                                method,
                                command_arguments,
                                f,
                                run_reference_program=False,
                                test_dir=TEST_DIR)