blob: 95afca73a1322dfda1ce5add735784ce145028fd [file] [log] [blame]
Andrew Lenharth4430e3a2005-04-27 02:13:20 +00001#!/usr/bin/perl
2# a first attempt to parse the nightly tester pages into something
3# one can reason about, namely import into a database
4# USE: perl parseNLT.pl <2005-03-31.html
5# for example
6
7while(<>)
8 {
9 if (/LLVM Test Results for (\w+) (\d+), (\d+)</)
10 {
11 $mon = $1;
12 $day = $2;
13 $year = $3;
14 }
15 if (/<td>([^<]+)<\/td>/)
16 {
17 if ($prefix)
Andrew Lenharth6e927292005-04-27 14:57:26 +000018 { $output .= "$1 "; $count++; }
Andrew Lenharth4430e3a2005-04-27 02:13:20 +000019 }
20 if (/<tr/)
21 {
Andrew Lenharth6e927292005-04-27 14:57:26 +000022 if ($output and $count > 3)
23 { print "\n$day $mon $year $prefix/$output"; }
24 $output = "";
25 $count = 0;
Andrew Lenharth4430e3a2005-04-27 02:13:20 +000026 }
27 if (/<h2>(Programs.+)<\/h2>/)
28 {
29 $prefix = $1;
30 }
31 }
32
33if ($output)
34 { print "\n$day $mon $year $prefix/$output"; $output = ""; }