-
Notifications
You must be signed in to change notification settings - Fork 15k
[clang-tools-extra] Remove 'REQUIRES: shell' from lit tests. #156950
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
As preparation for making lit use the internal shell by default in clang-tools-extra (withe 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.
@llvm/pr-subscribers-clang-tidy Author: None (cmtice) ChangesAs 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:
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"
|
@llvm/pr-subscribers-clang-tools-extra Author: None (cmtice) ChangesAs 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:
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"
|
This is not ready for review yet -- three of the tests are failing on WIndows. Will work on fixing that. |
.../test/clang-tidy/infrastructure/header-filter-from-config-file/inheritance/subfolder/bar.cpp
Outdated
Show resolved
Hide resolved
These tests had been marked as "REQUIRES: shell". They fail when that is removed. Since they never ran on Windows (due to the 'REQUIRES: shell' annotation), mark them as unsupported.
@@ -1,4 +1,4 @@ | |||
// REQUIRES: shell | |||
// UNSUPPORTED: system-windows |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will the test not run on Windows anymore?
This script is pretty important for users, so I don't think it's a good idea to remove it from windows test-suite
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My understanding is that the "REQUIRES: shell" meant that it never ran on Windows.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that's unfortunate.
I also found this in test results:
<testcase classname="Clang Tools.clang-tidy/infrastructure" name="clang-tidy-diff.cpp" time="0.00">
<skipped message="Missing required feature(s): shell"/>
</testcase>
From this artifacts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you share info what you found (if any) so we would fix tests and enable them in the future?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you share info what you found (if any) so we would fix tests and enable them in the future?
Here are the log files from the failed runs (when I removed "REQUIRES: shell", before I added "UNSUPPORTED").
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
I think this is ready for review now. |
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.