]> granicus.if.org Git - clang/blob - www/make_cxx_dr_status
Tests and status for core issues 1-50.
[clang] / www / make_cxx_dr_status
1 #! /usr/bin/env python
2 import sys, os, re
3
4 index = 'cwg_index.html'
5 output = 'cxx_dr_status.html'
6 dr_test_dir = '../test/CXX/drs'
7
8 if len(sys.argv) == 1:
9   pass
10 elif len(sys.argv) == 2:
11   index = sys.argv[1]
12 else:
13   print >>sys.stderr, 'Usage: make_drs [<path to cwg_index.html>]'
14   sys.exit(1)
15
16 class DR:
17   def __init__(self, section, issue, url, status, title):
18     self.section, self.issue, self.url, self.status, self.title = \
19         section, issue, url, status, title
20   def __repr__(self):
21     return '%s (%s): %s' % (self.issue, self.status, self.title)
22
23 def parse(dr):
24   section, issue_link, status, title = [
25       col.split('>', 1)[1].split('</TD>')[0]
26       for col in dr.split('</TR>', 1)[0].split('<TD')[1:]
27   ]
28   _, url, issue = issue_link.split('"', 2)
29   url = url.strip()
30   issue = int(issue.split('>', 1)[1].split('<', 1)[0])
31   title = title.replace('<issue_title>', '').replace('</issue_title>', '').strip()
32   return DR(section, issue, url, status, title)
33
34 status_re = re.compile(r'\bdr([0-9]+): (.*)')
35 status_map = {}
36 for test_cpp in os.listdir(dr_test_dir):
37   test_cpp = os.path.join(dr_test_dir, test_cpp)
38   found_any = False;
39   for match in re.finditer(status_re, file(test_cpp, 'r').read()):
40     status_map[int(match.group(1))] = match.group(2)
41     found_any = True
42   if not found_any:
43     print >> sys.stderr, "warning:%s: no '// dr123: foo' comments in this file" % test_cpp
44
45 drs = sorted((parse(dr) for dr in file(index, 'r').read().split('<TR>')[2:]),
46              key = lambda dr: dr.issue)
47 out_file = file(output, 'w')
48
49 print >> out_file, '''\
50 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
51           "http://www.w3.org/TR/html4/strict.dtd">
52 <html>
53 <head>
54   <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
55   <title>Clang - C++ Defect Report Status</title>
56   <link type="text/css" rel="stylesheet" href="menu.css">
57   <link type="text/css" rel="stylesheet" href="content.css">
58   <style type="text/css">
59     .none { background-color: #FFCCCC }
60     .partial { background-color: #FFE0B0 }
61     .svn  { background-color: #FFFF99 }
62     .full { background-color: #CCFF99 }
63     .na { background-color: #DDDDDD }
64     .open * { color: #AAAAAA }
65     //.open { filter: opacity(0.2) }
66     span:target { background-color: #FFFFBB; outline: #DDDD55 solid thin; }
67     th { background-color: #FFDDAA }
68   </style>
69 </head>
70 <body>
71
72 <!--#include virtual="menu.html.incl"-->
73
74 <div id="content">
75
76 <!--*************************************************************************-->
77 <h1>C++ Defect Report Support in Clang</h1>
78 <!--*************************************************************************-->
79 <p>Last updated: $Date$</p>
80
81 <h2 id="cxxdr">C++ defect report implementation status</h2>
82
83 <p>This page tracks which C++ defect reports are implemented within Clang.</p>
84
85 <table width="689" border="1" cellspacing="0">
86   <tr>
87     <th>Number</th>
88     <th>Status</th>
89     <th>Issue title</th>
90     <th>Available in Clang?</th>
91   </tr>'''
92
93 def availability(issue):
94   status = status_map.get(issue, 'unknown')
95   if status == 'unknown':
96     avail = 'Unknown'
97     avail_style = ' class="none"'
98   elif status == '3.4':
99     avail = 'SVN'
100     avail_style = ' class="svn"'
101   elif status in ('3.1', '3.2', '3.3'):
102     avail = 'Clang %s' % status
103     avail_style = ' class="full"'
104   elif status == 'yes':
105     avail = 'Yes'
106     avail_style = ' class="full"'
107   elif status == 'partial':
108     avail = 'Partial'
109     avail_style = ' class="partial"'
110   elif status == 'no':
111     avail = 'No'
112     avail_style = ' class="none"'
113   elif status == 'na':
114     avail = 'N/A'
115     avail_style = ' class="na"'
116   elif status.startswith('sup '):
117     dup = int(status.split(' ', 1)[1])
118     avail = 'Superseded by %s' % dup
119     _, avail_style = availability(dup)
120   elif status.startswith('dup '):
121     dup = int(status.split(' ', 1)[1])
122     avail = 'Duplicate of %s' % dup
123     _, avail_style = availability(dup)
124   else:
125     assert False, 'unknown status %s for issue %s' % (status, dr.issue)
126   return (avail, avail_style)
127
128 for dr in drs:
129   if dr.status in ('concepts',):
130     # Yeah, cool story bro.
131     continue
132   if dr.status in ('open', 'concurrency', 'drafting', 'review', 'extension'):
133     # We may have to deal with these some day, but not yet.
134     row_style = ' class="open"'
135     avail = 'Not resolved'
136     avail_style = ''
137     assert dr.issue not in status_map, "have status for not-ready dr %s" % dr.issue
138   else:
139     row_style = ''
140     avail, avail_style = availability(dr.issue)
141
142   print >> out_file, '''\
143   <tr%s>
144     <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/%s">%s</a></td>
145     <td>%s</td>
146     <td>%s</td>
147     <td%s align="center">%s</td>
148   </tr>''' % (row_style, dr.url, dr.issue, dr.status, dr.title, avail_style,
149               avail)
150
151 print >> out_file, '''\
152 </table>
153
154 </div>
155 </body>
156 </html>'''