diff options
author | anatoly techtonik <techtonik@gmail.com> | 2012-12-15 13:51:47 (GMT) |
---|---|---|
committer | anatoly techtonik <techtonik@gmail.com> | 2012-12-15 13:51:47 (GMT) |
commit | 7911aed366660c73c2d348d31e1657ed73372540 (patch) | |
tree | 290d09b5aec0bc8bb05e1c68dc51a1a5cee38390 /runtest.py | |
parent | cab504dd1de67c0eaeb8f7f4553826937303a3e6 (diff) | |
download | SCons-7911aed366660c73c2d348d31e1657ed73372540.zip SCons-7911aed366660c73c2d348d31e1657ed73372540.tar.gz SCons-7911aed366660c73c2d348d31e1657ed73372540.tar.bz2 |
runtest.py: Turn on unbuffered output ASAP.
Diffstat (limited to 'runtest.py')
-rw-r--r-- | runtest.py | 31 |
1 files changed, 18 insertions, 13 deletions
@@ -289,6 +289,23 @@ runtest.py: No tests were specified. """) sys.exit(1) + +# --- setup stdout/stderr --- +class Unbuffered(object): + def __init__(self, file): + self.file = file + self.softspace = 0 ## backward compatibility; not supported in Py3k + def write(self, arg): + self.file.write(arg) + self.file.flush() + def __getattr__(self, attr): + return getattr(self.file, attr) + +sys.stdout = Unbuffered(sys.stdout) +sys.stderr = Unbuffered(sys.stderr) + + +# --- define helpers ---- if sys.platform in ('win32', 'cygwin'): def whereis(file): @@ -488,6 +505,7 @@ format_class = { Test = format_class[format] +# --- start processing --- if package: dir = { @@ -746,19 +764,6 @@ if qmtest: tests = [Test(t) for t in tests] -class Unbuffered(object): - def __init__(self, file): - self.file = file - self.softspace = 0 ## backward compatibility; not supported in Py3k - def write(self, arg): - self.file.write(arg) - self.file.flush() - def __getattr__(self, attr): - return getattr(self.file, attr) - -sys.stdout = Unbuffered(sys.stdout) -sys.stderr = Unbuffered(sys.stderr) - if list_only: for t in tests: sys.stdout.write(t.path + "\n") |