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

run tests with options to prefix build root path #1055

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@
"bindings": "^1.5.0",
"clang-format": "^1.4.0",
"fs-extra": "^9.0.1",
"path": "^0.12.7",
"pre-commit": "^1.2.2",
"safe-buffer": "^5.1.1"
},
Expand Down
17 changes: 9 additions & 8 deletions test/common/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* Test helpers ported from test/common/index.js in Node.js project. */
'use strict';
const assert = require('assert');
const path = require('path');

const noop = () => {};

Expand Down Expand Up @@ -75,13 +76,13 @@ exports.mustNotCall = function(msg) {
};
};

exports.runTest = async function(test, buildType) {
exports.runTest = async function(test, buildType, buildPathRoot = process.env.REL_BUILD_PATH || '') {
buildType = buildType || process.config.target_defaults.default_configuration || 'Release';

const bindings = [
`../build/${buildType}/binding.node`,
`../build/${buildType}/binding_noexcept.node`,
`../build/${buildType}/binding_noexcept_maybe.node`,
path.join(buildPathRoot, `../build/${buildType}/binding.node`),
path.join(buildPathRoot, `../build/${buildType}/binding_noexcept.node`),
path.join(buildPathRoot, `../build/${buildType}/binding_noexcept_maybe.node`),
].map(it => require.resolve(it));

for (const item of bindings) {
Expand All @@ -90,13 +91,13 @@ exports.runTest = async function(test, buildType) {
}
}

exports.runTestWithBindingPath = async function(test, buildType) {
exports.runTestWithBindingPath = async function(test, buildType, buildPathRoot = process.env.REL_BUILD_PATH || '') {
buildType = buildType || process.config.target_defaults.default_configuration || 'Release';

const bindings = [
`../build/${buildType}/binding.node`,
`../build/${buildType}/binding_noexcept.node`,
`../build/${buildType}/binding_noexcept_maybe.node`,
path.join(buildPathRoot, `../build/${buildType}/binding.node`),
path.join(buildPathRoot, `../build/${buildType}/binding_noexcept.node`),
path.join(buildPathRoot, `../build/${buildType}/binding_noexcept_maybe.node`),
].map(it => require.resolve(it));

for (const item of bindings) {
Expand Down