def METHOD_NAME(fingerprint: str, passes: bool) -> None:
    sources = {
        "src/BUILD": dedent(
            f"""\
            system_binary(
                name="bash",
                binary_name="bash",
                fingerprint=r"{fingerprint}",
                fingerprint_args=("-c", "echo Binary Name v6.32.1",),
            )
            adhoc_tool(
                name="adhoc",
                runnable=":bash",
                args=["-c","echo I am a duck!"],
                log_output=True,
                stdout="stdout",
            )
            """
        ),
    }
    with setup_tmpdir(sources) as tmpdir:
        args = [
            "--backend-packages=['pants.backend.experimental.adhoc',]",
            f"--source-root-patterns=['{tmpdir}/src']",
            "export-codegen",
            f"{tmpdir}/src:adhoc",
        ]
        result = run_pants(args)
        if passes:
            assert result.exit_code == 0
            assert "[INFO] I am a duck!" in result.stderr.strip()
        else:
            assert result.exit_code != 0
            assert "Could not find a binary with name `bash`" in result.stderr.strip()