summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbitbake/bin/bitbake-selftest20
1 files changed, 19 insertions, 1 deletions
diff --git a/bitbake/bin/bitbake-selftest b/bitbake/bin/bitbake-selftest
index 1e00e33271..380e003619 100755
--- a/bitbake/bin/bitbake-selftest
+++ b/bitbake/bin/bitbake-selftest
@@ -37,6 +37,24 @@ for t in tests:
37 __import__(t) 37 __import__(t)
38 38
39 39
40# Set-up logging
41class StdoutStreamHandler(logging.StreamHandler):
42 """Special handler so that unittest is able to capture stdout"""
43 def __init__(self):
44 # Override __init__() because we don't want to set self.stream here
45 logging.Handler.__init__(self)
46
47 @property
48 def stream(self):
49 # We want to dynamically write wherever sys.stdout is pointing to
50 return sys.stdout
51
52
53handler = StdoutStreamHandler()
54bb.logger.addHandler(handler)
55bb.logger.setLevel(logging.DEBUG)
56
57
40ENV_HELP = """\ 58ENV_HELP = """\
41Environment variables: 59Environment variables:
42 BB_SKIP_NETTESTS set to 'yes' in order to skip tests using network 60 BB_SKIP_NETTESTS set to 'yes' in order to skip tests using network
@@ -51,4 +69,4 @@ class main(unittest.main):
51 69
52 70
53if __name__ == '__main__': 71if __name__ == '__main__':
54 main(defaultTest=tests) 72 main(defaultTest=tests, buffer=True)