aboutsummaryrefslogtreecommitdiff
path: root/tools/binman/binman.py
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2019-05-14 15:53:38 -0600
committerSimon Glass <sjg@chromium.org>2019-07-10 16:52:45 -0600
commit35343dc41493666261e37a8a559b78eb2841a528 (patch)
treec93661576dc1d5030845d4c4076632e7fd2f2873 /tools/binman/binman.py
parent2ca8468026b678c8630ad99290cc5d2428eaeb55 (diff)
downloadu-boot-35343dc41493666261e37a8a559b78eb2841a528.zip
u-boot-35343dc41493666261e37a8a559b78eb2841a528.tar.gz
u-boot-35343dc41493666261e37a8a559b78eb2841a528.tar.bz2
binman: Don't show errors for failed tests
An unfortunate new feature in Python 3.5 causes binman to print errors for non-existent tests, when the test filter is used. Work around this by detecting the unwanted tests and removing them from the result. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/binman/binman.py')
-rwxr-xr-xtools/binman/binman.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tools/binman/binman.py b/tools/binman/binman.py
index 4206d2b..aad2e9c 100755
--- a/tools/binman/binman.py
+++ b/tools/binman/binman.py
@@ -87,6 +87,18 @@ def RunTests(debug, processes, args):
else:
suite.run(result)
+ # Remove errors which just indicate a missing test. Since Python v3.5 If an
+ # ImportError or AttributeError occurs while traversing name then a
+ # synthetic test that raises that error when run will be returned. These
+ # errors are included in the errors accumulated by result.errors.
+ if test_name:
+ errors = []
+ for test, err in result.errors:
+ if ("has no attribute '%s'" % test_name) not in err:
+ errors.append((test, err))
+ result.testsRun -= 1
+ result.errors = errors
+
print(result)
for test, err in result.errors:
print(test.id(), err)