MCPcopy Create free account
hub / github.com/IntegralPilot/rustc_codegen_jvm / build_rust_code

Function build_rust_code

Tester.py:39–59  ·  view source on GitHub ↗

Builds the Rust code and returns (success, target_dir_name).

(test_dir: str, release_mode: bool, logs: list)

Source from the content-addressed store, hash-verified

37 encoding="utf-8",
38 )
39
40
41def ci_diagnostic(logs: list[str], content: str) -> None:
42 if "CI" in os.environ:
43 indented = "\n".join(f"| > {line}" for line in content.splitlines())
44 logs.append(f"|---- CI diagnostic output:\n{indented}")
45
46
47def check_results(proc, test: TestCase, release: bool, logs: list[str]) -> bool:
48 expected_code_path = test.directory / "java-returncode.expected"
49 if expected_code_path.exists():
50 expected_code = int(read(expected_code_path).strip())
51 if proc.returncode != expected_code:
52 write_failure(test.directory / "java-returncode-fail.generated", proc)
53 logs.append(
54 f"|---- ❌ java exited with code {proc.returncode}, expected {expected_code}"
55 )
56 return False
57 elif proc.returncode != 0:
58 write_failure(test.directory / "java-fail.generated", proc)
59 logs.append(f"|---- ❌ java exited with code {proc.returncode}")
60 ci_diagnostic(logs, f"STDOUT:\n{proc.stdout}\nSTDERR:\n{proc.stderr}")
61 return False
62

Callers 2

process_binary_testFunction · 0.70
process_integration_testFunction · 0.70

Calls 2

run_commandFunction · 0.70
write_to_fileFunction · 0.70

Tested by

no test coverage detected