(tool, kase)
| 200 | // --- run everything -------------------------------------------------------- |
| 201 | |
| 202 | function 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 | |
| 216 | function getVersions() { |
| 217 | const v = { node: process.version }; |
no test coverage detected