[PATCH] D43732: Resolve build bot problems in unittests/Format/FormatTest.cpp

Bjorn Pettersson via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Feb 24 05:36:04 PST 2018


bjope created this revision.
Herald added a subscriber: klimek.

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).


Repository:
  rC Clang

https://reviews.llvm.org/D43732

Files:
  unittests/Format/FormatTest.cpp


Index: unittests/Format/FormatTest.cpp
===================================================================
--- unittests/Format/FormatTest.cpp
+++ unittests/Format/FormatTest.cpp
@@ -11724,7 +11724,8 @@
 }
 
 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());
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D43732.135794.patch
Type: text/x-patch
Size: 468 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180224/501f4ffd/attachment.bin>


More information about the cfe-commits mailing list