Exemple #1
0
def main():
    args = parse_args()
    if not os.path.exists(args.tests_dir):
        print("Can't find tests dir '{}'".format(args.test_list))
        sys.exit(1)

    if args.test_list and not os.path.exists(args.test_list):
        print("Can't find test list file '{}'".format(args.test_list))
        sys.exit(1)

    try:
        distcc_hosts = read_distcc_hosts(args.distcc_host_list)
    except Exception as ex:
        print(str(ex))
        sys.exit(1)

    run_all_tests(tests_dir=os.path.normpath(args.tests_dir),
                  jobs=args.jobs,
                  test_tags=args.test_tags,
                  no_report=args.no_report,
                  passed_list=args.passed_list,
                  test_list=args.test_list,
                  distcc_hosts=distcc_hosts)
    cmake_options = " ".join(cmake_options)
    env_vars = " ".join(env_vars)

    kphp_polyfills_repo = args.kphp_polyfills_repo
    if kphp_polyfills_repo == "":
        print(red("empty --kphp-polyfills-repo argument"), flush=True)
    kphp_polyfills_repo = os.path.abspath(kphp_polyfills_repo)

    distcc_options = ""
    distcc_cmake_option = ""
    distcc_hosts_file = ""
    if args.use_distcc:
        distcc_hosts_file = "/etc/distcc/hosts"
        distcc_options = "--distcc-host-list {}".format(distcc_hosts_file)
        os.environ.update(
            make_distcc_env(read_distcc_hosts(distcc_hosts_file),
                            os.path.join(runner_dir, "tmp_distcc")))
        distcc_cmake_option = "-DCMAKE_CXX_COMPILER_LAUNCHER=distcc "

    runner.add_test_group(
        name="make-kphp",
        description="make kphp and runtime",
        cmd="rm -rf {kphp_repo_root}/build && "
        "mkdir {kphp_repo_root}/build && "
        "cmake "
        "-S {kphp_repo_root} -B {kphp_repo_root}/build "
        "{distcc_cmake_option}"
        "-DCMAKE_CXX_COMPILER={cxx} {cmake_options} && "
        "{env_vars} make -C {kphp_repo_root}/build -j{{jobs}} all test && "
        "{env_vars} make -C {kphp_repo_root}/build vkext7.2 vkext7.4 && "
        "cd {kphp_repo_root}/build && cpack".format(
Exemple #3
0
    cmake_options = " ".join(cmake_options)
    env_vars = " ".join(env_vars)

    kphp_polyfills_repo = args.kphp_polyfills_repo
    if kphp_polyfills_repo == "":
        print(red("empty --kphp-polyfills-repo argument"), flush=True)
    kphp_polyfills_repo = os.path.abspath(kphp_polyfills_repo)

    distcc_options = ""
    distcc_cmake_option = ""
    distcc_hosts_file = ""
    if args.use_distcc:
        distributive_name = get_distributive_name()
        distcc_hosts_file = "/etc/distcc/hosts"
        distcc_options = "--distcc-host-list {}".format(distcc_hosts_file)
        os.environ.update(make_distcc_env(read_distcc_hosts(distcc_hosts_file), os.path.join(runner_dir, "tmp_distcc")))
        distcc_cmake_option = "-DCMAKE_CXX_COMPILER_LAUNCHER=distcc "

    runner.add_test_group(
        name="make-kphp",
        description="make kphp and runtime",
        cmd="rm -rf {kphp_repo_root}/build && "
            "mkdir {kphp_repo_root}/build && "
            "cmake "
            "-S {kphp_repo_root} -B {kphp_repo_root}/build "
            "{distcc_cmake_option}"
            "-DCMAKE_CXX_COMPILER={cxx} {cmake_options} && "
            "{env_vars} make -C {kphp_repo_root}/build -j{{jobs}} all test && "
            "{env_vars} make -C {kphp_repo_root}/build vkext7.2 vkext7.4".format(
                kphp_repo_root=kphp_repo_root,
                distcc_cmake_option=distcc_cmake_option,