[test-suite] r260355 - lit: Create output files with different names in runsafely
Matthias Braun via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 9 19:56:37 PST 2016
Author: matze
Date: Tue Feb 9 21:56:36 2016
New Revision: 260355
URL: http://llvm.org/viewvc/llvm-project?rev=260355&view=rev
Log:
lit: Create output files with different names in runsafely
If a script has multiple lines, then we should use a different output
name for each of these so the outputs don't overwrite each other.
Modified:
test-suite/trunk/litsupport/runsafely.py
Modified: test-suite/trunk/litsupport/runsafely.py
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/litsupport/runsafely.py?rev=260355&r1=260354&r2=260355&view=diff
==============================================================================
--- test-suite/trunk/litsupport/runsafely.py (original)
+++ test-suite/trunk/litsupport/runsafely.py Tue Feb 9 21:56:36 2016
@@ -52,12 +52,23 @@ def wrapScript(context, script, suffix):
adjusted_script = []
outfile = context.tmpBase + suffix
# Set name of timefile so getTime() can use it
- context.timefile = outfile + ".time"
+ context.timefiles = []
+ i = 0
for line in script:
+ number = ""
+ if len(script) > 1:
+ number = "-%s" % (i,)
+ i += 1
+ outfile = context.tmpBase + number + suffix
+ context.timefiles.append(outfile + ".time")
+
line = prepareRunSafely(context, line, outfile)
adjusted_script.append(line)
return adjusted_script
def getTime(context):
- return timeit.getUserTime(context.timefile)
+ time = 0.0
+ for timefile in context.timefiles:
+ time += timeit.getUserTime(timefile)
+ return time
More information about the llvm-commits
mailing list