sapling/tests/test-check-clang-format.t
Phil Cohen 6725395931 tests cut test-check-clang-format.t from 1.2m to 5s
Summary: Same fix as the previous diffs in this stack -- the issue is a slow `hg files` path that can be better done with grep.

Reviewed By: quark-zju

Differential Revision: D8753437

fbshipit-source-id: 05655b1d8677c1e9b7c1326f3704f15412152b94
2018-07-06 17:27:25 -07:00

10 lines
357 B
Perl

#require clang-format test-repo
$ . "$TESTDIR/helpers-testrepo.sh"
$ cd "$TESTDIR"/..
$ for f in `testrepohg files mercurial | egrep '\.(c|h)$' | egrep -v -f contrib/clang-format-blacklist` ; do
> clang-format --style file "$f" > "$TESTTMP/formatted.txt"
> cmp "$f" "$TESTTMP/formatted.txt" || diff -u "$f" "$TESTTMP/formatted.txt"
> done