From 9bc3c897eaa818ab811a892a8ea8b92d71c165e4 Mon Sep 17 00:00:00 2001 From: ddunbar Date: Tue, 5 Apr 2011 18:23:18 +0000 Subject: [PATCH] Add a trivial script to extract the times from *.report.txt files. git-svn-id: http://llvm.org/svn/llvm-project/test-suite/trunk@128900 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/get-report-time | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100755 tools/get-report-time diff --git a/tools/get-report-time b/tools/get-report-time new file mode 100755 index 00000000..e1b9618e --- /dev/null +++ b/tools/get-report-time @@ -0,0 +1,27 @@ +#!/usr/bin/env python + +import re +import optparse + +def main(): + parser = optparse.OptionParser("""\ +usage: %prog [options] + +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() -- 2.11.4.GIT