[LLVMdev] lit: deprecating trailing \ in RUN lines

Alp Toker alp at nuanti.com
Sun Dec 8 11:47:31 PST 2013


On 08/12/2013 16:43, Daniel Dunbar wrote:
>
>     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.
>
>     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.
>
>
> Can you elaborate on exactly what kind of checks you want to do?

Basically, it's for asking questions about what's currently tested..

    e.g. /Find me all tests for c++11 exceptions/:

    |git grep 'RUN:.*c++11' -- test/ | grep exceptions|


.. experimenting with new features or refactoring existing tests..

    e.g. /How many tests could we add -fsyntax-only to?/

    |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|[|>]|\\$)/'|

    Answer, 405. Then git diff and page through to see if any are
    actionable.


and fixing broken tests..

    eg. /Let's find and fix %clang_cc1 substitution mistakes../

    giteach perl -pi -e 's/(RUN:.*%clang_cc1)[^\s]+/$1/g'


I committed the results of this run just a few minutes ago in r196729 
and r196730.

One was a test that had been disabled since 2007.

Losing 80 columns is a small price to pay if it'll help make tests 
easier to write, understand and validate in my opinion.

(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?)

Alp.

-- 
http://www.nuanti.com
the browser experts

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20131208/d0474880/attachment.html>


More information about the llvm-dev mailing list