Lobby check test past the compiler launcher

This commit is contained in:
MrBruh committed 2026-10-04 13:43:13 +13:00
1 parent c04765d7f4
commit 3304965653
1 file changed
+10 -5
+10 -5
View File
@@ -314,7 +314,10 @@ def test_p2p_signatures_and_listings(tmp_path):
pytest.skip("needs clang, ninja and a configured build")
command = subprocess.run(["ninja", "-t", "commands", "build/linux/obj/port/linux/src/p2p_crypto.o"],
capture_output=True, text=True, check=True).stdout.strip().splitlines()[-1]
words = shlex.split(command)[1:]
words = shlex.split(command)
# (the compiler, and whatever runs it, ccache in CI: up to the first flag)
while words and not words[0].startswith("-"):
words = words[1:]
flags = []
skip = False
for word in words:
@@ -327,10 +330,12 @@ def test_p2p_signatures_and_listings(tmp_path):
else:
flags.append(word)
program = tmp_path / "p2p_lobby_check"
subprocess.run(["clang", *flags, "-O1", "-no-pie", "-Wl,--unresolved-symbols=ignore-all", "-o", str(program),
"tools/p2p_lobby_check.c", "port/linux/src/p2p_crypto.c", "port/linux/src/p2p_lobby.c",
"port/third_party/monocypher/monocypher.c", "port/third_party/monocypher/monocypher-ed25519.c"],
check=True, capture_output=True)
built = subprocess.run(["clang", *flags, "-O1", "-no-pie", "-Wl,--unresolved-symbols=ignore-all", "-o",
str(program), "tools/p2p_lobby_check.c", "port/linux/src/p2p_crypto.c",
"port/linux/src/p2p_lobby.c", "port/third_party/monocypher/monocypher.c",
"port/third_party/monocypher/monocypher-ed25519.c"],
capture_output=True, text=True)
assert built.returncode == 0, built.stderr[-4000:]
result = subprocess.run([str(program)], capture_output=True, text=True, timeout=60)
assert result.returncode == 0, result.stdout
assert "PASS" in result.stdout