Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(65)

Unified Diff: dart/frog/frog.py

Issue 10164004: Remove frogsh. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: dart/frog/frog.py
diff --git a/dart/frog/frog.py b/dart/frog/frog.py
index f338ebcc95cf170e55c0a296444b5c96a90ab19e..153c813687937c050176acf7f8d55d2ae5d75903 100755
--- a/dart/frog/frog.py
+++ b/dart/frog/frog.py
@@ -33,6 +33,21 @@ HTML = '''<html>
</html>
'''
+
+# Returns the path to the Dart test runner (executes the .dart file).
+def GetDartRunner(mode, arch, component):
+ build_root = utils.GetBuildRoot(GuessOS(), mode, arch)
+ if component == 'dartc':
kasperl 2012/04/20 12:53:09 Does this still exist (dartc_test)?
ahe 2012/04/23 13:14:09 Done.
+ return os.path.join(build_root, 'compiler', 'bin', 'dartc_test')
+ elif component == 'frog':
+ return os.path.join(build_root, 'frog', 'bin', 'frog')
+ else:
+ suffix = ''
+ if utils.IsWindows():
+ suffix = '.exe'
+ return os.path.join(build_root, 'dart') + suffix
+
+
def GetDart():
# Get the release version.
return utils.GetDartRunner('release', 'ia32', 'vm')
@@ -42,11 +57,6 @@ def GetD8():
D8 = GetD8()
-# The following environment variable is needed for isolate tests to work.
-# TODO(sigmund): delete this and the 'env' parameter in 'execute' when we remove
-# dependencies to nodejs
-os.environ['NODE_MODULE_CONTEXTS'] = '1'
-
def execute(cmd):
"""Execute a command in a subprocess. """
try:
@@ -85,7 +95,7 @@ def parseOptions(args):
# TODO(vsm): Hook in HtmlConverter.
optionParser.add_option('--html',
- action='store_true', help='Invoke this in the browser instead of node/d8.')
+ action='store_true', help='Invoke this in the browser instead of d8.')
optionParser.add_option('--browser',
default = None,
metavar='FILE', help='The browser to use to run output HTML.')
@@ -126,22 +136,17 @@ def main(args):
def ensureJsEngine(options):
- proc = subprocess.Popen("node --help",
- stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
- if proc.wait() != 0:
- if not exists(D8):
- print "No engine available for running JS code."
- print "See frog/README.txt for instructions."
- return 1
- elif 'node' in options.js_cmd:
- options.js_cmd = D8
+ if not exists(D8):
+ print "No engine available for running JS code."
+ print "See frog/README.txt for instructions."
+ return 1
return 0
def compileAndRun(options, args, dart):
- nodeArgs = []
+ jsArgs = []
for i in range(len(args)):
if args[i].endswith('.dart'):
- nodeArgs = args[i+1:]
+ jsArgs = args[i+1:]
args = args[:i+1]
break
@@ -157,7 +162,7 @@ def compileAndRun(options, args, dart):
execute_output = False
break;
- if options.verbose: print "nodeArgs %s" % ' '.join(nodeArgs);
+ if options.verbose: print "jsArgs %s" % ' '.join(jsArgs);
workdir = options.workdir
cleanup = False
@@ -210,7 +215,7 @@ def compileAndRun(options, args, dart):
if ensureJsEngine(options) != 0:
return 1
js_cmd = options.js_cmd
- result = execute(js_cmd.split(' ') + [outfile] + nodeArgs)
+ result = execute(js_cmd.split(' ') + [outfile] + jsArgs)
else:
f = open(outhtml, 'w')
f.write(HTML)

Powered by Google App Engine
This is Rietveld 408576698