(test_dir: str, release_mode: bool, logs: list)
| 179 | return ( |
| 180 | subprocess.CompletedProcess( |
| 181 | command, |
| 182 | returncode, |
| 183 | stdout.decode("utf-8", errors="replace"), |
| 184 | stderr.decode("utf-8", errors="replace"), |
| 185 | ), |
| 186 | diagnostics, |
| 187 | ) |
| 188 | |
| 189 | |
| 190 | def run_java( |
| 191 | test: TestCase, |
| 192 | jar: Path, |
| 193 | release: bool, |
| 194 | logs: list[str], |
| 195 | java_timeout: float, |
| 196 | ) -> bool: |
| 197 | try: |
| 198 | java_arguments, stdin = java_process_inputs(test) |
| 199 | except (json.JSONDecodeError, ValueError) as error: |
| 200 | logs.append(f"|---- ❌ Invalid Java process test input: {error}") |
| 201 | return False |
| 202 | |
| 203 | if test.kind == "kotlin": |
| 204 | kotlin_files = sorted(test.directory.glob("*.kt")) |
| 205 | kotlin_files.extend(sorted((ROOT / "runtime" / "kotlin").glob("*.kt"))) |
| 206 | if not kotlin_files: |
| 207 | logs.append("|---- ❌ No .kt files found for Kotlin interop test") |
| 208 | return False |
| 209 | |
| 210 | executable_name = "kotlinc.bat" if os.name == "nt" else "kotlinc" |
| 211 | configured = os.environ.get("KOTLINC") |
| 212 | kotlinc = ( |
| 213 | Path(configured) |
| 214 | if configured |
| 215 | else Path(shutil.which("kotlinc") or "") |
| 216 | ) |
| 217 | if not kotlinc.is_file(): |
| 218 | local = ( |
| 219 | ROOT |
| 220 | / "target" |
| 221 | / "tools" |
| 222 | / "kotlin-2.4.10" |
| 223 | / "kotlinc" |
| 224 | / "bin" |
| 225 | / executable_name |
| 226 | ) |
| 227 | kotlinc = local if local.is_file() else Path() |
| 228 | if not kotlinc.is_file(): |
| 229 | logs.append( |
| 230 | "|---- ❌ kotlinc is required for tests/kotlin; install Kotlin or set KOTLINC" |
| 231 | ) |
| 232 | return False |
| 233 | |
| 234 | profile = "release" if release else "debug" |
| 235 | kotlin_jar = TEST_TARGET_DIR / "kotlin" / profile / f"{test.name}.jar" |
| 236 | kotlin_jar.parent.mkdir(parents=True, exist_ok=True) |
| 237 | command = [ |
| 238 | str(kotlinc), |
no test coverage detected