summaryrefslogtreecommitdiff
path: root/coverage/cmdline.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2009-08-09 18:12:23 -0400
committerNed Batchelder <ned@nedbatchelder.com>2009-08-09 18:12:23 -0400
commitcba5899f0bad8a49b17750df58ddd532975c1062 (patch)
tree02eac123c89f439b440c7efb6a7aa0a98bd12e80 /coverage/cmdline.py
parentb159081bb7df0c838bcf01ca9e70899a61ae9d9b (diff)
downloadpython-coveragepy-git-cba5899f0bad8a49b17750df58ddd532975c1062.tar.gz
Fix a problem with DecoratorTools fiddling with the trace function and screwing us up. Now the Python trace function is simpler, with no variability of registered trace function. Fixes bugs #12 and #13.
Diffstat (limited to 'coverage/cmdline.py')
-rw-r--r--coverage/cmdline.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/coverage/cmdline.py b/coverage/cmdline.py
index 9684b925..b353efa1 100644
--- a/coverage/cmdline.py
+++ b/coverage/cmdline.py
@@ -10,11 +10,12 @@ Measure, collect, and report on code coverage in Python programs.
Usage:
-coverage -x [-p] [-L] MODULE.py [ARG1 ARG2 ...]
+coverage -x [-p] [-L] [--timid] MODULE.py [ARG1 ARG2 ...]
Execute the module, passing the given command-line arguments, collecting
coverage data. With the -p option, include the machine name and process
ID in the .coverage file name. With -L, measure coverage even inside the
- Python installed library, which isn't done by default.
+ Python installed library, which isn't done by default. With --timid, use a
+ simpler but slower trace method.
coverage -e
Erase collected coverage data.
@@ -95,8 +96,11 @@ class CoverageScript:
'-x': 'execute',
'-o:': 'omit=',
}
+ # Long options with no short equivalent.
+ long_only_opts = ['timid']
+
short_opts = ''.join([o[1:] for o in optmap.keys()])
- long_opts = optmap.values()
+ long_opts = optmap.values() + long_only_opts
options, args = getopt.getopt(argv, short_opts, long_opts)
for o, a in options:
if optmap.has_key(o):
@@ -139,7 +143,8 @@ class CoverageScript:
# Do something.
self.coverage = self.covpkg.coverage(
data_suffix = bool(settings.get('parallel-mode')),
- cover_pylib = settings.get('pylib')
+ cover_pylib = settings.get('pylib'),
+ timid = settings.get('timid'),
)
if settings.get('erase'):