def METHOD_NAME(
    use_oneapi=True,
    c_compiler=None,
    cxx_compiler=None,
    level_zero=True,
    compiler_root=None,
    run_pytest=False,
    bin_llvm=None,
    gtest_config=None,
):
    IS_LIN = False
    if "linux" in sys.platform:
        IS_LIN = True
    elif sys.platform in ["win32", "cygwin"]:
        pass
    else:
        assert False, sys.platform + " not supported"
    if not IS_LIN:
        raise RuntimeError(
            "This scripts only supports coverage collection on Linux"
        )
    setup_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
    cmake_args = [
        sys.executable,
        "setup.py",
        "develop",
        "--build-type=Debug",
        "--generator=Ninja",
        "--",
        "-DCMAKE_C_COMPILER:PATH=" + c_compiler,
        "-DCMAKE_CXX_COMPILER:PATH=" + cxx_compiler,
        "-DDPCTL_ENABLE_L0_PROGRAM_CREATION=" + ("ON" if level_zero else "OFF"),
        "-DDPCTL_GENERATE_COVERAGE=ON",
        "-DDPCTL_BUILD_CAPI_TESTS=ON",
        "-DDPCTL_COVERAGE_REPORT_OUTPUT_DIR=" + setup_dir,
    ]
    env = dict()
    if bin_llvm:
        env = {
            "PATH": ":".join((os.environ.get("PATH", ""), bin_llvm)),
            "LLVM_TOOLS_HOME": bin_llvm,
        }
        env.update({k: v for k, v in os.environ.items() if k != "PATH"})
    if gtest_config:
        cmake_args += ["-DCMAKE_PREFIX_PATH=" + gtest_config]
    subprocess.check_call(cmake_args, shell=False, cwd=setup_dir, env=env)
    cmake_build_dir = (
        subprocess.check_output(
            ["find", "_skbuild", "-name", "cmake-build"], cwd=setup_dir
        )
        .decode("utf-8")
        .strip("\n")
    )
    subprocess.check_call(
        ["cmake", "--build", ".", "--target", "llvm-cov"],
        cwd=cmake_build_dir,
    )
    env["LLVM_PROFILE_FILE"] = "dpctl_pytest.profraw"
    subprocess.check_call(
        [
            "pytest",
            "-q",
            "-ra",
            "--disable-warnings",
            "--cov-config",
            "pyproject.toml",
            "--cov",
            "dpctl",
            "--cov-report",
            "term-missing",
            "--pyargs",
            "dpctl",
            "-vv",
            "--ignore=dpctl/tensor/libtensor/tests",
        ],
        cwd=setup_dir,
        shell=False,
        env=env,
    )
    def find_objects():
        import os
        objects = []
        for root, _, files in os.walk("_skbuild"):
            for file in files:
                if not file.endswith(".so"):
                    continue
                if os.path.join("libsyclinterface", "tests") in root:
                    continue
                if any(
                    match in root
                    for match in [
                        "libsyclinterface",
                    ]
                ):
                    objects.extend(["-object", os.path.join(root, file)])
        return objects
    objects = find_objects()
    instr_profile_fn = "dpctl_pytest.profdata"
    # generate instrumentation profile data
    subprocess.check_call(
        [
            os.path.join(bin_llvm, "llvm-profdata"),
            "merge",
            "-sparse",
            env["LLVM_PROFILE_FILE"],
            "-o",
            instr_profile_fn,
        ]
    )
    # export lcov
    with open("dpctl_pytest.lcov", "w") as fh:
        subprocess.check_call(
            [
                os.path.join(bin_llvm, "llvm-cov"),
                "export",
                "-format=lcov",
                "-ignore-filename-regex=/tmp/icpx*",
                "-instr-profile=" + instr_profile_fn,
            ]
            + objects,
            stdout=fh,
        )