[test-suite] r254127 - lit: Be robust against missing timing result files
Matthias Braun via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 25 19:35:24 PST 2015
Author: matze
Date: Wed Nov 25 21:35:24 2015
New Revision: 254127
URL: http://llvm.org/viewvc/llvm-project?rev=254127&view=rev
Log:
lit: Be robust against missing timing result files
Modified:
test-suite/trunk/lit.cfg
Modified: test-suite/trunk/lit.cfg
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/lit.cfg?rev=254127&r1=254126&r2=254127&view=diff
==============================================================================
--- test-suite/trunk/lit.cfg (original)
+++ test-suite/trunk/lit.cfg Wed Nov 25 21:35:24 2015
@@ -147,8 +147,11 @@ class TestSuiteTest(FileBasedTest):
return lit.Test.Result(Test.FAIL, output)
timefile = "%s.time" % (outfile,)
- runtime = getUserTimeFromTimeOutput(timefile)
- runtimes.append(runtime)
+ try:
+ runtime = getUserTimeFromTimeOutput(timefile)
+ runtimes.append(runtime)
+ except IOError:
+ pass
# Run verification script (the "VERIFY:" part)
if len(verifyscript) > 0:
@@ -163,11 +166,17 @@ class TestSuiteTest(FileBasedTest):
output += "\n" + err
return lit.Test.Result(Test.FAIL, output)
- compile_time = collectCompileTime(test)
-
+ # Put metrics into the test result.
result = lit.Test.Result(Test.PASS, output)
- result.addMetric('exec_time', lit.Test.toMetricValue(runtimes[0]))
- result.addMetric('compile_time', lit.Test.toMetricValue(compile_time))
+ if len(runtimes) > 0:
+ result.addMetric('exec_time', lit.Test.toMetricValue(runtimes[0]))
+ try:
+ compile_time = collectCompileTime(test)
+ result.addMetric('compile_time',
+ lit.Test.toMetricValue(compile_time))
+ except IOError:
+ pass
+
return result
config.name = 'test-suite'
More information about the llvm-commits
mailing list