diff options
author | Kuba Mracek <mracek@apple.com> | 2017-08-15 19:47:06 +0000 |
---|---|---|
committer | Kuba Mracek <mracek@apple.com> | 2017-08-15 19:47:06 +0000 |
commit | 5b57633a45a5072b4292a98d68eb4ddb4f2b63b6 (patch) | |
tree | 3c09b2c2ead9c38125e589295068e7a8673deeea /clang/test/Format | |
parent | 0464c5d958065c571a605f5da3cfd4b729950be7 (diff) | |
download | bcm5719-llvm-5b57633a45a5072b4292a98d68eb4ddb4f2b63b6.tar.gz bcm5719-llvm-5b57633a45a5072b4292a98d68eb4ddb4f2b63b6.zip |
[clang] Get rid of "%T" expansions
The %T lit expansion expands to a common directory shared between all the tests in the same directory, which is unexpected and unintuitive, and more importantly, it's been a source of subtle race conditions and flaky tests. In https://reviews.llvm.org/D35396, it was agreed that it would be best to simply ban %T and only keep %t, which is unique to each test. When a test needs a temporary directory, it can just create one using mkdir %t.
This patch removes %T in clang.
Differential Revision: https://reviews.llvm.org/D36437
llvm-svn: 310950
Diffstat (limited to 'clang/test/Format')
-rw-r--r-- | clang/test/Format/style-on-command-line.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/clang/test/Format/style-on-command-line.cpp b/clang/test/Format/style-on-command-line.cpp index b2724353da1..0e6078e2fd6 100644 --- a/clang/test/Format/style-on-command-line.cpp +++ b/clang/test/Format/style-on-command-line.cpp @@ -2,20 +2,21 @@ // RUN: clang-format -style="{BasedOnStyle: LLVM, IndentWidth: 7}" %s | FileCheck -strict-whitespace -check-prefix=CHECK2 %s // RUN: not clang-format -style="{BasedOnStyle: invalid, IndentWidth: 7}" -fallback-style=LLVM %s 2>&1 | FileCheck -strict-whitespace -check-prefix=CHECK3 %s // RUN: not clang-format -style="{lsjd}" %s -fallback-style=LLVM 2>&1 | FileCheck -strict-whitespace -check-prefix=CHECK4 %s -// RUN: printf "BasedOnStyle: google\nIndentWidth: 5\n" > %T/.clang-format -// RUN: clang-format -style=file -assume-filename=%T/foo.cpp < %s | FileCheck -strict-whitespace -check-prefix=CHECK5 %s -// RUN: printf "\n" > %T/.clang-format -// RUN: not clang-format -style=file -fallback-style=webkit -assume-filename=%T/foo.cpp < %s 2>&1 | FileCheck -strict-whitespace -check-prefix=CHECK6 %s -// RUN: rm %T/.clang-format -// RUN: printf "BasedOnStyle: google\nIndentWidth: 6\n" > %T/_clang-format -// RUN: clang-format -style=file -assume-filename=%T/foo.cpp < %s | FileCheck -strict-whitespace -check-prefix=CHECK7 %s +// RUN: mkdir -p %t +// RUN: printf "BasedOnStyle: google\nIndentWidth: 5\n" > %t/.clang-format +// RUN: clang-format -style=file -assume-filename=%t/foo.cpp < %s | FileCheck -strict-whitespace -check-prefix=CHECK5 %s +// RUN: printf "\n" > %t/.clang-format +// RUN: not clang-format -style=file -fallback-style=webkit -assume-filename=%t/foo.cpp < %s 2>&1 | FileCheck -strict-whitespace -check-prefix=CHECK6 %s +// RUN: rm %t/.clang-format +// RUN: printf "BasedOnStyle: google\nIndentWidth: 6\n" > %t/_clang-format +// RUN: clang-format -style=file -assume-filename=%t/foo.cpp < %s | FileCheck -strict-whitespace -check-prefix=CHECK7 %s // RUN: clang-format -style="{BasedOnStyle: LLVM, PointerBindsToType: true}" %s | FileCheck -strict-whitespace -check-prefix=CHECK8 %s // RUN: clang-format -style="{BasedOnStyle: WebKit, PointerBindsToType: false}" %s | FileCheck -strict-whitespace -check-prefix=CHECK9 %s // Fallback style tests // Test config file with no based style, and fallback style "none", formatting is applied -// RUN: printf "IndentWidth: 6\n" > %T/_clang-format -// RUN: clang-format -style=file -fallback-style=none -assume-filename=%T/foo.cpp < %s 2>&1 | FileCheck -strict-whitespace -check-prefix=CHECK10 %s +// RUN: printf "IndentWidth: 6\n" > %t/_clang-format +// RUN: clang-format -style=file -fallback-style=none -assume-filename=%t/foo.cpp < %s 2>&1 | FileCheck -strict-whitespace -check-prefix=CHECK10 %s // Test yaml with no based style, and fallback style "none", LLVM formatting applied // RUN: clang-format -style="{IndentWidth: 7}" -fallback-style=none %s | FileCheck -strict-whitespace -check-prefix=CHECK11 %s |