sapling/tests/test-check-clang-format.t
Augie Fackler 89b5ee7ac3 test-clang-format: new test to verify that files stay clang-formatted
For now all .c and .h files are blacklisted. As they become
clang-formatted, we'll remove them from the blacklist,and then this
test will produce output if there are diffs.

Differential Revision: https://phab.mercurial-scm.org/D1133
2015-09-14 14:17:27 -04:00

11 lines
334 B
Perl

#require clang-format test-repo
$ . "$TESTDIR/helpers-testrepo.sh"
$ cd "$TESTDIR"/..
$ for f in `testrepohg files 'set:(**.c or **.h) and not "listfile:contrib/clang-format-blacklist"'` ; do
> clang-format --style file $f > $f.formatted
> cmp $f $f.formatted || diff -u $f $f.formatted
> rm $f.formatted
> done