[Python-checkins] devinabox: Move run_coverage.py functionality into make_a_box.py.

brett.cannon python-checkins at python.org
Mon Feb 28 23:03:51 CET 2011


brett.cannon pushed bd04d72f7257 to devinabox:

http://hg.python.org/devinabox/rev/bd04d72f7257
changeset:   26:bd04d72f7257
user:        Brett Cannon <brett at python.org>
date:        Sat Feb 26 18:12:27 2011 -0800
summary:
  Move run_coverage.py functionality into make_a_box.py.

files:
  make_a_box.py

diff --git a/make_a_box.py b/make_a_box.py
--- a/make_a_box.py
+++ b/make_a_box.py
@@ -24,7 +24,8 @@
 import urllib.parse
 import webbrowser
 import xmlrpc.client
-import run_coverage
+import build_cpython
+import run_all_tests
 
 
 def rename(new_name):
@@ -133,11 +134,25 @@
 
     def build(self):
         """Run coverage over CPython."""
-        # XXX build python
-        # XXX run coverage
-        # XXX ``make distclean``
-        # XXX generate html
-        run_coverage.main()
+        # Build Python
+        build_cpython.main()
+        # Run coverage
+        executable = run_all_tests.executable()
+        if not executable:
+            print('No CPython executable found')
+            sys.exit(1)
+        print('Running coverage ...')
+        regrest_path = os.path.join(CPython.directory, 'Lib', 'test',
+                                    'regrtest.py')
+        subprocess.check_call([executable, self.directory, 'run', '--pylib',
+                               regrtest_path])
+        # ``make distclean`` as you don't want to distribute your own build
+        with change_cwd(CPython.directory):
+            subprocess.check_call(['make', 'distclean'])
+        # Generate the HTML report
+        print('Generating report ...')
+        subprocess.call([executable, 'coveragepy', 'html', '-i', '--omit',
+                         '"*/test/*,*/tests/*"', '-d', 'coverage_report'])
 
 
 class Mercurial(Provider):

--
Repository URL: http://hg.python.org/devinabox


More information about the Python-checkins mailing list