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

Function process_binary_test

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

Source from the content-addressed store, hash-verified

139 check=False,
140 )
141 else:
142 try:
143 process.kill()
144 except ProcessLookupError:
145 pass
146
147
148def run_java_command(
149 command: list[str],
150 *,
151 timeout: float,
152 cwd: Path | None = None,
153 input_text: str | None = None,
154) -> tuple[subprocess.CompletedProcess[str], str | None]:
155 process = subprocess.Popen(
156 command,
157 cwd=cwd or Path(__file__).resolve().parent,
158 stdin=subprocess.PIPE if input_text is not None else None,
159 stdout=subprocess.PIPE,
160 stderr=subprocess.PIPE,
161 )
162 try:
163 stdout, stderr = process.communicate(
164 None if input_text is None else input_text.encode("utf-8"),
165 timeout=timeout,
166 )
167 diagnostics = None
168 except subprocess.TimeoutExpired:
169 diagnostics = jvm_timeout_diagnostics(process.pid)
170 terminate_process_tree(process)
171 try:
172 stdout, stderr = process.communicate(timeout=5)
173 except subprocess.TimeoutExpired:
174 process.kill()
175 stdout, stderr = process.communicate()
176 returncode = 124
177 else:
178 returncode = process.returncode
179 return (
180 subprocess.CompletedProcess(
181 command,
182 returncode,

Callers 1

run_single_testFunction · 0.85

Calls 7

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

Tested by

no test coverage detected