test-clang-format: new test to verify that files stay clang-formatted
authorAugie Fackler <augie@google.com>
Mon, 14 Sep 2015 14:17:27 -0400
changeset 34834 2e8477059d4f
parent 34833 07bbb208a924
child 34835 14c87708f432
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
contrib/clang-format-blacklist
tests/test-check-clang-format.t
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contrib/clang-format-blacklist	Mon Sep 14 14:17:27 2015 -0400
@@ -0,0 +1,70 @@
+# Files that just need to be migrated to the formatter.
+# Do not add new files here!
+contrib/chg/chg.c
+contrib/chg/hgclient.c
+contrib/chg/hgclient.h
+contrib/chg/procutil.c
+contrib/chg/procutil.h
+contrib/chg/util.c
+contrib/chg/util.h
+contrib/hgsh/hgsh.c
+mercurial/cext/base85.c
+mercurial/cext/bdiff.c
+mercurial/cext/charencode.c
+mercurial/cext/charencode.h
+mercurial/cext/diffhelpers.c
+mercurial/cext/dirs.c
+mercurial/cext/manifest.c
+mercurial/cext/mpatch.c
+mercurial/cext/osutil.c
+mercurial/cext/parsers.c
+mercurial/cext/pathencode.c
+mercurial/cext/revlog.c
+# Vendored code that we should never format:
+contrib/python-zstandard/c-ext/bufferutil.c
+contrib/python-zstandard/c-ext/compressiondict.c
+contrib/python-zstandard/c-ext/compressionparams.c
+contrib/python-zstandard/c-ext/compressionwriter.c
+contrib/python-zstandard/c-ext/compressobj.c
+contrib/python-zstandard/c-ext/compressor.c
+contrib/python-zstandard/c-ext/compressoriterator.c
+contrib/python-zstandard/c-ext/constants.c
+contrib/python-zstandard/c-ext/decompressionwriter.c
+contrib/python-zstandard/c-ext/decompressobj.c
+contrib/python-zstandard/c-ext/decompressor.c
+contrib/python-zstandard/c-ext/decompressoriterator.c
+contrib/python-zstandard/c-ext/frameparams.c
+contrib/python-zstandard/c-ext/python-zstandard.h
+contrib/python-zstandard/zstd.c
+contrib/python-zstandard/zstd/common/bitstream.h
+contrib/python-zstandard/zstd/common/entropy_common.c
+contrib/python-zstandard/zstd/common/error_private.c
+contrib/python-zstandard/zstd/common/error_private.h
+contrib/python-zstandard/zstd/common/fse.h
+contrib/python-zstandard/zstd/common/fse_decompress.c
+contrib/python-zstandard/zstd/common/huf.h
+contrib/python-zstandard/zstd/common/mem.h
+contrib/python-zstandard/zstd/common/pool.c
+contrib/python-zstandard/zstd/common/pool.h
+contrib/python-zstandard/zstd/common/threading.c
+contrib/python-zstandard/zstd/common/threading.h
+contrib/python-zstandard/zstd/common/xxhash.c
+contrib/python-zstandard/zstd/common/xxhash.h
+contrib/python-zstandard/zstd/common/zstd_common.c
+contrib/python-zstandard/zstd/common/zstd_errors.h
+contrib/python-zstandard/zstd/common/zstd_internal.h
+contrib/python-zstandard/zstd/compress/fse_compress.c
+contrib/python-zstandard/zstd/compress/huf_compress.c
+contrib/python-zstandard/zstd/compress/zstd_compress.c
+contrib/python-zstandard/zstd/compress/zstd_opt.h
+contrib/python-zstandard/zstd/compress/zstdmt_compress.c
+contrib/python-zstandard/zstd/compress/zstdmt_compress.h
+contrib/python-zstandard/zstd/decompress/huf_decompress.c
+contrib/python-zstandard/zstd/decompress/zstd_decompress.c
+contrib/python-zstandard/zstd/dictBuilder/cover.c
+contrib/python-zstandard/zstd/dictBuilder/divsufsort.c
+contrib/python-zstandard/zstd/dictBuilder/divsufsort.h
+contrib/python-zstandard/zstd/dictBuilder/zdict.c
+contrib/python-zstandard/zstd/dictBuilder/zdict.h
+contrib/python-zstandard/zstd/zstd.h
+hgext/fsmonitor/pywatchman/bser.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-check-clang-format.t	Mon Sep 14 14:17:27 2015 -0400
@@ -0,0 +1,10 @@
+#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