test, benchmark: create shared runBenchmark func
Created from discussion starting at https://github.com/nodejs/node/pull/14951#issuecomment-324542616. This is a proof of concept PR, and the exact implementation details can be tweaked, but I think this is generally what the API should look like. A few open points are below.
Needed for merge: all resolved
-
ESLint is raising with Mandatory module "common" must be loaded required-modules
right now -- should files matchingtest-benchmark-*.js
need to requirecommon
anymore? resolved
Can probably be handled after merge:
-
Does this new helper method need to be documented in test/common/README.md
? -
To a novice, it seems like n=1
is being everywhere except a few places -- should this become an included-by-default argv option in the new run method? -
exchange args
array option for an object instead
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
commit message follows commit guidelines
Affected core subsystem(s)
test, benchmark