From d02fb36379638c4a4d96f7baa3a35ca694b8fbb6 Mon Sep 17 00:00:00 2001 From: James M Snell Date: Wed, 22 Aug 2018 08:14:31 -0700 Subject: [PATCH] test: move common.isCPPSymbolsNotMapped to tick-processor tests `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: https://github.com/nodejs/node/pull/22459 Reviewed-By: Ruben Bridgewater Reviewed-By: Trivikram Kamat Reviewed-By: Refael Ackermann --- test/common/README.md | 5 ----- test/common/index.js | 6 ------ test/common/index.mjs | 6 ++---- .../test-tick-processor-builtin.js | 3 ++- .../test-tick-processor-cpp-core.js | 3 ++- .../test-tick-processor-polyfill-brokenfile.js | 3 ++- .../test-tick-processor-preprocess-flag.js | 3 ++- test/tick-processor/util.js | 18 ++++++++++++++++++ 8 files changed, 28 insertions(+), 19 deletions(-) create mode 100644 test/tick-processor/util.js diff --git a/test/common/README.md b/test/common/README.md index 63d3b1636165bc..36f3afb5c9a465 100644 --- a/test/common/README.md +++ b/test/common/README.md @@ -224,11 +224,6 @@ Platform check for Windows. Platform check for Windows 32-bit on Windows 64-bit. -### isCPPSymbolsNotMapped -* [<boolean>] - -Platform check for C++ symbols are mapped or not. - ### leakedGlobals() * return [<Array>] diff --git a/test/common/index.js b/test/common/index.js index 45358b50811d9c..a1afd824ce836e 100644 --- a/test/common/index.js +++ b/test/common/index.js @@ -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; diff --git a/test/common/index.mjs b/test/common/index.mjs index 5a0d547d595b6d..c8e6295b5ca1c6 100644 --- a/test/common/index.mjs +++ b/test/common/index.mjs @@ -51,8 +51,7 @@ const { getBufferSources, disableCrashOnUnhandledRejection, getTTYfd, - runWithInvalidFD, - isCPPSymbolsNotMapped + runWithInvalidFD } = common; export { @@ -104,6 +103,5 @@ export { getBufferSources, disableCrashOnUnhandledRejection, getTTYfd, - runWithInvalidFD, - isCPPSymbolsNotMapped + runWithInvalidFD }; diff --git a/test/tick-processor/test-tick-processor-builtin.js b/test/tick-processor/test-tick-processor-builtin.js index 3d4e1b9d236030..1f38abe08c32e2 100644 --- a/test/tick-processor/test-tick-processor-builtin.js +++ b/test/tick-processor/test-tick-processor-builtin.js @@ -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.'); } diff --git a/test/tick-processor/test-tick-processor-cpp-core.js b/test/tick-processor/test-tick-processor-cpp-core.js index 26daf60aa3c1ce..e76d99ab09db7b 100644 --- a/test/tick-processor/test-tick-processor-cpp-core.js +++ b/test/tick-processor/test-tick-processor-cpp-core.js @@ -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.'); } diff --git a/test/tick-processor/test-tick-processor-polyfill-brokenfile.js b/test/tick-processor/test-tick-processor-polyfill-brokenfile.js index 3348b6f11b2e67..d0a6eb9f81806e 100644 --- a/test/tick-processor/test-tick-processor-polyfill-brokenfile.js +++ b/test/tick-processor/test-tick-processor-polyfill-brokenfile.js @@ -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.'); } diff --git a/test/tick-processor/test-tick-processor-preprocess-flag.js b/test/tick-processor/test-tick-processor-preprocess-flag.js index 93367361aceea3..8b1ec9920f47ed 100644 --- a/test/tick-processor/test-tick-processor-preprocess-flag.js +++ b/test/tick-processor/test-tick-processor-preprocess-flag.js @@ -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.'); } diff --git a/test/tick-processor/util.js b/test/tick-processor/util.js new file mode 100644 index 00000000000000..d25a2a7dcb132e --- /dev/null +++ b/test/tick-processor/util.js @@ -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 +};