summaryrefslogtreecommitdiff
path: root/test/parallel/test-cli-node-options.js
AgeCommit message (Collapse)Author
2019-10-28cli: whitelist new V8 flag in NODE_OPTIONSShelley Vohr
Explicitly whitelists --disallow-code-generation-from-strings in NODE_OPTIONS as a new V8 flag. This flag prevents strings like eval() from performing code generation. PR-URL: https://github.com/nodejs/node/pull/30094 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2019-08-27src: allow --interpreted-frames-native-stack in NODE_OPTIONSMatheus Marchini
PR-URL: https://github.com/nodejs/node/pull/27744 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2019-04-17src: allows escaping NODE_OPTIONS with backslashesMaël Nison
The characters specified within NODE_OPTIONS can now be escaped, which is handy especially in conjunction with `--require` (where the file path might happen to contain spaces that shouldn't cause the option to be split into two). Fixes: https://github.com/nodejs/node/issues/12971 PR-URL: https://github.com/nodejs/node/pull/24065 Reviewed-By: Anna Henningsen <anna@addaleax.net>
2019-04-15process: add --unhandled-rejections flagRuben Bridgewater
This adds a flag to define the default behavior for unhandled rejections. Three modes exist: `none`, `warn` and `strict`. The first is going to silence all unhandled rejection warnings. The second behaves identical to the current default with the excetion that no deprecation warning will be printed and the last is going to throw an error for each unhandled rejection, just as regular exceptions do. It is possible to intercept those with the `uncaughtException` hook as with all other exceptions as well. This PR has no influence on the existing `unhandledRejection` hook. If that is used, it will continue to function as before. PR-URL: https://github.com/nodejs/node/pull/26599 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Matheus Marchini <mat@mmarchini.me> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2019-03-13src: fix SplitString to ignore white spaceshimself65
PR-URL: https://github.com/nodejs/node/pull/26545 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Khaidi Chu <i@2333.moe>
2019-03-07test: fix tests so they work in worker threadsRichard Lau
Use the `cwd` option for child_process instead of `process.chdir()` to allow tests to work with worker threads. PR-URL: https://github.com/nodejs/node/pull/26453 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2019-02-08src: allow --perf-prof-unwinding-info in NODE_OPTIONSTom Gallacher
PR-URL: https://github.com/nodejs/node/pull/25565 Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2019-02-08src: allow --perf-basic-prof-only-functions in NODE_OPTIONSTom Gallacher
PR-URL: https://github.com/nodejs/node/pull/25565 Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-09-25cli: normalize `_` → `-` when parsing optionsAnna Henningsen
This allows for option syntax similar to V8’s one, e.g. `--no_warnings` has the same effect as `--no-warnings`. PR-URL: https://github.com/nodejs/node/pull/23020 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-08-26src: fix NODE_OPTIONS parsing bugAnna Henningsen
I, uhm, might have messed up by using a `substr(start, end)` signature when `std::string` actually uses `substr(start, len)`. Fix that. Fixes: https://github.com/nodejs/node/issues/22526 Refs: https://github.com/nodejs/node/pull/22392 PR-URL: https://github.com/nodejs/node/pull/22529 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-06-06test,tools: enable running tests under workersAnna Henningsen
Enable running tests inside workers by passing `--worker` to `tools/test.py`. A number of tests are marked as skipped, or have been slightly altered to fit the different environment. PR-URL: https://github.com/nodejs/node/pull/20876 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Shingo Inoue <leko.noor@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: John-David Dalton <john.david.dalton@gmail.com> Reviewed-By: Gus Caplan <me@gus.host>
2018-05-07test: fix test-cli-node-options.js on mipsRuben Bridgewater
The performance jit logger is not implemented on mips. PR-URL: https://github.com/nodejs/node/pull/20377 Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2018-03-04trace_events: add file pattern cli optionAndreas Madsen
Allow the user to specify the filepath for the trace_events log file using a template string. PR-URL: https://github.com/nodejs/node/pull/18480 Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-02-01src: allow --perf-(basic-)?prof in NODE_OPTIONSLeko
PR-URL: https://github.com/nodejs/node/pull/17600 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2018-01-31test: move tmpdir to submodule of commonRich Trott
Move tmpdir functionality to its own module (common/tmpdir). PR-URL: https://github.com/nodejs/node/pull/17856 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2017-11-30src: fix typo in NODE_OPTIONS whitelistEvan Lucas
The whitelist of allowed cli flags that can be passed in the NODE_OPTIONS environment variable had --trace-events-categories, but the cli flag is actually --trace-event-categories. PR-URL: https://github.com/nodejs/node/pull/17369 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Jon Moss <me@jonathanmoss.me> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-11-03test: fix test-cli-node-options on WindowsAnna Henningsen
https://github.com/nodejs/node/pull/16495 broke the Windows build, accounting for `\r\n` newlines should fix it. Ref: https://github.com/nodejs/node/pull/16495 PR-URL: https://github.com/nodejs/node/pull/16709 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2017-11-03cli: add --stack-trace-limit to NODE_OPTIONSAnna Henningsen
I decided that it would make a lot of sense for me to set `NODE_OPTIONS=--stack-trace-limit=100` on my development machine. This code allows me to do that. :) PR-URL: https://github.com/nodejs/node/pull/16495 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ryan Graham <r.m.graham@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
2017-09-04test: split test-cli-node-optionsRefael Ackermann
* partitioning the subprocess groups * use `-e` instead of module * reduce maxBuffer PR-URL: https://github.com/nodejs/node/pull/14195 Fixes: https://github.com/nodejs/node/issues/14191 Reviewed-By: Rich Trott <rtrott@gmail.com>
2017-09-03test: remove envPlus, use Object.assign everywhereGibson Fahnestock
PR-URL: https://github.com/nodejs/node/pull/14845 Fixes: https://github.com/nodejs/node/issues/14823 Refs: https://github.com/nodejs/node/pull/14822 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Rich Trott <rtrott@gmail.com>
2017-07-21lib,src: fix consistent spacing inside bracesSebastiaan Deckers
PR-URL: https://github.com/nodejs/node/pull/14162 Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2017-07-10src: whitelist v8 options with '_' or '-'Sam Roberts
V8 options allow either '_' or '-' to be used in options as a seperator, such as "--abort-on_uncaught-exception". Allow these case variations when used with NODE_OPTIONS. PR-URL: https://github.com/nodejs/node/pull/14093 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2017-07-05src: --abort-on-uncaught-exception in NODE_OPTIONSSam Roberts
Allow --abort-on-uncaught-exception in NODE_OPTIONS, its useful to enable for post-mortem debugging. PR-URL: https://github.com/nodejs/node/pull/13932 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2017-07-04test: simplify test skippingVse Mozhet Byt
* Make common.skip() exit. Also add common.printSkipMessage() for partial skips. * Don't make needless things before skip PR-URL: https://github.com/nodejs/node/pull/14021 Fixes: https://github.com/nodejs/node/issues/14016 Reviewed-By: Refael Ackermann <refack@gmail.com>
2017-06-12test: fix typo in test-cli-node-options.jsVse Mozhet Byt
`expect` was probably a typo, as it is a function and will always be `undefined` as JSON. The previous `test()` check infers it should be `want`. PR-URL: https://github.com/nodejs/node/pull/13558 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2017-05-19src: check if --icu-data-dir= points to valid dirBen Noordhuis
Call uc_init() after u_setDataDirectory() to find out if the data directory is actually valid. This commit removes parallel/test-intl-no-icu-data, added in commit 46345b9 ("src: make --icu-data-dir= switch testable"). It no longer works now that an invalid --icu-data-dir= argument is rejected. Coverage is now provided by parallel/test-icu-data-dir. Fixes: https://github.com/nodejs/node/issues/13043 Refs: https://github.com/nodejs/node-gyp/issues/1199 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Steven R Loomis <srloomis@us.ibm.com>
2017-05-05test: reduce string concatenationsVse Mozhet Byt
PR-URL: https://github.com/nodejs/node/pull/12735 Refs: https://github.com/nodejs/node/pull/12455 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
2017-04-29test: add hasCrypto check to test-cli-node-optionsDaniel Bevenius
Currently when configure --without-ssl the test will throw the following error: bad option: --use-openssl-ca This commit checks if crypto was enabled and skips the crypto related tests if that is the case. PR-URL: https://github.com/nodejs/node/pull/12692 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com>/
2017-04-28test: chdir before running test-cli-node-optionsDaniel Bevenius
When test-cli-node-options is run it uses the --trace-events-enabled option which generates a file named node_trace.1.log. This commit changes the working directory to the test tmp directory to avoid this file being created in the project root. PR-URL: https://github.com/nodejs/node/pull/12660 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
2017-04-25src: allow CLI args in env with NODE_OPTIONSSam Roberts
Not all CLI options are supported, those that are problematic from a security or implementation point of view are disallowed, as are ones that are inappropriate (for example, -e, -p, --i), or that only make sense when changed with code changes (such as options that change the javascript syntax or add new APIs). PR-URL: https://github.com/nodejs/node/pull/12028 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Bradley Farias <bradley.meck@gmail.com>