[clang-tools-extra] [NFC][clangd][test] add clang-tidy config to ensure test cases sandbox (PR #141410)
Congcong Cai via cfe-commits
cfe-commits at lists.llvm.org
Sun May 25 08:31:01 PDT 2025
https://github.com/HerrCai0907 created https://github.com/llvm/llvm-project/pull/141410
Under previous test setup, the test result will be influenced by clang-tidy file in parent folder (between llvm-projects root and build folder). It is inconventient and leads some confusion.
This PR wants to ensure sandbox to avoid outside's clang-tidy influenece test result.
>From ac614ac46750b19d2810d838112ba8b01388f577 Mon Sep 17 00:00:00 2001
From: Congcong Cai <congcongcai0907 at 163.com>
Date: Sun, 25 May 2025 23:30:24 +0800
Subject: [PATCH] [NFC][clangd][test] add clang-tidy config to ensure test
cases sandbox
Under previous test setup, the test result will be influenced by clang-tidy file in parent folder (between llvm-projects root and build folder). It is inconventient and leads some confusion.
This PR wants to ensure sandbox to avoid outside's clang-tidy influenece test result.
---
.../clangd/test/Inputs/path-mappings/server/.clang-tidy | 1 +
clang-tools-extra/clangd/test/system-include-extractor.test | 3 +++
2 files changed, 4 insertions(+)
create mode 100644 clang-tools-extra/clangd/test/Inputs/path-mappings/server/.clang-tidy
diff --git a/clang-tools-extra/clangd/test/Inputs/path-mappings/server/.clang-tidy b/clang-tools-extra/clangd/test/Inputs/path-mappings/server/.clang-tidy
new file mode 100644
index 0000000000000..1f16f2a33b3ce
--- /dev/null
+++ b/clang-tools-extra/clangd/test/Inputs/path-mappings/server/.clang-tidy
@@ -0,0 +1 @@
+InheritParentConfig: false
\ No newline at end of file
diff --git a/clang-tools-extra/clangd/test/system-include-extractor.test b/clang-tools-extra/clangd/test/system-include-extractor.test
index 4ccc093671324..372b4a1a0fef5 100644
--- a/clang-tools-extra/clangd/test/system-include-extractor.test
+++ b/clang-tools-extra/clangd/test/system-include-extractor.test
@@ -32,6 +32,9 @@
# RUN: echo 'printf "End of search list.\r\n" >&2' >> %t.dir/bin/my_driver.sh
# RUN: chmod +x %t.dir/bin/my_driver.sh
+# Create fake clang-tidy config to ensure sandbox
+# RUN: echo 'InheritParentConfig: false' >> %t.dir/.clang-tidy
+
# Create header files my/dir/a.h and my/dir2/b.h
# RUN: mkdir -p %t.dir/my/dir
# RUN: touch %t.dir/my/dir/a.h
More information about the cfe-commits
mailing list