Builds the Rust code and returns (success, target_dir_name).
(test_dir: str, release_mode: bool, logs: list)
| 37 | encoding="utf-8", |
| 38 | ) |
| 39 | |
| 40 | |
| 41 | def 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 | |
| 47 | def 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 |
no test coverage detected