<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<br>
<div class="moz-cite-prefix">On 08/12/2013 16:43, Daniel Dunbar
wrote:<br>
</div>
<blockquote
cite="mid:CAEU8z69YsMUBrseW7G=8ASP7ZWnK0DJ7-9_QcxOtP37NZLXfSA@mail.gmail.com"
type="cite">
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">With
one-to-one mapping, it becomes possible to use simple tools like
grep to validate common mistakes like %clang / %clang_cc1
mixups, a missing -o flag and so on.<br>
<br>
Right now there's no obvious way to do those checks and we've
ended up without an easy way to lint for broken tests as a
result. Each broken test has a high cost so we need to
continually look at ways to improve the situation.</blockquote>
<div><br>
</div>
<div>Can you elaborate on exactly what kind of checks you want to
do?</div>
</blockquote>
<br>
Basically, it's for asking questions about what's currently tested..<br>
<br>
<blockquote>e.g. <i>Find me all tests for c++11 exceptions</i>:<br>
<br>
<code>git grep 'RUN:.*c++11' -- test/ | grep exceptions</code><br>
</blockquote>
<br>
.. experimenting with new features or refactoring existing tests..<br>
<br>
<blockquote>e.g. <i>How many tests could we add -fsyntax-only to?</i><br>
<br>
<code>giteach perl -pi -e 's/((RUN:.*%clang_cc1)(.*))$/$2
-fsyntax-only$3/g unless
m/(-fsyntax-only|-analyze|-arcmt-check|-arcmt-migrate|-o|-emit-llvm|-E|-ast-print|-ast-dump|[|>]|\\$)/'</code><br>
<br>
Answer, 405. Then git diff and page through to see if any are
actionable.<br>
</blockquote>
<br>
and fixing broken tests..<br>
<br>
<blockquote>eg. <i>Let's find and fix %clang_cc1 substitution
mistakes..</i><br>
<br>
giteach perl -pi -e 's/(RUN:.*%clang_cc1)[^\s]+/$1/g'<br>
</blockquote>
<br>
I committed the results of this run just a few minutes ago in
r196729 and r196730.<br>
<br>
One was a test that had been disabled since 2007.<br>
<br>
Losing 80 columns is a small price to pay if it'll help make tests
easier to write, understand and validate in my opinion.<br>
<br>
(The two editors I use, vim and XCode, both do a good job of virtual
line wrapping so it turns out long RUN lines aren't that much of a
big deal in practice. But I can see why it may be a bigger problem
with editors that don't support wrapping. Is this still a problem in
2013?)<br>
<br>
Alp.<br>
<br>
<pre class="moz-signature" cols="72">--
<a class="moz-txt-link-freetext" href="http://www.nuanti.com">http://www.nuanti.com</a>
the browser experts
</pre>
</body>
</html>