[clang-tools-extra] [clang-tools-extra] Remove 'REQUIRES: shell' from lit tests. (PR #156950)

via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 4 12:04:11 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang-tidy

Author: None (cmtice)

<details>
<summary>Changes</summary>

As preparation for making lit use the internal shell by default in clang-tools-extra (with significant expected performance gains), this removes 'REQUIRES: shell' from the clang-tools-extra lit tests that have it, and updates the one test that was not passing with 'LIT_USE_INTERNAL_SHELL=1' to now pass with the internal shell.

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


6 Files Affected:

- (modified) clang-tools-extra/test/clang-include-fixer/multiple_fixes.cpp (-1) 
- (modified) clang-tools-extra/test/clang-tidy/infrastructure/clang-tidy-diff.cpp (-1) 
- (modified) clang-tools-extra/test/clang-tidy/infrastructure/file-filter-symlinks.cpp (-2) 
- (modified) clang-tools-extra/test/clang-tidy/infrastructure/header-filter-from-config-file/inheritance/subfolder/bar.cpp (+4-2) 
- (modified) clang-tools-extra/test/clang-tidy/infrastructure/pr37091.cpp (-1) 
- (modified) clang-tools-extra/test/clang-tidy/infrastructure/vfsoverlay.cpp (-1) 


``````````diff
diff --git a/clang-tools-extra/test/clang-include-fixer/multiple_fixes.cpp b/clang-tools-extra/test/clang-include-fixer/multiple_fixes.cpp
index 6c82e2a4749ae..3db706bd27f23 100644
--- a/clang-tools-extra/test/clang-include-fixer/multiple_fixes.cpp
+++ b/clang-tools-extra/test/clang-include-fixer/multiple_fixes.cpp
@@ -1,4 +1,3 @@
-// REQUIRES: shell
 // RUN: sed -e 's#//.*$##' %s > %t.cpp
 // RUN: mkdir -p %t.dir/clang-include-fixer/multiple-fixes
 // RUN: echo 'foo f;' > %t.dir/clang-include-fixer/multiple-fixes/foo.cpp
diff --git a/clang-tools-extra/test/clang-tidy/infrastructure/clang-tidy-diff.cpp b/clang-tools-extra/test/clang-tidy/infrastructure/clang-tidy-diff.cpp
index 25be90fb49587..92a31acb1f8d7 100644
--- a/clang-tools-extra/test/clang-tidy/infrastructure/clang-tidy-diff.cpp
+++ b/clang-tools-extra/test/clang-tidy/infrastructure/clang-tidy-diff.cpp
@@ -1,4 +1,3 @@
-// REQUIRES: shell
 // RUN: sed 's/placeholder_for_f/f/' %s > %t.cpp
 // RUN: clang-tidy -checks=-*,modernize-use-override %t.cpp -- -std=c++11 | FileCheck -check-prefix=CHECK-SANITY %s
 // RUN: not diff -U0 %s %t.cpp | %clang_tidy_diff -checks=-*,modernize-use-override -- -std=c++11 2>&1 | FileCheck %s --check-prefixes=CHECK,CHECK-JMAX
diff --git a/clang-tools-extra/test/clang-tidy/infrastructure/file-filter-symlinks.cpp b/clang-tools-extra/test/clang-tidy/infrastructure/file-filter-symlinks.cpp
index 58f3b23cb1dbf..a978d514186e9 100644
--- a/clang-tools-extra/test/clang-tidy/infrastructure/file-filter-symlinks.cpp
+++ b/clang-tools-extra/test/clang-tidy/infrastructure/file-filter-symlinks.cpp
@@ -1,5 +1,3 @@
-// REQUIRES: shell
-
 // RUN: rm -rf %t
 // RUN: mkdir -p %t/dir1/dir2
 // RUN: echo 'class A { A(int); };' > %t/dir1/header.h
diff --git a/clang-tools-extra/test/clang-tidy/infrastructure/header-filter-from-config-file/inheritance/subfolder/bar.cpp b/clang-tools-extra/test/clang-tidy/infrastructure/header-filter-from-config-file/inheritance/subfolder/bar.cpp
index 229ba52e2695a..9517c3d5a16a6 100644
--- a/clang-tools-extra/test/clang-tidy/infrastructure/header-filter-from-config-file/inheritance/subfolder/bar.cpp
+++ b/clang-tools-extra/test/clang-tidy/infrastructure/header-filter-from-config-file/inheritance/subfolder/bar.cpp
@@ -1,6 +1,8 @@
 // shell is required for the "dirname" command
-// REQUIRES: shell
-// RUN: clang-tidy -checks=-*,google-explicit-constructor %s -- -I "$(dirname %S)" 2>&1 | FileCheck %s
+// RUN: pushd %S
+// RUN: cd ..
+// RUN: clang-tidy -checks=-*,google-explicit-constructor %s -- -I "." 2>&1 | FileCheck %s
+// RUN: popd
 #include "foo.h"
 // CHECK-NOT: foo.h:1:12: warning: single-argument constructors must be marked explicit
 
diff --git a/clang-tools-extra/test/clang-tidy/infrastructure/pr37091.cpp b/clang-tools-extra/test/clang-tidy/infrastructure/pr37091.cpp
index 6772e9d29f34d..a07149c20c325 100644
--- a/clang-tools-extra/test/clang-tidy/infrastructure/pr37091.cpp
+++ b/clang-tools-extra/test/clang-tidy/infrastructure/pr37091.cpp
@@ -1,4 +1,3 @@
-// REQUIRES: shell
 // RUN: rm -rf %t
 // RUN: mkdir -p %t
 
diff --git a/clang-tools-extra/test/clang-tidy/infrastructure/vfsoverlay.cpp b/clang-tools-extra/test/clang-tidy/infrastructure/vfsoverlay.cpp
index 5704b71fd10ea..d3040c6fc469c 100644
--- a/clang-tools-extra/test/clang-tidy/infrastructure/vfsoverlay.cpp
+++ b/clang-tools-extra/test/clang-tidy/infrastructure/vfsoverlay.cpp
@@ -1,6 +1,5 @@
 // RUN: sed -e "s:INPUT_DIR:%S/Inputs/vfsoverlay:g" -e "s:OUT_DIR:%t:g" %S/Inputs/vfsoverlay/vfsoverlay.yaml > %t.yaml
 // RUN: clang-tidy %s -checks='-*,modernize-use-nullptr' -vfsoverlay %t.yaml -- -I %t | FileCheck %s
-// REQUIRES: shell
 
 #include "not_real.h"
 

``````````

</details>


https://github.com/llvm/llvm-project/pull/156950


More information about the cfe-commits mailing list