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

Function process_integration_test

Tester.py:181–236  ·  view source on GitHub ↗
(test_dir: str, release_mode: bool, logs: list)

Source from the content-addressed store, hash-verified

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
190def 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),

Callers 1

run_single_testFunction · 0.85

Calls 7

normalize_nameFunction · 0.70
read_from_fileFunction · 0.70
run_commandFunction · 0.70
build_rust_codeFunction · 0.70
find_and_prepare_jarFunction · 0.70
write_to_fileFunction · 0.70
check_resultsFunction · 0.70

Tested by

no test coverage detected