[llvm-commits] [test-suite] r128900 - /test-suite/trunk/tools/get-report-time
Daniel Dunbar
daniel at zuster.org
Tue Apr 5 11:23:18 PDT 2011
Author: ddunbar
Date: Tue Apr 5 13:23:18 2011
New Revision: 128900
URL: http://llvm.org/viewvc/llvm-project?rev=128900&view=rev
Log:
Add a trivial script to extract the times from *.report.txt files.
Added:
test-suite/trunk/tools/get-report-time (with props)
Added: test-suite/trunk/tools/get-report-time
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/tools/get-report-time?rev=128900&view=auto
==============================================================================
--- test-suite/trunk/tools/get-report-time (added)
+++ test-suite/trunk/tools/get-report-time Tue Apr 5 13:23:18 2011
@@ -0,0 +1,27 @@
+#!/usr/bin/env python
+
+import re
+import optparse
+
+def main():
+ parser = optparse.OptionParser("""\
+usage: %prog [options] <path>
+
+Reads the file at the given path and extracts any "program times" as used by the
+LLVM test-suite Makefiles.""")
+ opts,args = parser.parse_args()
+ if len(args) != 1:
+ parser.error('invalid number of arguments')
+
+ file = open(args[0])
+ try:
+ re_pattern = re.compile(r"program ([0-9]+\.[0-9]+)")
+
+ data = file.read()
+ for match in re_pattern.finditer(data):
+ print match.group(1)
+ finally:
+ file.close()
+
+if __name__ == '__main__':
+ main()
Propchange: test-suite/trunk/tools/get-report-time
------------------------------------------------------------------------------
svn:executable = *
More information about the llvm-commits
mailing list