Skip to content

Commit

Permalink
test: move common.isCPPSymbolsNotMapped to tick-processor tests
Browse files Browse the repository at this point in the history
`common.isCPPSymbolsNotMapped` is used only by the tests in the
`test/tick-processor` folder. Move it local to those to get it
out of `common`.

PR-URL: nodejs#22459
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
  • Loading branch information
jasnell committed Aug 24, 2018
1 parent 5673017 commit 6bb96a1
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 19 deletions.
5 changes: 0 additions & 5 deletions test/common/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,11 +224,6 @@ Platform check for Windows.

Platform check for Windows 32-bit on Windows 64-bit.

### isCPPSymbolsNotMapped
* [&lt;boolean>]

Platform check for C++ symbols are mapped or not.

### leakedGlobals()
* return [&lt;Array>]

Expand Down
6 changes: 0 additions & 6 deletions test/common/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -799,9 +799,3 @@ exports.runWithInvalidFD = function(func) {

exports.printSkipMessage('Could not generate an invalid fd');
};

exports.isCPPSymbolsNotMapped = exports.isWindows ||
exports.isSunOS ||
exports.isAIX ||
exports.isLinuxPPCBE ||
exports.isFreeBSD;
6 changes: 2 additions & 4 deletions test/common/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ const {
getBufferSources,
disableCrashOnUnhandledRejection,
getTTYfd,
runWithInvalidFD,
isCPPSymbolsNotMapped
runWithInvalidFD
} = common;

export {
Expand Down Expand Up @@ -104,6 +103,5 @@ export {
getBufferSources,
disableCrashOnUnhandledRejection,
getTTYfd,
runWithInvalidFD,
isCPPSymbolsNotMapped
runWithInvalidFD
};
3 changes: 2 additions & 1 deletion test/tick-processor/test-tick-processor-builtin.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
'use strict';
const common = require('../common');
const { isCPPSymbolsNotMapped } = require('./util');

if (!common.enoughTestCpu)
common.skip('test is CPU-intensive');

if (common.isCPPSymbolsNotMapped) {
if (isCPPSymbolsNotMapped) {
common.skip('C++ symbols are not mapped for this os.');
}

Expand Down
3 changes: 2 additions & 1 deletion test/tick-processor/test-tick-processor-cpp-core.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
'use strict';
const common = require('../common');
const { isCPPSymbolsNotMapped } = require('./util');

if (!common.enoughTestCpu)
common.skip('test is CPU-intensive');

if (common.isCPPSymbolsNotMapped) {
if (isCPPSymbolsNotMapped) {
common.skip('C++ symbols are not mapped for this os.');
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
'use strict';
const common = require('../common');
const { isCPPSymbolsNotMapped } = require('./util');
const tmpdir = require('../common/tmpdir');
tmpdir.refresh();

if (!common.enoughTestCpu)
common.skip('test is CPU-intensive');

if (common.isCPPSymbolsNotMapped) {
if (isCPPSymbolsNotMapped) {
common.skip('C++ symbols are not mapped for this OS.');
}

Expand Down
3 changes: 2 additions & 1 deletion test/tick-processor/test-tick-processor-preprocess-flag.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
'use strict';
const common = require('../common');
const { isCPPSymbolsNotMapped } = require('./util');

if (!common.enoughTestCpu)
common.skip('test is CPU-intensive');

if (common.isCPPSymbolsNotMapped) {
if (isCPPSymbolsNotMapped) {
common.skip('C++ symbols are not mapped for this os.');
}

Expand Down
18 changes: 18 additions & 0 deletions test/tick-processor/util.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
'use strict';

// Utilities for the tick-processor tests
const {
isWindows,
isSunOS,
isAIX,
isLinuxPPCBE,
isFreeBSD
} = require('../common');

module.exports = {
isCPPSymbolsNotMapped: isWindows ||
isSunOS ||
isAIX ||
isLinuxPPCBE ||
isFreeBSD
};

0 comments on commit 6bb96a1

Please sign in to comment.