summaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorAnna Zaks <ganna@apple.com>2012-01-10 18:10:25 +0000
committerAnna Zaks <ganna@apple.com>2012-01-10 18:10:25 +0000
commitd3e29ef3e0c3f2f70ec41c83e68c271f970e1852 (patch)
tree9a807d0533cb8d615ea08dfbfb89f5921dff7a1a /utils
parent91ee4a7f36b520248f505f7d82418eb8fc08f315 (diff)
[analyzer] Testing infrastructure: Flush output after every print
statement. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147862 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rwxr-xr-xutils/analyzer/SATestBuild.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/utils/analyzer/SATestBuild.py b/utils/analyzer/SATestBuild.py
index a3a6311fdb..79092d6fef 100755
--- a/utils/analyzer/SATestBuild.py
+++ b/utils/analyzer/SATestBuild.py
@@ -78,6 +78,16 @@ Verbose = 1
IsReferenceBuild = False
+# Make sure we flush the output after every print statement.
+class flushfile(object):
+ def __init__(self, f):
+ self.f = f
+ def write(self, x):
+ self.f.write(x)
+ self.f.flush()
+
+sys.stdout = flushfile(sys.stdout)
+
def getProjectMapPath():
ProjectMapPath = os.path.join(os.path.abspath(os.curdir),
ProjectMapFile)
@@ -397,7 +407,6 @@ def testAll(InIsReferenceBuild = False):
print "Error: Second entry in the ProjectMapFile should be 0 or 1."
raise Exception()
testProject(I[0], InIsReferenceBuild, int(I[1]))
- sys.stdout.flush()
except:
print "Error occurred. Premature termination."
raise