Skip to content

Commit

Permalink
Merge pull request #66 from Tyriar/fix_test_deps
Browse files Browse the repository at this point in the history
Fix TravisCI build
  • Loading branch information
Tyriar committed Mar 30, 2017
2 parents a0dba41 + 094f1c4 commit 62bd2d2
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .travis.yml
Expand Up @@ -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
12 changes: 12 additions & 0 deletions binding.gyp
Expand Up @@ -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"
}
}]
]
}]
}
6 changes: 5 additions & 1 deletion scripts/install.js
Expand Up @@ -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);
});
14 changes: 12 additions & 2 deletions test/unixTerminal.test.js
Expand Up @@ -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());
}
});
});
});

0 comments on commit 62bd2d2

Please sign in to comment.