diff --git a/.travis.yml b/.travis.yml index a9b22da6..29b0f499 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,6 +8,11 @@ node_js: install: - npm install - npm run tsc +before_install: + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test ; fi + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get -qq update ; fi + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get -qq install g++-4.8 ; fi + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then export CXX=g++-4.8 ; fi script: - npm test - npm run tslint diff --git a/binding.gyp b/binding.gyp index 1bac6f9a..434172c6 100644 --- a/binding.gyp +++ b/binding.gyp @@ -39,6 +39,18 @@ '-lutil' ] }], + ['OS=="mac"', { + "xcode_settings": { + "OTHER_CPLUSPLUSFLAGS": [ + "-std=c++11", + "-stdlib=libc++" + ], + "OTHER_LDFLAGS": [ + "-stdlib=libc++" + ], + "MACOSX_DEPLOYMENT_TARGET":"10.7" + } + }] ] }] } diff --git a/scripts/install.js b/scripts/install.js index e384e1f7..416c1adf 100644 --- a/scripts/install.js +++ b/scripts/install.js @@ -4,7 +4,11 @@ const os = require('os'); const path = require('path'); const spawn = require('child_process').spawn; -spawn(os.platform() === 'win32' ? 'node-gyp.cmd' : 'node-gyp', ['rebuild'], { +const p = spawn(os.platform() === 'win32' ? 'node-gyp.cmd' : 'node-gyp', ['rebuild'], { cwd: path.join(__dirname, '..'), stdio: 'inherit' }); + +p.on('exit', function (code) { + process.exit(code); +}); diff --git a/test/unixTerminal.test.js b/test/unixTerminal.test.js index 100a2682..148a5d28 100644 --- a/test/unixTerminal.test.js +++ b/test/unixTerminal.test.js @@ -7,8 +7,18 @@ describe("UnixTerminal", function() { describe("Constructor", function() { it("should set a valid pts name", function() { const term = new UnixTerminal('cmd.exe', [], {}); - // Should match form from https://linux.die.net/man/4/pts - assert.ok(/^\/dev\/pts\/\d+$/.test(term.pty)); + let regExp; + if (process.platform === 'linux') { + // https://linux.die.net/man/4/pts + regExp = /^\/dev\/pts\/\d+$/; + } + if (process.platform === 'darwin') { + // https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man4/pty.4.html + regExp = /^\/dev\/tty[p-sP-S][a-z0-9]+$/; + } + if (regExp) { + assert.ok(regExp.test(term.pty), '"' + term.pty + '" should match ' + regExp.toString()); + } }); }); });