Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP - test: Fix the path to llnode plugin #111

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 27 additions & 5 deletions test/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,36 @@ exports.core = path.join(os.tmpdir(), 'core');
exports.ranges = exports.core + '.ranges';

let pluginName;
if (process.platform === 'darwin')
if (process.platform === 'darwin') {
pluginName = 'llnode.dylib';
else if (process.platform === 'windows')
} else if (process.platform === 'windows') {
pluginName = 'llnode.dll';
else
pluginName = path.join('lib.target', 'llnode.so');
} else {
pluginName = 'llnode.so';
}

// Check we have a plugin library and whether llnode was build with
// npm install or ./gyp_llnode.
// If we have both versions or neither that's an error.
const npm_path = pluginName;
const gyp_path = path.join(exports.buildDir, pluginName);
const npm_exists = fs.existsSync(npm_path);
const gyp_exists = fs.existsSync(gyp_path);

if (npm_exists && gyp_exists) {
console.error(`${pluginName} has been built with both npm install and` +
' gyp_llnode.');
console.error('Please remove one version before running npm test.');
process.exit(1);
}

if (!npm_exists && !gyp_exists) {
console.error(`${pluginName} has not been built.`);
console.error('Please run `npm install` or `../gyp_llnode && make -C out/`');
process.exit(1);
}

exports.llnodePath = path.join(exports.buildDir, pluginName);
exports.llnodePath = npm_exists ? npm_path : gyp_path;

function SessionOutput(session, stream) {
EventEmitter.call(this);
Expand Down