Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / contrib / regression / GCC_Regression_Tester.wdgt / widget.html
blobb9fecc280b5103d258e7770ad05fbfc6d2ff1465
1 <!-- Get and update the GCC regression tester's web page.
2 Copyright (C) 2005 Free Software Foundation, Inc.
4 This file is part of GCC.
6 GCC is free software; you can redistribute it and/or modify it under
7 the terms of the GNU General Public License as published by the Free
8 Software Foundation; either version 2, or (at your option) any later
9 version.
11 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 for more details.
16 You should have received a copy of the GNU General Public License
17 along with GCC; see the file COPYING. If not, write to the Free
18 Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
19 02110-1301, USA. -->
20 <?xml version="1.0" encoding="UTF-8"?>
21 <!DOCTYPE html
22 PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
23 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
24 <html xmlns="http://www.w3.org/1999/xhtml">
25 <META http-equiv="Content-Script-Type" content="text/javascript">
27 <head>
28 <script type='text/javascript'>
29 // A string representing NUM, with a leading zero if it would be 1 digit long
30 function dig2 (num)
32 var result = num.toString();
33 if (result.length == 1)
34 return '0' + result;
35 else
36 return result;
39 // Get DATE as a string in standard ISO format in UTC
40 function getISO (date)
42 return (date.getUTCFullYear().toString() + '-'
43 + dig2 (date.getUTCMonth() + 1) + '-'
44 + dig2 (date.getUTCDate()) + 'T'
45 + dig2 (date.getUTCHours()) + ':'
46 + dig2 (date.getUTCMinutes()) + 'Z');
49 // STR is a bunch of lines of the form '<key>: <date>' where <date> is in
50 // standard ISO UTC format. Return a Date object corresponding to KEY, or null
51 // if none is found.
52 function fromISO (str, key)
54 var rx = new RegExp (key + ": (\\d+)-(\\d+)-(\\d+)T(\\d+):(\\d+):(\\d+)Z");
55 var match = rx.exec (str);
56 if (match == null || match.length != 7)
57 return null;
58 var date = new Date(0);
59 date.setUTCFullYear (match[1], match[2] - 1, match[3]);
60 date.setUTCHours (match[4], match[5], match[6], 0);
61 return date;
64 // Update the data
65 function updateContents () {
66 var url = 'http://gcc.gnu.org/regtest/HEAD/status.txt';
67 var xml_request = new XMLHttpRequest();
69 xml_request.onload = function(e)
71 gotContents(e, xml_request);
73 xml_request.open("GET", url);
74 xml_request.setRequestHeader("Cache-Control", "max-age=30");
75 xml_request.send(null);
78 function gotContents (event, request) {
79 if (request.status != 200)
80 return;
82 if (! request.responseText)
83 return;
85 var txt = (request.responseText
86 .replace (/&/g,"&amp;")
87 .replace (/</g,"&lt;")
88 .replace (/&quot;/g,"&quot;")
89 .replace (/>;/g,"&gt;"));
91 var today = new Date();
92 var date_r = fromISO (txt, "Date");
93 var completed_r = fromISO (txt, "Test-Completed");
94 var now_test_r = fromISO (txt, "Now-Testing");
95 var eta = "";
97 if (date_r != null && completed_r != null && now_test_r != null)
99 var eta_r = new Date (now_test_r.getTime()
100 + completed_r.getTime() - date_r.getTime());
101 eta = "ETA: " + getISO (eta_r) + '\n';
104 var val = txt + "Now: " + getISO (today) + '\n' + eta;
105 document.getElementById ("contents").innerHTML = "<pre>"+val+"<\/pre>";
108 var mainTimer = null;
110 function myOnShow ()
112 if (! mainTimer) {
113 mainTimer = setInterval (updateContents, 60000);
115 updateContents();
118 function myOnHide ()
120 if (mainTimer) {
121 clearInterval (mainTimer);
122 mainTimer = null;
126 function myOnLoad ()
128 if ( window.widget ) {
129 widget.onshow = myOnShow;
130 widget.onhide = myOnHide;
132 myOnShow();
134 </script>
135 <style>
136 body {
137 margin: 0px;
138 padding: 0px;
140 pre {
141 font-family: Monaco;
142 font-size: 9px;
143 margin: 0px;
144 padding: 1px 2px 1px 2px;
145 color: black;
146 background-color: white;
147 opacity: 0.8;
149 </style>
150 </head>
152 <body onLoad='myOnLoad();'>
153 <div id="contents">Loading...</div>
154 </body>
155 </html>