mirror of
https://github.com/nodejs/node.git
synced 2026-11-26 21:58:26 -05:00
Signed-off-by: James M Snell <jasnell@gmail.com> Assisted-by: Opencode PR-URL: https://github.com/nodejs/node/pull/65606 Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br> Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
32 lines
860 B
JavaScript
32 lines
860 B
JavaScript
'use strict';
|
|
|
|
const {
|
|
ArrayPrototypeSlice,
|
|
PromisePrototypeThen,
|
|
} = primordials;
|
|
const {
|
|
markBootstrapComplete,
|
|
prepareTestRunnerMainExecution,
|
|
} = require('internal/process/pre_execution');
|
|
const { emitExperimentalWarning } = require('internal/util');
|
|
const {
|
|
triggerUncaughtException,
|
|
exitCodes: { kGenericUserError },
|
|
} = internalBinding('errors');
|
|
|
|
prepareTestRunnerMainExecution();
|
|
markBootstrapComplete();
|
|
if (process.env.NODE_BENCH_CONTEXT !== 'child' ||
|
|
typeof process.send !== 'function') {
|
|
emitExperimentalWarning('Benchmarks');
|
|
}
|
|
|
|
const { run } = require('internal/bench_runner/cli');
|
|
const patterns = ArrayPrototypeSlice(process.argv, 1);
|
|
|
|
PromisePrototypeThen(run(patterns), ({ success }) => {
|
|
if (!success) process.exitCode = kGenericUserError;
|
|
}, (error) => {
|
|
triggerUncaughtException(error, true /* fromPromise */);
|
|
});
|