[U-Boot] [RFC][DO NOT APPLY] binman: Switch to 'python-coverage'

Tom Rini trini at konsulko.com
Sat May 26 17:06:58 UTC 2018


The most portable way to get access to coverage is to invoke it as
'python-coverage'.

Cc: Simon Glass <sjg at chromium.org>
Signed-off-by: Tom Rini <trini at konsulko.com>
---
So, here's the set of problems I have.  First, running 'pip install
coverage' doesn't get me a 'coverage' binary, so I've just never made
good use of 'make tests' and so never have these run.  It also means
they aren't strictly in travis-ci, so they're never run automatically.
With this patch, make tests executes for me, and now fails noting that a
lot of things don't have coverage.  I'm honestly not sure what the best
path forward here is.
---
 tools/binman/README    | 3 +--
 tools/binman/binman.py | 4 ++--
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/tools/binman/README b/tools/binman/README
index b20098177ee9..5d55ed68e3da 100644
--- a/tools/binman/README
+++ b/tools/binman/README
@@ -506,8 +506,7 @@ implementations target 100% test coverage. Run 'binman -T' to check this.
 
 To enable Python test coverage on Debian-type distributions (e.g. Ubuntu):
 
-   $ sudo apt-get install python-pip python-pytest
-   $ sudo pip install coverage
+   $ sudo apt-get install python-coverage python-pytest
 
 
 Advanced Features / Technical docs
diff --git a/tools/binman/binman.py b/tools/binman/binman.py
index fa2f551f5542..447062dca167 100755
--- a/tools/binman/binman.py
+++ b/tools/binman/binman.py
@@ -71,11 +71,11 @@ def RunTests(debug):
 def RunTestCoverage():
     """Run the tests and check that we get 100% coverage"""
     # This uses the build output from sandbox_spl to get _libfdt.so
-    cmd = ('PYTHONPATH=$PYTHONPATH:%s/sandbox_spl/tools coverage run '
+    cmd = ('PYTHONPATH=$PYTHONPATH:%s/sandbox_spl/tools python-coverage run '
             '--include "tools/binman/*.py" --omit "*test*,*binman.py" '
             'tools/binman/binman.py -t' % options.build_dir)
     os.system(cmd)
-    stdout = command.Output('coverage', 'report')
+    stdout = command.Output('python-coverage', 'report')
     lines = stdout.splitlines()
 
     test_set= set([os.path.basename(line.split()[0])
-- 
2.7.4



More information about the U-Boot mailing list