llvmorg-github-actions[bot] wrote:

<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clang-format

@llvm/pr-subscribers-clang-tools-extra

Author: Damian Höster (damster101)

<details>
<summary>Changes</summary>

These leaks were causing false test failures due to my global .clang-format 
being in an ancestor directory of the build directory. These changes prevent 
those issues when running the tests on my system.
I used MiMo v2.5 Pro agentically in Zed to find and fix the issue. But I 
understand the changes and judge them to be safe and a clear improvement over 
the status quo.

---
Full diff: https://github.com/llvm/llvm-project/pull/206358.diff


2 Files Affected:

- (modified) 
clang-tools-extra/unittests/clang-change-namespace/ChangeNamespaceTests.cpp 
(+3-3) 
- (modified) clang/test/Format/dump-config-objc-stdin.m (+2-2) 


``````````diff
diff --git 
a/clang-tools-extra/unittests/clang-change-namespace/ChangeNamespaceTests.cpp 
b/clang-tools-extra/unittests/clang-change-namespace/ChangeNamespaceTests.cpp
index 4a6352cd5975e..6d1612e7d3b16 100644
--- 
a/clang-tools-extra/unittests/clang-change-namespace/ChangeNamespaceTests.cpp
+++ 
b/clang-tools-extra/unittests/clang-change-namespace/ChangeNamespaceTests.cpp
@@ -46,7 +46,7 @@ class ChangeNamespaceTest : public ::testing::Test {
     if (!tooling::runToolOnCodeWithArgs(Factory->create(), Code, 
{"-std=c++11"},
                                         FileName))
       return "";
-    formatAndApplyAllReplacements(FileToReplacements, Context.Rewrite);
+    formatAndApplyAllReplacements(FileToReplacements, Context.Rewrite, "llvm");
     return format(Context.getRewrittenText(ID));
   }
 
@@ -63,10 +63,10 @@ class ChangeNamespaceTest : public ::testing::Test {
   }
 
 protected:
-  std::string FileName = "input.cc";
+  std::string FileName = "/test/input.cc";
   std::string OldNamespace = "na::nb";
   std::string NewNamespace = "x::y";
-  std::string FilePattern = "input.cc";
+  std::string FilePattern = "/test/input.cc";
 };
 
 TEST_F(ChangeNamespaceTest, NoMatchingNamespace) {
diff --git a/clang/test/Format/dump-config-objc-stdin.m 
b/clang/test/Format/dump-config-objc-stdin.m
index d81711a84d79b..01a4a78a5a65d 100644
--- a/clang/test/Format/dump-config-objc-stdin.m
+++ b/clang/test/Format/dump-config-objc-stdin.m
@@ -1,6 +1,6 @@
-// RUN: clang-format -assume-filename=foo.m -dump-config | FileCheck %s
+// RUN: clang-format -style=llvm -assume-filename=foo.m -dump-config | 
FileCheck %s
 
-// RUN: clang-format -dump-config - < %s | FileCheck %s
+// RUN: clang-format -style=llvm -dump-config - < %s | FileCheck %s
 
 // CHECK: Language: ObjC
 

``````````

</details>


https://github.com/llvm/llvm-project/pull/206358
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to