Skip to content

Commit

Permalink
Fixing test-tunnel.js
Browse files Browse the repository at this point in the history
  • Loading branch information
noway committed Apr 21, 2013
1 parent e6fc02e commit 428b9c1
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions tests/test-tunnel.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,18 @@ squid.stdout.on('data', function (c) {
.join('\nSQUIDOUT '))
})

squid.on('error', function (c) {
console.error('squid: error '+c)
if (c && !ready) {
notInstalled()
return
}
})

squid.on('exit', function (c) {
console.error('squid: exit '+c)
if (c && !ready) {
console.error('squid must be installed to run this test.')
console.error('skipping this test. please install squid and run again if you need to test tunneling.')
c = null
hadError = null
process.exit(0)
notInstalled()
return
}

Expand All @@ -61,3 +65,11 @@ setTimeout(function F () {
squid.kill('SIGKILL')
})
}, 100)

function notInstalled() {
console.error('squid must be installed to run this test.')
console.error('skipping this test. please install squid and run again if you need to test tunneling.')
c = null
hadError = null
process.exit(0)
}

0 comments on commit 428b9c1

Please sign in to comment.