Skip to content

Commit

Permalink
fix failing test on linux
Browse files Browse the repository at this point in the history
The GNU shell returns a code and no signal if it gets a SIGSEGV
signal, so we have to skip this. Hat tip to @tjfontaine
  • Loading branch information
robertkowalski authored and isaacs committed Apr 15, 2014
1 parent 6be6b4b commit c9d6f13
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/tap/lifecycle-signal.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,18 @@ var pkg = path.resolve(__dirname, "lifecycle-signal")
test("lifecycle signal abort", function (t) {
// windows does not use lifecycle signals, abort
if (process.platform === "win32" || process.env.TRAVIS) return t.end()

var child = spawn(node, [npm, "install"], {
cwd: pkg
})
child.on("close", function (code, signal) {
// GNU shell returns a code, no signal
if (process.platform === "linux") {
t.equal(code, 1)
t.equal(signal, null)
return t.end()
}

t.equal(code, null)
t.equal(signal, "SIGSEGV")
t.end()
Expand Down

0 comments on commit c9d6f13

Please sign in to comment.