| 1 |
import os |
| 2 |
import platform |
| 3 |
import lit.formats |
| 4 |
|
| 5 |
# Suffixes supported by clang-format. |
| 6 |
config.suffixes = [ |
| 7 |
".c", |
| 8 |
".cc", |
| 9 |
".cpp", |
| 10 |
".h", |
| 11 |
".m", |
| 12 |
".mm", |
| 13 |
".java", |
| 14 |
".js", |
| 15 |
".ts", |
| 16 |
".proto", |
| 17 |
".protodevel", |
| 18 |
".pb.txt", |
| 19 |
".txtpb", |
| 20 |
".textproto", |
| 21 |
".textpb", |
| 22 |
".asciipb", |
| 23 |
".td", |
| 24 |
".test", |
| 25 |
] |
| 26 |
|
| 27 |
# AIX 'diff' command doesn't support --strip-trailing-cr, but the internal |
| 28 |
# python implementation does, so use that for cross platform compatibility |
| 29 |
if platform.system() == "AIX": |
| 30 |
config.test_format = lit.formats.ShTest() |
| 31 |
|
| 32 |
# Create an empty .clang-format-ignore file so that tests don't get messed |
| 33 |
# up if one exists higher in the tree |
| 34 |
with open(".clang-format-ignore", "w"): |
| 35 |
pass |