ia64/xen-unstable

annotate tools/check/check_logging @ 6385:f34e732ed4bf

Xenstore testsuite robustness: save output rather than rerun on failure.
"make check" reruns a test which fails with more verbosity. If the test
fails intermittently, that doesn't work well: save the output and simply
dump it if the test fails.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
author cl349@firebug.cl.cam.ac.uk
date Tue Aug 23 19:58:59 2005 +0000 (2005-08-23)
parents 0a4b76b6b5a0
children 95cfc001ddd1 291e816acbf4 b2f4823b6ff0
rev   line source
mjw@2295 1 #!/usr/bin/env python
mjw@2295 2 # -*- mode: python; -*-
mjw@2295 3
mjw@2295 4 import os
mjw@2295 5 import sys
mjw@2295 6
mjw@2295 7 def hline():
mjw@2295 8 print >>sys.stderr, "*" * 70
mjw@2295 9
mjw@2295 10 def msg(message):
mjw@2295 11 print >>sys.stderr, "*" * 3, message
mjw@2295 12
mjw@2295 13 def check_logging():
mjw@2295 14 """Check python logging is installed and raise an error if not.
mjw@2295 15 Logging is standard from Python 2.3 on.
mjw@2295 16 """
mjw@2295 17 try:
mjw@2295 18 import logging
mjw@2295 19 except ImportError:
mjw@2295 20 hline()
mjw@2295 21 msg("Python logging is not installed.")
mjw@2295 22 msg("Use 'make install-logging' at the xen root to install.")
mjw@2295 23 msg("")
mjw@2295 24 msg("Alternatively download and install from")
mjw@2295 25 msg("http://www.red-dove.com/python_logging.html")
mjw@2295 26 hline()
mjw@2295 27 sys.exit(1)
mjw@2295 28
mjw@2295 29 if __name__ == '__main__':
mjw@2295 30 check_logging()