summaryrefslogtreecommitdiffstats
path: root/clang
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
commitde1f7f8bfb694cba55a4c354748a70973bb995c5 (patch)
treeeccea1ecdeb8e57ec2a33d231101d0d10663fae7 /clang
parentf3e8502cc18b4e8e49d99d6910c15c4d68658d1d (diff)
downloadbcm5719-llvm-de1f7f8bfb694cba55a4c354748a70973bb995c5.tar.gz
bcm5719-llvm-de1f7f8bfb694cba55a4c354748a70973bb995c5.zip
[analyzer] Testing infrastructure: Flush output after every print
statement. llvm-svn: 147862
Diffstat (limited to 'clang')
-rwxr-xr-xclang/utils/analyzer/SATestBuild.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/clang/utils/analyzer/SATestBuild.py b/clang/utils/analyzer/SATestBuild.py
index a3a6311fdb8..79092d6fef9 100755
--- a/clang/utils/analyzer/SATestBuild.py
+++ b/clang/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
OpenPOWER on IntegriCloud