annotate log.d @ 1576:b3e16c86558e

[Issue 1398] New: GDC doesn't generate correct code <mariusmuja@gmail.com> 2007-08-04 http://d.puremagic.com/issues/show_bug.cgi?id=1398
author thomask
date Thu, 21 Feb 2008 15:20:08 +0000
parents f22dcce89882
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
879
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
1 module cn.kuehne.dstress.log;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
2
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
3 private import std.string;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
4 private import std.conv;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
5 private import std.stdio;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
6 private import std.stream;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
7 private import std.file;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
8 private import std.c.stdlib;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
9 private import std.date;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
10
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
11 static char[][] TORTURE_FLAGS = [
1000
ba40405a2a79 fixed regression detection
thomask
parents: 948
diff changeset
12 /* 0 args */
879
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
13 "",
1000
ba40405a2a79 fixed regression detection
thomask
parents: 948
diff changeset
14
ba40405a2a79 fixed regression detection
thomask
parents: 948
diff changeset
15 /* 1 args */
879
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
16 "-g",
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
17 "-inline",
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
18 "-fPIC",
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
19 "-O",
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
20 "-release",
1000
ba40405a2a79 fixed regression detection
thomask
parents: 948
diff changeset
21
ba40405a2a79 fixed regression detection
thomask
parents: 948
diff changeset
22 /* 2 args */
879
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
23 "-g -inline",
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
24 "-g -fPIC",
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
25 "-g -O",
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
26 "-g -release",
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
27 "-inline -fPIC",
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
28 "-inline -O",
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
29 "-inline -release",
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
30 "-fPIC -O",
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
31 "-fPIC -release",
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
32 "-O -release",
1000
ba40405a2a79 fixed regression detection
thomask
parents: 948
diff changeset
33
ba40405a2a79 fixed regression detection
thomask
parents: 948
diff changeset
34 /* 3 args */
879
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
35 "-g -inline -fPIC",
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
36 "-g -inline -O",
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
37 "-g -inline -release",
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
38 "-g -fPIC -O",
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
39 "-g -fPIC -release",
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
40 "-g -O -release",
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
41 "-inline -fPIC -O",
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
42 "-inline -fPIC -release",
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
43 "-inline -O -release",
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
44 "-fPIC -O -release",
1000
ba40405a2a79 fixed regression detection
thomask
parents: 948
diff changeset
45
ba40405a2a79 fixed regression detection
thomask
parents: 948
diff changeset
46 /* 4 args */
879
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
47 "-g -inline -fPIC -O",
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
48 "-g -inline -fPIC -release",
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
49 "-g -fPIC -O -release",
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
50 "-inline -fPIC -O -release",
1000
ba40405a2a79 fixed regression detection
thomask
parents: 948
diff changeset
51
ba40405a2a79 fixed regression detection
thomask
parents: 948
diff changeset
52 /* 5 args */
ba40405a2a79 fixed regression detection
thomask
parents: 948
diff changeset
53 "-g -inline -fPIC -O -release",
ba40405a2a79 fixed regression detection
thomask
parents: 948
diff changeset
54
ba40405a2a79 fixed regression detection
thomask
parents: 948
diff changeset
55 /* 4 args - ommitted */
ba40405a2a79 fixed regression detection
thomask
parents: 948
diff changeset
56 "-g -inline -O -release"
879
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
57 ];
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
58
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
59 enum Result{
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
60 UNTESTED = 0,
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
61 PASS = 1 << 2,
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
62 XFAIL = 2 << 2,
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
63 XPASS = 3 << 2,
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
64 FAIL = 4 << 2,
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
65 ERROR = 5 << 2,
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
66 BASE_MASK = 7 << 2,
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
67
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
68 EXT_MASK = 3,
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
69 BAD_MSG = 1,
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
70 BAD_GDB = 2,
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
71
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
72 MAX = BAD_GDB + BASE_MASK
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
73 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
74
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
75 char[] toString(Result r){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
76 switch(r & Result.BASE_MASK){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
77 case Result.PASS: return "PASS";
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
78 case Result.XPASS: return "XPASS";
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
79 case Result.FAIL: return "FAIL";
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
80 case Result.XFAIL: return "XFAIL";
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
81 case Result.ERROR: return "ERROR";
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
82 case Result.UNTESTED: return "UNTESTED";
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
83 default:
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
84 break;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
85 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
86 throw new Exception(format("unhandled Result value %s", cast(int)r));
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
87 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
88
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
89 char[] dateString(){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
90 static char[] date;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
91 if(date is null){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
92 auto time = getUTCtime();
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
93 auto year = YearFromTime(time);
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
94 auto month = MonthFromTime(time);
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
95 auto day = DateFromTime(time);
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
96 date = format("%d-%02d-%02d", year, month+1, day);
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
97 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
98 return date;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
99 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
100
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
101 char[][] unique(char[][] a){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
102 char[][] b = a.sort;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
103 char[][] back;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
104
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
105 back ~= b[0];
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
106
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
107 size_t ii=0;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
108 for(size_t i=0; i<b.length; i++){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
109 if(back[ii]!=b[i]){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
110 back~=b[i];
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
111 ii++;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
112 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
113 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
114
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
115 return back;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
116 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
117
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
118 private{
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
119 version(Windows){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
120 import std.c.windows.windows;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
121 extern(Windows) BOOL GetFileTime(HANDLE hFile, LPFILETIME lpCreationTime, LPFILETIME lpLastAccessTime, LPFILETIME lpLastWriteTime);
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
122 }else version(linux){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
123 import std.c.linux.linux;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
124 version = Unix;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
125 }else version(Unix){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
126 import std.c.unix.unix;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
127 }else{
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
128 static assert(0);
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
129 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
130
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
131 alias ulong FStime;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
132
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
133 FStime getFStime(char[] fileName){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
134 version(Windows){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
135 HANDLE h;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
136
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
137 if (useWfuncs){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
138 wchar* namez = std.utf.toUTF16z(fileName);
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
139 h = CreateFileW(namez,GENERIC_WRITE,0,null,OPEN_ALWAYS,
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
140 FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN,cast(HANDLE)null);
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
141 }else{
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
142 char* namez = toMBSz(fileName);
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
143 h = CreateFileA(namez,GENERIC_WRITE,0,null,OPEN_ALWAYS,
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
144 FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN,cast(HANDLE)null);
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
145 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
146
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
147 if (h == INVALID_HANDLE_VALUE)
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
148 goto err;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
149
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
150 FILETIME creationTime;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
151 FILETIME accessTime;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
152 FILETIME writeTime;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
153
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
154 BOOL b = GetFileTime(h, &creationTime, &accessTime, &writeTime);
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
155 if(b==1){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
156 long modA = writeTime.dwLowDateTime;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
157 long modB = writeTime.dwHighDateTime;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
158 return modA | (modB << (writeTime.dwHighDateTime.sizeof*8));
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
159 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
160
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
161 err:
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
162 CloseHandle(h);
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
163 throw new Exception("failed to query file modification : "~fileName);
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
164 }else version(Unix){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
165 char* namez = toStringz(fileName);
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
166 struct_stat statbuf;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
167
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
168 if(stat(namez, &statbuf)){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
169 throw new FileException(fileName, getErrno());
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
170 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
171
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
172 return statbuf.st_mtime;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
173 }else{
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
174 static assert(0);
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
175 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
176 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
177 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
178
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
179 char[] cleanFileName(char[] file){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
180 char[] back;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
181 bool hadSep;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
182
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
183 foreach(char c; file){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
184 if(c == '/' || c == '\\'){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
185 if(!hadSep){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
186 back ~= '/';
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
187 hadSep = true;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
188 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
189 }else{
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
190 back ~= c;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
191 hadSep = false;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
192 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
193 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
194
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
195 size_t start = 0;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
196 while(back[start] <= ' ' && start < back.length){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
197 start++;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
198 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
199
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
200 size_t end = back.length-1;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
201 while(back[end] <= ' ' && end >= start){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
202 end--;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
203 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
204
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
205 back = back[start .. end+1];
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
206
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
207 return back;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
208 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
209
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
210 abstract class Test{
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
211 char[] name;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
212 char[] file;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
213
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
214 abstract Result condensed();
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
215
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
216 this(char[] file){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
217 this.file = file;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
218
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
219 int start = rfind(file, "/");
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
220 if(start<0){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
221 start = 0;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
222 }else{
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
223 start += 1;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
224 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
225
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
226 int end = rfind(file, ".");
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
227 if(end < start){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
228 end = file.length;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
229 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
230
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
231 name = file[start .. end];
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
232 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
233 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
234
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
235 class TortureTest : Test{
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
236 Result[] r;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
237
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
238 Result condensed(){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
239 Result back;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
240 foreach(Result res; r){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
241 if(res > back){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
242 back = res;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
243 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
244 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
245
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
246 return back;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
247 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
248
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
249 this(char[] file){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
250 super(file);
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
251 r.length = TORTURE_FLAGS.length;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
252 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
253
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
254 this(char[] file, Result[] result){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
255 if(result.length != TORTURE_FLAGS.length){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
256 throw new Exception(format("expected %s results but got %s (%s)", TORTURE_FLAGS.length, result.length, file));
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
257 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
258
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
259 super(file);
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
260 r = result.dup;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
261 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
262 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
263
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
264 class Log{
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
265 TortureTest[char[]] torture;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
266
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
267 char[] id;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
268
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
269 this(char[] id){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
270 this.id = id;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
271 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
272
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
273 Regression[] findGlobalRegressions(Log[] logs){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
274 Regression[] back;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
275
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
276 if(logs.length < 1){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
277 return back;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
278 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
279
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
280 foreach(TortureTest currentTest; torture.values){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
281 bool hadOldData = false;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
282 Result oldResults[];
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
283 oldResults.length = TORTURE_FLAGS.length;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
284 oldResults[] = Result.MAX;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
285
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
286 foreach(Log l; logs){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
287 TortureTest* test = currentTest.file in l.torture;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
288 if(test !is null){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
289 hadOldData = true;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
290 foreach(size_t i, Result r; test.r){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
291 if(r != Result.UNTESTED && r < oldResults[i]){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
292 oldResults[i] = r;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
293 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
294 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
295 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
296 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
297
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
298 if(hadOldData){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
299 foreach(size_t i, Result r; oldResults){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
300 if((currentTest.r[i] != Result.UNTESTED) && (r != Result.MAX) && (currentTest.r[i] > r)){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
301 back ~= new Regression(currentTest.name, currentTest.file, r, currentTest.r[i], TORTURE_FLAGS[i]);
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
302 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
303 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
304 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
305 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
306 return back;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
307 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
308
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
309 Regression[] findRegressions(Log oldLog){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
310 Regression[] back;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
311
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
312 foreach(TortureTest t; torture.values){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
313 TortureTest* oldT = t.file in oldLog.torture;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
314
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
315 if(oldT !is null){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
316 foreach(size_t i, Result r; t.r){
1000
ba40405a2a79 fixed regression detection
thomask
parents: 948
diff changeset
317 if(oldT.r[i] < r && oldT.r[i]){
879
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
318 back ~= new Regression(t.name, t.file, oldT.r[i], r, TORTURE_FLAGS[i]);
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
319 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
320 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
321 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
322 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
323
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
324 return back;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
325 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
326
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
327 char[][] genUpdateList(char[] testRoot){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
328 char[][] updateList;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
329 const char[][] statusList = ["compile", "nocompile", "run", "norun"];
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
330 char[] status;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
331
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
332 void list(char[] path){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
333 if(isdir(path)){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
334 foreach(char[] entry; listdir(path)){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
335 if(entry.length>0 && entry[0] != '.' && entry[0] != '~'){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
336 list(path~std.path.sep~entry);
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
337 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
338 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
339 }else if(isfile(path)){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
340 char[] file = path[testRoot.length + std.path.sep.length .. $];
882
534a591a0225 fixed report handling of complex test cases
thomask
parents: 879
diff changeset
341 if(!(file in torture)){
879
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
342 char[] output = "dstress torture-" ~ status ~ " " ~ file;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
343 updateList ~= output;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
344 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
345 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
346 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
347
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
348 foreach(char[] s; statusList){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
349 status = s;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
350 list(testRoot ~ std.path.sep ~ s);
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
351 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
352
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
353 return updateList;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
354 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
355
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
356 void dropBogusResults(FStime recordTime, char[] testRoot){
882
534a591a0225 fixed report handling of complex test cases
thomask
parents: 879
diff changeset
357 uint totalCount = torture.length;
879
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
358
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
359 char[][] sourcesTorture = torture.keys;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
360 foreach(char[] source; sourcesTorture){
1000
ba40405a2a79 fixed regression detection
thomask
parents: 948
diff changeset
361 if(find(source, "complex/") < 0){
882
534a591a0225 fixed report handling of complex test cases
thomask
parents: 879
diff changeset
362 try{
534a591a0225 fixed report handling of complex test cases
thomask
parents: 879
diff changeset
363 FStime caseTime = getFStime(testRoot~std.path.sep~source);
534a591a0225 fixed report handling of complex test cases
thomask
parents: 879
diff changeset
364 if(caseTime > recordTime){
534a591a0225 fixed report handling of complex test cases
thomask
parents: 879
diff changeset
365 debug(drop) fwritefln(stderr, "dropped: %s", source);
534a591a0225 fixed report handling of complex test cases
thomask
parents: 879
diff changeset
366 torture.remove(source);
534a591a0225 fixed report handling of complex test cases
thomask
parents: 879
diff changeset
367 }
534a591a0225 fixed report handling of complex test cases
thomask
parents: 879
diff changeset
368 }catch(Exception e){
879
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
369 debug(drop) fwritefln(stderr, "dropped: %s", source);
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
370 torture.remove(source);
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
371 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
372 }
1388
f22dcce89882 removed tracker code
thomask
parents: 1328
diff changeset
373 // asm-filter
f22dcce89882 removed tracker code
thomask
parents: 1328
diff changeset
374 int i = find(source, "asm_p");
f22dcce89882 removed tracker code
thomask
parents: 1328
diff changeset
375 if(i >= 0){
f22dcce89882 removed tracker code
thomask
parents: 1328
diff changeset
376 torture.remove(source);
f22dcce89882 removed tracker code
thomask
parents: 1328
diff changeset
377 }
879
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
378 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
379 torture.rehash;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
380
882
534a591a0225 fixed report handling of complex test cases
thomask
parents: 879
diff changeset
381 writefln("dropped %s outdated tests (%s remaining)", totalCount - torture.length, torture.length);
879
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
382 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
383
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
384
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
385 bool add(char[] line){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
386 const char[] SUB = "Torture-Sub-";
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
387 const char[] TORTURE = "Torture:";
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
388
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
389 line = strip(line);
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
390 int id = -1;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
391 Result r = Result.UNTESTED;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
392
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
393 if(line.length > SUB.length && line[0 .. SUB.length] == SUB){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
394 line = line[SUB.length .. $];
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
395 id = 0;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
396 while(line[id] >= '0' && line[id] <= '9'){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
397 id++;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
398 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
399 int start = id;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
400 id = std.conv.toUint(line[0 .. id]);
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
401
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
402 while(line[start] != '-'){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
403 start++;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
404 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
405 line = line[start+1 .. $];
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
406 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
407
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
408 char[][] token = split(line);
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
409 if(token.length < 2){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
410 return false;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
411 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
412 char[] file = strip(token[1]);
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
413
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
414 switch(token[0]){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
415 case "PASS:":
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
416 r = Result.PASS; break;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
417 case "FAIL:":
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
418 r = Result.FAIL; break;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
419 case "XPASS:":
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
420 r = Result.XPASS; break;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
421 case "XFAIL:":
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
422 r = Result.XFAIL; break;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
423 case "ERROR:":
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
424 r = Result.ERROR; break;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
425 default:{
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
426 if(token[0] == TORTURE){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
427 throw new Exception("not yet handled: "~line);
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
428 }else if(id > -1){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
429 throw new Exception(format("bug in SUB line: (%s) %s", id, line));
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
430 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
431 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
432 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
433
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
434 if(r != Result.UNTESTED){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
435 if(std.string.find(line, "bad error message") > -1){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
436 r |= Result.BAD_MSG;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
437 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
438 if(std.string.find(line, "bad debugger message") > -1){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
439 r |= Result.BAD_MSG;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
440 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
441
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
442 file = cleanFileName(file);
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
443
882
534a591a0225 fixed report handling of complex test cases
thomask
parents: 879
diff changeset
444 if(id >= 0){
879
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
445 // update sub
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
446 id--;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
447
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
448 TortureTest* test = file in torture;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
449
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
450 if(test is null){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
451 TortureTest t = new TortureTest(file);
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
452 torture[file] = t;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
453 t.r[id] = r;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
454 }else{
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
455 if(test.r[id] != Result.UNTESTED){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
456 test.r[] = Result.UNTESTED;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
457 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
458 test.r[id] = r;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
459 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
460 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
461 return true;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
462 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
463 return false;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
464 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
465 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
466
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
467 class Regression{
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
468 Result before;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
469 Result after;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
470 char[] file;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
471 char[] name;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
472 char[] extInfo;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
473
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
474 this(char[] name, char[] file, Result oldR, Result newR, char[] addonInfo=null){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
475 this.file = file;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
476 this.name = name;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
477 before = oldR;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
478 after = newR;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
479 extInfo = addonInfo;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
480 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
481
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
482 char[] toString(){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
483 char[] back = .toString(before) ~" -> "~.toString(after)~": "~file;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
484 if(extInfo.length > 0){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
485 back ~= " ("~extInfo~")";
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
486 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
487 return back;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
488 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
489 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
490
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
491 class Report{
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
492 char[] root;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
493 Log[] log;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
494 static const char[] header =
1001
eb5364abce0c HTML cleanup
thomask
parents: 1000
diff changeset
495 "<th>&#160;</th><th>-g</th><th>-inline</th>"
879
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
496 "<th>-fPIC</th><th>-O</th><th>-release</th>"
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
497 "<th>-g -inline</th><th>-g -fPIC</th><th>-g -O</th>"
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
498 "<th>-g -release</th><th>-inline -fPIC</th>"
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
499 "<th>-inline -O</th><th>-inline -release</th>"
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
500 "<th>-fPIC -O</th><th>-fPIC -release</th>"
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
501 "<th>-O -release</th><th>-g -inline -fPIC</th>"
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
502 "<th>-g -inline -O</th><th>-g -inline -release</th>"
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
503 "<th>-g -fPIC -O</th><th>-g -fPIC -release</th>"
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
504 "<th>-g -O -release</th><th>-inline -fPIC -O</th>"
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
505 "<th>-inline -fPIC -release</th><th>-inline -O -release</th>"
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
506 "<th>-fPIC -O -release</th><th>-g -inline -fPIC -O</th>"
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
507 "<th>-g -inline -fPIC -release</th>"
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
508 "<th>-g -fPIC -O -release</th>"
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
509 "<th>-inline -fPIC -O -release</th>"
1000
ba40405a2a79 fixed regression detection
thomask
parents: 948
diff changeset
510 "<th>-g -inline -fPIC -O -release</th>"
ba40405a2a79 fixed regression detection
thomask
parents: 948
diff changeset
511 "<th>-g -inline -O -release</th>";
879
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
512
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
513 this(char[] root, Log[] log){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
514 this.root = root;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
515 this.log = log;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
516 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
517
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
518 void toHtml(OutputStream summary, OutputStream[] cases, bool[] hotspot){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
519
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
520 if(cases.length != log.length || cases.length != hotspot.length){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
521 throw new Exception("unexpected argument length");
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
522 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
523 foreach(size_t i, Log l; log){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
524 toHtml(l, cases[i]);
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
525 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
526 toHtmlSummary(summary, hotspot);
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
527 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
528
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
529 static char[] cleanFileName(char[] name){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
530 int i = rfind(name, "_");
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
531 if(i > -1){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
532 name = name[i+1 .. $];
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
533 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
534 i = rfind(name, ".");
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
535 if(i > -1){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
536 name = name[0 .. i];
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
537 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
538 return name;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
539 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
540
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
541 static char[] streamLine(uint[] stats){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
542 char[] buffer;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
543 foreach(uint i; stats){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
544 buffer ~= "<td>"~std.string.toString(i)~"</td>";
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
545 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
546 return buffer;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
547 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
548
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
549 static void toHtml(Log log, OutputStream stream){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
550 char[] cleanName = cleanFileName(log.id);
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
551 { // header
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
552 char[] name = toupper(cleanName);
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
553
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
554 stream.writeLine("<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>");
1042
f34b7d4a2db7 added DMD-0.160 results
thomask
parents: 1030
diff changeset
555 stream.writeLine("<html xmlns='http://www.w3.org/1999/xhtml' lang='en' xml:lang='en'>");
879
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
556
1207
244ab84fc063 added shortcut icon
thomask
parents: 1042
diff changeset
557 stream.writeLine("<head><title>DStress - Torture: "~name~"</title><link rel='stylesheet' type='text/css' href='formate.css' /><meta name='author' content='Thomas K&#252;hne' /><meta name='date' content='" ~ dateString() ~ "' /><link rel='shortcut icon' href='data:image/gif;base64,R0lGODlhEAAQAKEAALMfEuWoLv///7MfEiH5BAEKAAMALAAAAAAQABAAAAIpnI95wN06nARqyvSQM6Gz+g3dOGofiabqygYmNYbv/FKLld04aEG+UgAAOw==' type='image/gif' /></head>");
1388
f22dcce89882 removed tracker code
thomask
parents: 1328
diff changeset
558 stream.writeLine("<body><center><h1>DStress - Torture: "~name~"</h1></center><center><small>by Thomas K&#252;hne &lt;<a href='mailto:thomas@kuehne.cn'>thomas@kuehne.cn</a>&gt;</small></center>");
879
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
559 stream.writeLine("<h2><a name='note' id='note'></a>Note</h2><blockquote>A detailed description of the testing and the used symbols can be found on the <a href='./dstress.html'>main page</a>.</blockquote>");
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
560 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
561
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
562 { // stats
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
563 stream.writeLine("<h2><a name='summary' id='summary'></a>Summary</h2>");
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
564 uint[][] stats;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
565 stats.length = 6;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
566 foreach(inout uint[] array; stats){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
567 array.length = TORTURE_FLAGS.length;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
568 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
569
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
570 foreach(TortureTest t; log.torture){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
571 foreach(int i, Result r; t.r){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
572 stats[r >> 2][i]++;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
573 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
574 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
575
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
576
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
577 { // total
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
578 uint total = 0;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
579
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
580 foreach(uint[] cases; stats){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
581 total += cases[0];
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
582 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
583
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
584 uint config = 0;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
585 foreach(uint[] a; stats[1 .. $]){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
586 foreach(uint b; a){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
587 config += b;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
588 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
589 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
590
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
591 stream.writeLine(format("<blockquote><dl><dt><strong>test cases:</strong></dt><dd>%d</dd><dt><strong>tested configurations:</strong></dt><dd>%d</dd></dl></blockquote>", total, config));
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
592 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
593
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
594
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
595 stream.writeLine("<table border='1' summary='nummeric summary of the test results'>");
1001
eb5364abce0c HTML cleanup
thomask
parents: 1000
diff changeset
596 stream.writeLine("\t<tr><td>&#160;</td>"~header~"</tr>");
879
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
597 stream.writeLine("\t<tr class='" ~ cast(char)('A'+Result.PASS)~"'><th>PASS</th>" ~ streamLine(stats[Result.PASS >> 2])~"</tr>");
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
598 stream.writeLine("\t<tr class='" ~ cast(char)('A'+Result.XFAIL)~"'><th>XFAIL</th>" ~ streamLine(stats[Result.XFAIL >> 2])~"</tr>");
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
599 stream.writeLine("\t<tr class='" ~ cast(char)('A'+Result.XPASS)~"'><th>XPASS</th>" ~ streamLine(stats[Result.XPASS >> 2])~"</tr>");
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
600 stream.writeLine("\t<tr class='" ~ cast(char)('A'+Result.FAIL)~"'><th>FAIL</th>" ~ streamLine(stats[Result.FAIL >> 2])~"</tr>");
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
601 stream.writeLine("\t<tr class='" ~ cast(char)('A'+Result.ERROR)~"'><th>ERROR</th>" ~ streamLine(stats[Result.ERROR >> 2])~"</tr>");
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
602 stream.writeLine("\t<tr class='" ~ cast(char)('A'+Result.UNTESTED)~"'><th>untested</th>" ~ streamLine(stats[Result.UNTESTED >> 2])~"</tr>");
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
603 stream.writeLine("</table>");
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
604 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
605
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
606 { // details
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
607 stream.writeLine("<h2><a name='details' id='details'></a>Details</h2>");
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
608 stream.writeLine("<table border='1' summary='detailed listing of all test cases with unexpected results'>");
1001
eb5364abce0c HTML cleanup
thomask
parents: 1000
diff changeset
609 stream.writeLine("<tr><td>&#160;</td>"~header~"</tr>");
879
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
610
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
611 char[][] keys;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
612 {
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
613 char[][char[]] k;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
614 foreach(char[] org; log.torture.keys){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
615 char[] z = org;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
616 int i = rfind(z, "/");
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
617 if(i > -1){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
618 z = z[i+1 .. $];
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
619 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
620 i = rfind(z, ".");
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
621 if(i > -1){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
622 z = z[0 .. i];
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
623 }
1000
ba40405a2a79 fixed regression detection
thomask
parents: 948
diff changeset
624 if(z in k && find(org, "complex") < 0){
879
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
625 throw new Exception("dublicate key "~org);
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
626 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
627 k[z] = org;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
628 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
629
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
630 foreach(char[] x; k.keys.sort){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
631 keys ~= k[x];
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
632 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
633
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
634 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
635 foreach(char[] key; keys){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
636 TortureTest t = log.torture[key];
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
637 Result plainR = t.condensed();
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
638
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
639 if(plainR == Result.PASS
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
640 || plainR == Result.XFAIL
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
641 || plainR == Result.UNTESTED)
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
642 {
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
643 continue;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
644 }else{
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
645 char[] name = replace(t.name, "_", " ");
882
534a591a0225 fixed report handling of complex test cases
thomask
parents: 879
diff changeset
646 char[] src = t.file;
1000
ba40405a2a79 fixed regression detection
thomask
parents: 948
diff changeset
647 if(find(src,"complex/") != -1){
882
534a591a0225 fixed report handling of complex test cases
thomask
parents: 879
diff changeset
648 src = src[0 .. rfind(src, "/")];
534a591a0225 fixed report handling of complex test cases
thomask
parents: 879
diff changeset
649 }
534a591a0225 fixed report handling of complex test cases
thomask
parents: 879
diff changeset
650 char[] back = "<tr><th><a href=\"../"~src~"\" id='"~t.name~"'>"~name~"</a></th>";
879
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
651 foreach(Result r; t.r){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
652 back ~= "<td class='" ~ cast(char)(r+'A') ~ "'>";
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
653 if(r == Result.UNTESTED){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
654 back ~= "-";
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
655 }else{
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
656 try{
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
657 back ~= .toString(r & Result.BASE_MASK);
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
658 }catch(Exception e){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
659 throw new Exception(t.toString()~" ["~e.toString()~"]");
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
660 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
661 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
662 back ~= "</td>";
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
663 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
664 stream.writeLine(back ~ "</tr>");
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
665 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
666 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
667
1001
eb5364abce0c HTML cleanup
thomask
parents: 1000
diff changeset
668 stream.writeLine("<tr><td>&#160;</td>"~header~"</tr>");
879
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
669 stream.writeLine("</table>");
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
670 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
671
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
672 { // footer
1001
eb5364abce0c HTML cleanup
thomask
parents: 1000
diff changeset
673 stream.writeLine("<div><br /><br /><hr /><a href='http://dstress.kuehne.cn/www/"~cleanName~".html'>http://dstress.kuehne.cn/www/"~cleanName~".html</a>&#160; &#160;" ~ dateString() ~ "</div>");
1388
f22dcce89882 removed tracker code
thomask
parents: 1328
diff changeset
674 stream.writeLine("<center><a href='http://developer.berlios.de'><img src='http://developer.berlios.de/bslogo.php?group_id=2732' width='124' height='32' border='0' alt='BerliOS Logo' /></a></center>");
879
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
675
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
676 stream.writeLine("</body></html>");
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
677 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
678 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
679
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
680 void toHtmlSummary(OutputStream stream, bool[] hotspot){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
681 if(hotspot.length != log.length){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
682 throw new Exception("illegal hotspot length");
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
683 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
684
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
685 char[][] names;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
686
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
687 foreach(Log l; log){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
688 names ~= l.torture.keys;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
689 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
690
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
691 uint[][] stats;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
692 stats.length = 6;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
693 foreach(inout uint[] array; stats){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
694 array.length = log.length;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
695 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
696
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
697
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
698 char[][char[]] keys;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
699 {
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
700 foreach(char[] org; unique(names)){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
701 char[] z = org;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
702 int i = rfind(z, "/");
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
703 if(i > -1){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
704 z = z[i+1 .. $];
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
705 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
706 i = rfind(z, ".");
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
707 if(i > -1){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
708 z = z[0 .. i];
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
709 }
948
a3716859972b minor infra. review
thomask
parents: 882
diff changeset
710 if(z in keys && -1 == find(org, "complex/")){
879
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
711 throw new Exception("dublicate key "~org);
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
712 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
713 keys[z] = org;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
714 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
715
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
716 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
717
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
718 { // total
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
719 uint total = keys.keys.length;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
720 for(size_t i = 0; i < stats[0].length; i++){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
721 stats[0][i] = total;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
722 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
723 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
724
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
725 char[][] badLines;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
726 foreach(char[] name; keys.keys.sort){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
727 char[] file = keys[name];
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
728 Result[] result = new Result[log.length];
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
729 bool isBadLine;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
730 foreach(size_t i, Log l; log){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
731 auto t = file in l.torture;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
732
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
733 if(t){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
734 Result r = t.condensed();
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
735 result[i] = r;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
736
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
737 if(r != Result.UNTESTED){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
738 stats[result[i] >> 2][i]++;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
739 stats[0][i]--;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
740 if(hotspot[i] && r>= Result.XPASS){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
741 isBadLine = true;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
742 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
743 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
744 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
745
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
746 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
747
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
748 if(isBadLine){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
749 char[] cleanName = replace(name, "_", " ");
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
750 char[] back = "<tr><th><a href=\"../"~file~"\" id='"~name~"'>"~cleanName~"</a></th>";
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
751 foreach(Result r; result){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
752 back ~= "<td class='" ~ cast(char)(r+'A') ~ "'>";
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
753 if(r == Result.UNTESTED){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
754 back ~= "-";
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
755 }else{
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
756 try{
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
757 back ~= .toString(r & Result.BASE_MASK);
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
758 }catch(Exception e){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
759 throw new Exception("name:" ~name~" ["~e.toString()~"]");
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
760 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
761 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
762 back ~= "</td>";
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
763 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
764 badLines ~= back ~ "</tr>";
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
765 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
766 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
767
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
768
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
769 // output
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
770 stream.writeLine("<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>");
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
771 stream.writeLine("<html xmlns='http://www.w3.org/1999/xhtml'>");
1001
eb5364abce0c HTML cleanup
thomask
parents: 1000
diff changeset
772 stream.writeLine("<head><title>DStress Report</title><link rel='stylesheet' type='text/css' href='formate.css' /><meta name='author' content='Thomas K&#252;hne' /><meta name='date' content='"~dateString()~"' /></head>");
879
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
773 stream.writeLine("<body><center><h1>DStress Report</h1></center>");
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
774 stream.writeLine("<h2><a name='note' id='note'></a>Note</h2>");
1030
6c80930a0050 added DMD-0.158 results
thomask
parents: 1001
diff changeset
775 stream.writeLine("<blockquote><p>A detailed description of the testing and the used symbols can be found on the <a href='./dstress.html'>main page</a>.</p></blockquote>");
879
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
776 stream.writeLine("<h2><a name='summary' id='summary'></a>Summary</h2>");
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
777
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
778 stream.writeLine("<table border='1' summary='nummeric summary of the test results'>");
1001
eb5364abce0c HTML cleanup
thomask
parents: 1000
diff changeset
779 char[] versionHeader = "<tr><td>&#160;</td>";
879
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
780 { // version header
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
781 foreach(Log l; log){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
782 char[] name = l.id;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
783 int i = rfind(name, "/");
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
784 if(i > -1){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
785 name = name[i+1 .. $];
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
786 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
787 i = rfind(name, ".log");
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
788 if(i + ".log".length == name.length){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
789 name = name[0 .. i];
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
790 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
791 versionHeader ~= "<th><a href='./" ~ cleanFileName(l.id) ~ ".html'>"~replace(name, "_", " ")~"</a></th>";
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
792 }
1030
6c80930a0050 added DMD-0.158 results
thomask
parents: 1001
diff changeset
793 versionHeader ~= "</tr>";
879
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
794 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
795
1042
f34b7d4a2db7 added DMD-0.160 results
thomask
parents: 1030
diff changeset
796 stream.writeLine("\t<tr><td>&#160;</td>"
f34b7d4a2db7 added DMD-0.160 results
thomask
parents: 1030
diff changeset
797 "<th class='" ~ cast(char)('A'+Result.PASS)~"'>PASS</th>"
f34b7d4a2db7 added DMD-0.160 results
thomask
parents: 1030
diff changeset
798 "<th class='" ~ cast(char)('A'+Result.XFAIL)~"'>XFAIL</th>"
f34b7d4a2db7 added DMD-0.160 results
thomask
parents: 1030
diff changeset
799 "<th class='" ~ cast(char)('A'+Result.XPASS)~"'>XPASS</th>"
f34b7d4a2db7 added DMD-0.160 results
thomask
parents: 1030
diff changeset
800 "<th class='" ~ cast(char)('A'+Result.FAIL)~"'>FAIL</th>"
f34b7d4a2db7 added DMD-0.160 results
thomask
parents: 1030
diff changeset
801 "<th class='" ~ cast(char)('A'+Result.ERROR)~"'>ERROR</th>"
f34b7d4a2db7 added DMD-0.160 results
thomask
parents: 1030
diff changeset
802 "<th class='" ~ cast(char)('A'+Result.UNTESTED)~"'>UNTESTED</th></tr>");
f34b7d4a2db7 added DMD-0.160 results
thomask
parents: 1030
diff changeset
803 foreach(size_t j, Log l; log){
f34b7d4a2db7 added DMD-0.160 results
thomask
parents: 1030
diff changeset
804 char[] row ="\t<tr>";
f34b7d4a2db7 added DMD-0.160 results
thomask
parents: 1030
diff changeset
805 char[] name = l.id;
f34b7d4a2db7 added DMD-0.160 results
thomask
parents: 1030
diff changeset
806 int i = rfind(name, "/");
f34b7d4a2db7 added DMD-0.160 results
thomask
parents: 1030
diff changeset
807 if(i > -1){
f34b7d4a2db7 added DMD-0.160 results
thomask
parents: 1030
diff changeset
808 name = name[i+1 .. $];
f34b7d4a2db7 added DMD-0.160 results
thomask
parents: 1030
diff changeset
809 }
f34b7d4a2db7 added DMD-0.160 results
thomask
parents: 1030
diff changeset
810 i = rfind(name, ".log");
f34b7d4a2db7 added DMD-0.160 results
thomask
parents: 1030
diff changeset
811 if(i + ".log".length == name.length){
f34b7d4a2db7 added DMD-0.160 results
thomask
parents: 1030
diff changeset
812 name = name[0 .. i];
f34b7d4a2db7 added DMD-0.160 results
thomask
parents: 1030
diff changeset
813 }
f34b7d4a2db7 added DMD-0.160 results
thomask
parents: 1030
diff changeset
814 row ~= "<th><a href='./" ~ cleanFileName(l.id) ~ ".html'>"~replace(name, "_", " ")~"</a></th>";
f34b7d4a2db7 added DMD-0.160 results
thomask
parents: 1030
diff changeset
815 row ~= "<td class='" ~ cast(char)('A'+Result.PASS)~"'>" ~ std.string.toString(stats[Result.PASS >> 2][j]) ~"</td>";
f34b7d4a2db7 added DMD-0.160 results
thomask
parents: 1030
diff changeset
816 row ~= "<td class='" ~ cast(char)('A'+Result.XFAIL)~"'>" ~ std.string.toString(stats[Result.XFAIL >> 2][j]) ~"</td>";
f34b7d4a2db7 added DMD-0.160 results
thomask
parents: 1030
diff changeset
817 row ~= "<td class='" ~ cast(char)('A'+Result.XPASS)~"'>" ~ std.string.toString(stats[Result.XPASS >> 2][j]) ~"</td>";
f34b7d4a2db7 added DMD-0.160 results
thomask
parents: 1030
diff changeset
818 row ~= "<td class='" ~ cast(char)('A'+Result.FAIL)~"'>" ~ std.string.toString(stats[Result.FAIL >> 2][j]) ~"</td>";
f34b7d4a2db7 added DMD-0.160 results
thomask
parents: 1030
diff changeset
819 row ~= "<td class='" ~ cast(char)('A'+Result.ERROR)~"'>" ~ std.string.toString(stats[Result.ERROR >> 2][j]) ~"</td>";
f34b7d4a2db7 added DMD-0.160 results
thomask
parents: 1030
diff changeset
820 row ~= "<td class='" ~ cast(char)('A'+Result.UNTESTED)~"'>" ~ std.string.toString(stats[Result.UNTESTED >> 2][j]) ~"</td>";
f34b7d4a2db7 added DMD-0.160 results
thomask
parents: 1030
diff changeset
821 stream.writeLine(row ~ "</tr>");
f34b7d4a2db7 added DMD-0.160 results
thomask
parents: 1030
diff changeset
822 }
879
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
823 stream.writeLine("</table>");
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
824
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
825 stream.writeLine("<h2><a name='details' id='details'></a>Details</h2>");
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
826 stream.writeLine("<table border='1'>");
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
827 stream.writeLine(versionHeader);
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
828 foreach(char[] line; badLines){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
829 stream.writeLine(line);
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
830 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
831 stream.writeLine(versionHeader);
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
832 stream.writeLine("</table>");
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
833
1001
eb5364abce0c HTML cleanup
thomask
parents: 1000
diff changeset
834 stream.writeLine("<div><br /><br /><hr /><a href='http://dstress.kuehne.cn/www/results.html'>http://dstress.kuehne.cn/www/results.html</a>&#160; &#160;"~dateString()~"</div>");
879
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
835
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
836 stream.writeLine("<!-- Start of StatCounter Code -->");
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
837 stream.writeLine("<script type='text/javascript'><!-- var sc_project=1337754; var sc_invisible=1; var sc_partition=12; var sc_security=\"a4a998fe\"; var sc_remove_link=1; //--> </script>");
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
838 stream.writeLine("<script type='text/javascript' src='http://www.statcounter.com/counter/counter_xhtml.js'></script><noscript><div class='statcounter'><img src='http://c13.statcounter.com/counter.php?sc_project=1337754&amp;amp;java=0&amp;amp;security=a4a998fe&amp;amp;invisible=1' class='statcounter' alt='counter' /></div></noscript>");
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
839 stream.writeLine("<!-- End of StatCounter Code -->");
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
840
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
841 stream.writeLine("</body></html>");
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
842 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
843 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
844
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
845 int main(char[][] args){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
846
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
847 if(args.length < 4){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
848 fwritefln(stderr, "%s <command> <root> <log.1> [<log.2> ...]", args[0]);
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
849 fwritefln(stderr, "known commands: genUpdateList findRegressions genReport");
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
850 return 1;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
851 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
852
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
853
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
854 char[] command = args[1];
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
855 char[] root = args[2];
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
856 if(root.length < 1){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
857 root = ".";
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
858 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
859 debug fwritefln(stderr, "command: %s", command);
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
860 debug fwritefln(stderr, "root: %s", root);
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
861
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
862 Report report = new Report(root, null);
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
863 bool[] hotspot;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
864
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
865 switch(command){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
866 case "genUpdateList", "findRegressions", "genReport": break;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
867 default:{
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
868 fwritefln(stderr, "unknown command: %s", command);
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
869 return -1;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
870 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
871 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
872
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
873 foreach(size_t id, char[] file; args[3 .. $]){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
874 if(file.length > "--".length && file[0 .. 2] == "--"){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
875 file = file[2..$];
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
876 hotspot ~= true;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
877 }else{
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
878 hotspot ~= false;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
879 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
880
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
881 writefln("parsing: %s", file);
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
882 FStime logTime = getFStime(file);
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
883 debug fwritefln(stderr, "sourceTime: %s", logTime);
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
884
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
885 Log l= new Log(file);
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
886 Stream source = new BufferedFile(file, FileMode.In);
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
887 while(!source.eof()){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
888 l.add(source.readLine());
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
889 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
890
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
891 l.dropBogusResults(logTime, root);
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
892
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
893 report.log ~= l;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
894 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
895
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
896 switch(command){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
897 case "genUpdateList":{
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
898 foreach(Log l; report.log){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
899 char[][] update = l.genUpdateList(root);
882
534a591a0225 fixed report handling of complex test cases
thomask
parents: 879
diff changeset
900 writefln("%s updates required (%s still up to date)", update.length, l.torture.length);
879
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
901
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
902 char[] updateFile = l.id ~ ".update";
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
903 try{std.file.remove(updateFile);}catch{}
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
904
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
905 if(update.length){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
906 File f = new File(updateFile, FileMode.OutNew);
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
907 foreach(char[] line; update){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
908 f.writeLine(line);
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
909 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
910 f.close();
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
911 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
912 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
913 break;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
914 }case "findRegressions":{
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
915 foreach(size_t i, Log newLog; report.log[1..$]){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
916 Regression[] newReg = newLog.findRegressions(report.log[i]);
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
917 writefln("identified %s new regressions for %s", newReg.length, newLog.id);
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
918
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
919 Regression[] oldReg;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
920 {
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
921 Regression[] oldRegT = newLog.findGlobalRegressions(report.log[0 .. i]);
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
922 foreach(Regression a; oldRegT){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
923 foreach(Regression b; newReg){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
924 if(a.file == b.file && (!a.extInfo || a.extInfo == b.extInfo)){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
925 goto handled;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
926 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
927 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
928
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
929 oldReg ~= a;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
930 handled: {}
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
931 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
932 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
933
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
934 writefln("identified %s old regressions for %s", oldReg.length, newLog.id);
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
935
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
936 char[] regressionFile = newLog.id ~ ".regression";
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
937 try{std.file.remove(regressionFile);}catch{}
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
938
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
939 if(newReg.length + oldReg.length){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
940 File f = new File(regressionFile, FileMode.OutNew);
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
941
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
942 if(newReg.length){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
943 f.writeLine(format("%s new regressions", newReg.length));
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
944 foreach(Regression r; newReg){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
945 f.writeLine(r.toString());
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
946 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
947 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
948
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
949 if(oldReg.length){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
950 if(newReg.length){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
951 f.writeLine("");
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
952 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
953 f.writeLine(format("%s old regressions", oldReg.length));
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
954 foreach(Regression r; oldReg){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
955 f.writeLine(r.toString());
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
956 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
957 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
958
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
959 f.close();
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
960 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
961 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
962 break;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
963 }case "genReport":{
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
964 OutputStream[] html;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
965 OutputStream o = new File("./www/results.html", FileMode.OutNew);
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
966 foreach(Log l; report.log){
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
967 html ~= new File("./www/"~Report.cleanFileName(l.id)~".html", FileMode.OutNew);
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
968 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
969
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
970 report.toHtml(o, html, hotspot);
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
971
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
972 o.close();
1207
244ab84fc063 added shortcut icon
thomask
parents: 1042
diff changeset
973 foreach(OutputStream stream; html){
244ab84fc063 added shortcut icon
thomask
parents: 1042
diff changeset
974 stream.close();
879
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
975 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
976
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
977 break;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
978 }default:{
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
979 fwritefln(stderr, "unknown command: %s", command);
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
980 return -1;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
981 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
982 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
983
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
984 return 0;
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
985 }
cf77fcf67454 added log.d (mail:Pine.LNX.4.64.0603012315520.30259@bellevue.puremagic.com)
thomask
parents:
diff changeset
986