Show More
@@ -103,27 +103,26 b' def install_hg():' | |||||
103 | os.chmod(os.path.join(BINDIR, 'hg'), 0700) |
|
103 | os.chmod(os.path.join(BINDIR, 'hg'), 0700) | |
104 |
|
104 | |||
105 | def output_coverage(): |
|
105 | def output_coverage(): | |
106 | if coverage: |
|
106 | vlog("# Producing coverage report") | |
107 | vlog("# Producing coverage report") |
|
107 | omit = [BINDIR, TESTDIR, PYTHONDIR] | |
108 | omit = [BINDIR, TESTDIR, PYTHONDIR] |
|
108 | if not options.cover_stdlib: | |
109 | if not options.cover_stdlib: |
|
109 | # Exclude as system paths (ignoring empty strings seen on win) | |
110 | # Exclude as system paths (ignoring empty strings seen on win) |
|
110 | omit += [x for x in sys.path if x != ''] | |
111 | omit += [x for x in sys.path if x != ''] |
|
111 | omit = ','.join(omit) | |
112 | omit = ','.join(omit) |
|
112 | os.chdir(PYTHONDIR) | |
113 | os.chdir(PYTHONDIR) |
|
113 | cmd = '"%s" "%s" -r "--omit=%s"' % ( | |
114 | cmd = '"%s" "%s" -r "--omit=%s"' % ( |
|
114 | sys.executable, os.path.join(TESTDIR, 'coverage.py'), omit) | |
115 | sys.executable, os.path.join(TESTDIR, 'coverage.py'), omit) |
|
115 | vlog("# Running: "+cmd) | |
|
116 | os.system(cmd) | |||
|
117 | if options.annotate: | |||
|
118 | adir = os.path.join(TESTDIR, 'annotated') | |||
|
119 | if not os.path.isdir(adir): | |||
|
120 | os.mkdir(adir) | |||
|
121 | cmd = '"%s" "%s" -a "--directory=%s" "--omit=%s"' % ( | |||
|
122 | sys.executable, os.path.join(TESTDIR, 'coverage.py'), | |||
|
123 | adir, omit) | |||
116 | vlog("# Running: "+cmd) |
|
124 | vlog("# Running: "+cmd) | |
117 | os.system(cmd) |
|
125 | os.system(cmd) | |
118 | if options.annotate: |
|
|||
119 | adir = os.path.join(TESTDIR, 'annotated') |
|
|||
120 | if not os.path.isdir(adir): |
|
|||
121 | os.mkdir(adir) |
|
|||
122 | cmd = '"%s" "%s" -a "--directory=%s" "--omit=%s"' % ( |
|
|||
123 | sys.executable, os.path.join(TESTDIR, 'coverage.py'), |
|
|||
124 | adir, omit) |
|
|||
125 | vlog("# Running: "+cmd) |
|
|||
126 | os.system(cmd) |
|
|||
127 |
|
126 | |||
128 | def run(cmd, split_lines=True): |
|
127 | def run(cmd, split_lines=True): | |
129 | """Run command in a sub-process, capturing the output (stdout and stderr). |
|
128 | """Run command in a sub-process, capturing the output (stdout and stderr). | |
@@ -242,7 +241,8 b' try:' | |||||
242 | tests += 1 |
|
241 | tests += 1 | |
243 |
|
242 | |||
244 | print "\n# Ran %d tests, %d failed." % (tests, failed) |
|
243 | print "\n# Ran %d tests, %d failed." % (tests, failed) | |
245 |
|
|
244 | if coverage: | |
|
245 | output_coverage() | |||
246 | finally: |
|
246 | finally: | |
247 | cleanup_exit() |
|
247 | cleanup_exit() | |
248 |
|
248 |
General Comments 0
You need to be logged in to leave comments.
Login now