Patchwork [4,of,5] run-tests: output coverage to output dir

login
register
mail settings
Submitter Siddharth Agarwal
Date June 8, 2017, 4:26 a.m.
Message ID <1403ca58e0bbd50a9a92.1496895997@devvm31800.prn1.facebook.com>
Download mbox | patch
Permalink /patch/21244/
State Accepted
Headers show

Comments

Siddharth Agarwal - June 8, 2017, 4:26 a.m.
# HG changeset patch
# User Siddharth Agarwal <sid0@fb.com>
# Date 1496895426 25200
#      Wed Jun 07 21:17:06 2017 -0700
# Node ID 1403ca58e0bbd50a9a9287915073516db610b3c2
# Parent  511ebc1769a9de229c5cca69ef3893bea1f2a63a
run-tests: output coverage to output dir

There do not appear to be any tests for this, and I've never used either of
these options before, but this works.

Patch

diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -2756,10 +2756,10 @@  class TestRunner(object):
         cov.report(ignore_errors=True, omit=omit)
 
         if self.options.htmlcov:
-            htmldir = os.path.join(self._testdir, 'htmlcov')
+            htmldir = os.path.join(self._outputdir, 'htmlcov')
             cov.html_report(directory=htmldir, omit=omit)
         if self.options.annotate:
-            adir = os.path.join(self._testdir, 'annotated')
+            adir = os.path.join(self._outputdir, 'annotated')
             if not os.path.isdir(adir):
                 os.mkdir(adir)
             cov.annotate(directory=adir, omit=omit)