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

Unified Diff: client/tools/jscoverage_wrapper.py

Issue 9837113: Move update.py to samples/swarm, remove a bunch of deprecated files for (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 9 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
« no previous file with comments | « client/tools/coverage.py ('k') | client/tools/scss.sh » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/tools/jscoverage_wrapper.py
===================================================================
--- client/tools/jscoverage_wrapper.py (revision 5923)
+++ client/tools/jscoverage_wrapper.py (working copy)
@@ -1,48 +0,0 @@
-# Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
-# for details. All rights reserved. Use of this source code is governed by a
-# BSD-style license that can be found in the LICENSE file.
-
-"""Wraps jscoverage to instrument a single file more efficently.
-
-JScoverage crawls directories recursively to copy and instrument everything
-under a directory. This turns out to be too slow for our use, because our
-generated .js files live in directories with > 100K files. Even though
-jscoverage has a flag ('--exclude') to skip some files for
-instrumentation/copying, it stills crawls recursively everything under the
-directory.
-
-This script is a simple wrap on top of jscoverage. It creates a temporary
-directory, copies the file we want to instrument alone, and runs jscoverage
-within this small directory.
-"""
-
-import os
-import subprocess
-import sys
-
-def main():
- if len(sys.argv) < 3:
- print "usage: %s <jscoverage-path> filepath outdir"
- return 1
-
- jscoveragecmd = sys.argv[1]
- filepath = sys.argv[2]
- outdir = sys.argv[3]
-
- tmpdir = filepath + "_"
- copypath = os.path.join(tmpdir, os.path.basename(filepath))
- try:
- os.mkdir(tmpdir)
- except Exception:
- if not os.path.exists(tmpdir):
- raise
- with open(filepath, 'r') as f1:
- with open(copypath, 'w') as f2:
- f2.write(f1.read())
- status = subprocess.call([jscoveragecmd, tmpdir, outdir])
- os.remove(copypath)
- os.rmdir(tmpdir)
- return status
-
-if __name__ == '__main__':
- sys.exit(main())
« no previous file with comments | « client/tools/coverage.py ('k') | client/tools/scss.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698