diff options
author | Gibson Fahnestock <gibfahn@gmail.com> | 2017-10-30 18:26:57 +0000 |
---|---|---|
committer | Gibson Fahnestock <gibfahn@gmail.com> | 2017-11-20 15:23:02 +0000 |
commit | ad1967d656b1f7462709c49a0f57444917260f3a (patch) | |
tree | 0799455b7bef664dc9a1d474a8233eaffa703a16 /tools/test.py | |
parent | 5c7b1ecbceeb32d947bea31c1256b1a9a42b8cba (diff) | |
download | android-node-v8-ad1967d656b1f7462709c49a0f57444917260f3a.tar.gz android-node-v8-ad1967d656b1f7462709c49a0f57444917260f3a.tar.bz2 android-node-v8-ad1967d656b1f7462709c49a0f57444917260f3a.zip |
tools: allow running test.py without configuring
If config.gypi isn't defined, assume Node was build the default way,
i.e. with the inspector.
PR-URL: https://github.com/nodejs/node/pull/16621
Refs: https://github.com/nodejs/node/pull/16436#issuecomment-340115175
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Diffstat (limited to 'tools/test.py')
-rwxr-xr-x | tools/test.py | 28 |
1 files changed, 9 insertions, 19 deletions
diff --git a/tools/test.py b/tools/test.py index 4cb0bd631d..ec8297812f 100755 --- a/tools/test.py +++ b/tools/test.py @@ -889,8 +889,7 @@ class Context(object): def __init__(self, workspace, buildspace, verbose, vm, args, expect_fail, timeout, processor, suppress_dialogs, - store_unexpected_output, repeat, abort_on_timeout, - v8_enable_inspector): + store_unexpected_output, repeat, abort_on_timeout): self.workspace = workspace self.buildspace = buildspace self.verbose = verbose @@ -902,7 +901,7 @@ class Context(object): self.store_unexpected_output = store_unexpected_output self.repeat = repeat self.abort_on_timeout = abort_on_timeout - self.v8_enable_inspector = v8_enable_inspector + self.v8_enable_inspector = True def GetVm(self, arch, mode): if arch == 'none': @@ -930,20 +929,6 @@ def RunTestCases(cases_to_run, progress, tasks, flaky_tests_mode): progress = PROGRESS_INDICATORS[progress](cases_to_run, flaky_tests_mode) return progress.Run(tasks) -def GetV8InspectorEnabledFlag(): - # The following block reads config.gypi to extract the v8_enable_inspector - # value. This is done to check if the inspector is disabled in which case - # the '--inspect' flag cannot be passed to the node process as it will - # cause node to exit and report the test as failed. The use case - # is currently when Node is configured --without-ssl and the tests should - # still be runnable but skip any tests that require ssl (which includes the - # inspector related tests). - with open('config.gypi', 'r') as f: - s = f.read() - config_gypi = ast.literal_eval(s) - return config_gypi['variables']['v8_enable_inspector'] - - # ------------------------------------------- # --- T e s t C o n f i g u r a t i o n --- # ------------------------------------------- @@ -1626,8 +1611,7 @@ def Main(): options.suppress_dialogs, options.store_unexpected_output, options.repeat, - options.abort_on_timeout, - GetV8InspectorEnabledFlag()) + options.abort_on_timeout) # Get status for tests sections = [ ] @@ -1670,6 +1654,12 @@ def Main(): all_cases += cases all_unused.append(unused_rules) + # We want to skip the inspector tests if node was built without the inspector. + has_inspector = Execute([vm, + "-p", "process.config.variables.v8_enable_inspector"], context) + if has_inspector.stdout.rstrip() == "0": + context.v8_enable_inspector = False + if options.cat: visited = set() for test in unclassified_tests: |