MCPcopy Create free account
hub / github.com/cortex-js/compute-engine / runOne

Function runOne

benchmarks/report.mjs:202–214  ·  view source on GitHub ↗
(tool, kase)

Source from the content-addressed store, hash-verified

200// --- run everything --------------------------------------------------------
201
202function runOne(tool, kase) {
203 if (!kase.inputs[tool.inputKey]) return { status: 'unsupported' };
204 const [cmd, args] = tool.spawn(kase);
205 try {
206 const out = execFileSync(cmd, args, { timeout: PER_CASE_TIMEOUT_MS, encoding: 'utf8', stdio: ['ignore', 'pipe', 'pipe'] });
207 const line = out.trim().split('\n').filter(Boolean).pop();
208 return JSON.parse(line);
209 } catch (e) {
210 if (e.killed || e.signal === 'SIGTERM' || e.code === 'ETIMEDOUT') return { status: 'timeout' };
211 // The runner crashed before printing JSON.
212 return { status: 'error', error: (e.stderr || e.message || String(e)).toString().split('\n')[0].slice(0, 200) };
213 }
214}
215
216function getVersions() {
217 const v = { node: process.version };

Callers 1

report.mjsFile · 0.85

Calls 3

parseMethod · 0.65
sliceMethod · 0.65
toStringMethod · 0.65

Tested by

no test coverage detected