diff options
Diffstat (limited to 'test/Format/style-on-command-line.cpp')
-rw-r--r-- | test/Format/style-on-command-line.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/test/Format/style-on-command-line.cpp b/test/Format/style-on-command-line.cpp index b2724353da13..0e6078e2fd67 100644 --- a/test/Format/style-on-command-line.cpp +++ b/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 |