]> granicus.if.org Git - clang/commitdiff
Resolve build bot problems in unittests/Format/FormatTest.cpp
authorBjorn Pettersson <bjorn.a.pettersson@ericsson.com>
Mon, 26 Feb 2018 14:14:11 +0000 (14:14 +0000)
committerBjorn Pettersson <bjorn.a.pettersson@ericsson.com>
Mon, 26 Feb 2018 14:14:11 +0000 (14:14 +0000)
Summary:
Make the new GetStyleWithEmptyFileName test case independent
of the file system used when running the test. Since the
test is supposed to use the fallback "Google" style we now
use a InMemoryFileSystem to make sure that we do not accidentaly
find a .clang-format file in the real file system. That could
for example happen when having the build directory inside the
llvm och clang repo (as there is a .clang-format file inside
the repos).

Reviewers: vsapsai, jolesiak, krasimir, benhamilton

Reviewed By: krasimir

Subscribers: uabelho, twoh, klimek, cfe-commits

Differential Revision: https://reviews.llvm.org/D43732

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@326086 91177308-0d34-0410-b5e6-96231b3b80d8

unittests/Format/FormatTest.cpp

index f87fd8481afc5a46d1be80a7f622dac13deeda30..082f6e4864d4784f4a4b77e7e82b54390d96e7b0 100644 (file)
@@ -11724,7 +11724,8 @@ TEST_F(FormatTest, NoSpaceAfterSuper) {
 }
 
 TEST(FormatStyle, GetStyleWithEmptyFileName) {
-  auto Style1 = getStyle("file", "", "Google");
+  vfs::InMemoryFileSystem FS;
+  auto Style1 = getStyle("file", "", "Google", "", &FS);
   ASSERT_TRUE((bool)Style1);
   ASSERT_EQ(*Style1, getGoogleStyle());
 }