mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-31 07:23:06 +08:00
A run that a signal ends has a null exit code, so the runner recorded a pass when Node and the executable ended by different signals, or when one ended by a signal and the other with an exit code compared as null. The verdict now compares both the exit code and the signal (verdict.mjs), and records Node's signal in nodeExit as it does for the executable. A relative --node path also made the minimal lane's fixtures symlink relative to the copied tree, where it does not resolve. The checkout path is now resolved first. tests/harness/node-parallel-runner.test.ts covers both: the termination comparison, and a relative --node path whose fixtures resolve from the minimal tree.
14 lines
483 B
JavaScript
14 lines
483 B
JavaScript
// How two runs of one test file compare (run.mjs).
|
|
|
|
/** Whether Node and the executable ended the same way: the same exit code,
|
|
* or the same terminating signal (an exit code is null when a signal ended
|
|
* the process). */
|
|
export function sameTermination(node, native) {
|
|
return node.code === native.code && node.signal === native.signal;
|
|
}
|
|
|
|
/** An exit code, or the signal that ended the process. */
|
|
export function termination(result) {
|
|
return result.code ?? result.signal;
|
|
}
|