Skip to content

Commit

Permalink
heed review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriel Schulhof committed Mar 19, 2019
1 parent c67bd33 commit b2acb66
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
3 changes: 2 additions & 1 deletion test/node_modules/duplicate_symbols/common.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion test/node_modules/duplicate_symbols/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 4 additions & 8 deletions test/test-addon.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@ function runHello(hostProcess) {
return execFileSync(hostProcess, ['-e', testCode], { cwd: __dirname }).toString()
}

function runDuplicateBindings(hostProcess) {
if (!hostProcess) {
hostProcess = process.execPath
}
function runDuplicateBindings() {
const hostProcess = process.execPath;
var testCode =
"console.log((function(bindings) {" +
"return bindings.pointerCheck1(bindings.pointerCheck2());" +
Expand Down Expand Up @@ -70,15 +68,13 @@ test('make sure addon symbols do not overlap', function (t) {
var addonPath = path.resolve(__dirname, 'node_modules', 'duplicate_symbols')
// Set the loglevel otherwise the output disappears when run via 'npm test'
var cmd = [nodeGyp, 'rebuild', '-C', addonPath, '--loglevel=verbose']
var proc = execFile(process.execPath, cmd, function (err, stdout, stderr) {
var logLines = stderr.toString().trim().split(/\r?\n/)
execFile(process.execPath, cmd, function (err, stdout, stderr) {
var logLines = stderr.trim().split(/\r?\n/)
var lastLine = logLines[logLines.length-1]
t.strictEqual(err, null)
t.strictEqual(lastLine, 'gyp info ok', 'should end in ok')
t.strictEqual(runDuplicateBindings().trim(), 'not equal')
})
proc.stdout.setEncoding('utf-8')
proc.stderr.setEncoding('utf-8')
})

test('build simple addon in path with non-ascii characters', function (t) {
Expand Down

0 comments on commit b2acb66

Please sign in to comment.