sapling/tests/test-check-clang-format.t
Adam Simpkins bd9208583d tests: fix test-check-clang-format.t to use unique temporary names
Summary:
Update test-check-clang-format.t to put its output files in "$TESTTMP" rather
than using fixed paths in the source repository.

This should fix stress test runs of this test, which run multiple copies of
the test in parallel.  Previously running several copies of this test in
parallel would fail as they all try to use the same output path names.

Reviewed By: quark-zju

Differential Revision: D8229266

fbshipit-source-id: a3728aaae7fa8ff393835e7edf09abf2e3939b69
2018-05-31 21:04:43 -07:00

10 lines
374 B
Perl

#require clang-format test-repo
$ . "$TESTDIR/helpers-testrepo.sh"
$ cd "$TESTDIR"/..
$ for f in `testrepohg files 'set:(mercurial/**.c or mercurial/**.h) and not "listfile: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