Skip to content

Commit

Permalink
tools: fix test.py --shell
Browse files Browse the repository at this point in the history
This fixes the necessary plumbing to make the --shell argument
have its intended effect.

PR-URL: #26449
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
  • Loading branch information
hashseed authored and BethGriggs committed Apr 16, 2019
1 parent 378d4f1 commit 6586003
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions tools/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -908,12 +908,12 @@ def GetTestStatus(self, context, sections, defs):

class Context(object):

def __init__(self, workspace, buildspace, verbose, vm, args, expect_fail,
def __init__(self, workspace, verbose, vm, args, expect_fail,
timeout, processor, suppress_dialogs,
store_unexpected_output, repeat, abort_on_timeout):
self.workspace = workspace
self.buildspace = buildspace
self.verbose = verbose
self.vm = vm
self.node_args = args
self.expect_fail = expect_fail
self.timeout = timeout
Expand All @@ -926,6 +926,8 @@ def __init__(self, workspace, buildspace, verbose, vm, args, expect_fail,
self.node_has_crypto = True

def GetVm(self, arch, mode):
if self.vm is not None:
return self.vm
if arch == 'none':
name = 'out/Debug/node' if mode == 'debug' else 'out/Release/node'
else:
Expand Down Expand Up @@ -1368,7 +1370,7 @@ def BuildOptions():
dest="suppress_dialogs", default=True, action="store_true")
result.add_option("--no-suppress-dialogs", help="Display Windows dialogs for crashing tests",
dest="suppress_dialogs", action="store_false")
result.add_option("--shell", help="Path to V8 shell", default="shell")
result.add_option("--shell", help="Path to node executable", default=None)
result.add_option("--store-unexpected-output",
help="Store the temporary JS files from tests that fails",
dest="store_unexpected_output", default=True, action="store_true")
Expand Down Expand Up @@ -1589,14 +1591,11 @@ def Main():
options.node_args.append('--experimental-worker')
options.node_args.append(run_worker)

shell = abspath(options.shell)
buildspace = dirname(shell)

processor = GetSpecialCommandProcessor(options.special_command)

context = Context(workspace,
buildspace,
VERBOSE,
shell,
options.shell,
options.node_args,
options.expect_fail,
options.timeout,
Expand Down

0 comments on commit 6586003

Please sign in to comment.