[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ERT indentation testing (was: [RFC PATCH] setting indentation styles via

From: Ted Zlatanov
Subject: ERT indentation testing (was: [RFC PATCH] setting indentation styles via `c-file-style' fails to actually change indentation)
Date: Wed, 18 May 2011 16:08:11 -0500
User-agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.50 (gnu/linux)

On Wed, 18 May 2011 21:28:34 +0100 Nix <address@hidden> wrote: 

N> (That's an alternative: a decent testing framework for this stuff, such
N> that we could be sure it didn't break. Then it wouldn't matter so much
N> how complex it got, except insofar as it bends the brains of people
N> trying to look at the code.)

This can be done with ERT, right?  A bunch of .cc files with file-local
variables could be indented "properly" for those variables.  Then the
test logic for each file is 

1) open file and evaluate file-local variables, 
2) reindent and untabify the whole file, 
3) compare the result to the untabified original file.

The nice thing about this approach is that all the test logic is inside
the .cc file, so you don't need to configure the ELisp code for each
file separately.  To add a new test you just add a new .cc file.

Plus, of course, it's not limited to .cc files.  It would work just as
well for .c, .pl, .el, whatever.  I can write the ERT wrapper if this
sounds useful.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]