-
Notifications
You must be signed in to change notification settings - Fork 14.3k
Reapply "[llvm-lit] Add precommit test to verify current behavior of glob expansion in lit's internal shell" (#106763) #107169
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
…glob expansion in lit's internal shell" (llvm#106763) This reverts commit 5af4ba2.
@llvm/pr-subscribers-testing-tools Author: None (Harini0924) ChangesThis reverts commit 5af4ba2. The previous patch was missing the closing parenthesis
This issue broke some build bots. This patch corrects the
Full diff: https://github.com/llvm/llvm-project/pull/107169.diff 6 Files Affected:
diff --git a/llvm/utils/lit/tests/Inputs/shtest-glob/example_file1.input b/llvm/utils/lit/tests/Inputs/shtest-glob/example_file1.input
new file mode 100644
index 00000000000000..0987c9081ca1f3
--- /dev/null
+++ b/llvm/utils/lit/tests/Inputs/shtest-glob/example_file1.input
@@ -0,0 +1,2 @@
+## This is the first example file used for testing glob pattern matching.
+This is the first example file.
diff --git a/llvm/utils/lit/tests/Inputs/shtest-glob/example_file2.input b/llvm/utils/lit/tests/Inputs/shtest-glob/example_file2.input
new file mode 100644
index 00000000000000..f1a843f308262e
--- /dev/null
+++ b/llvm/utils/lit/tests/Inputs/shtest-glob/example_file2.input
@@ -0,0 +1,2 @@
+## This is the second example file used for testing glob pattern matching.
+This is the second example file.
diff --git a/llvm/utils/lit/tests/Inputs/shtest-glob/glob-echo.txt b/llvm/utils/lit/tests/Inputs/shtest-glob/glob-echo.txt
new file mode 100644
index 00000000000000..b69f5e74fd7281
--- /dev/null
+++ b/llvm/utils/lit/tests/Inputs/shtest-glob/glob-echo.txt
@@ -0,0 +1,2 @@
+## Tests glob pattern expansion by listing matching files.
+# RUN: echo %S/example_file*.input
diff --git a/llvm/utils/lit/tests/Inputs/shtest-glob/glob-mkdir.txt b/llvm/utils/lit/tests/Inputs/shtest-glob/glob-mkdir.txt
new file mode 100644
index 00000000000000..d1329f5dbfaaed
--- /dev/null
+++ b/llvm/utils/lit/tests/Inputs/shtest-glob/glob-mkdir.txt
@@ -0,0 +1,2 @@
+## Tests glob pattern handling in the mkdir command.
+# RUN: not mkdir %S/example_file*.input
diff --git a/llvm/utils/lit/tests/Inputs/shtest-glob/lit.cfg b/llvm/utils/lit/tests/Inputs/shtest-glob/lit.cfg
new file mode 100644
index 00000000000000..4e5f4cac4c4653
--- /dev/null
+++ b/llvm/utils/lit/tests/Inputs/shtest-glob/lit.cfg
@@ -0,0 +1,8 @@
+import lit.formats
+
+config.name = "shtest-glob"
+config.suffixes = [".txt"]
+config.test_format = lit.formats.ShTest()
+config.test_source_root = None
+config.test_exec_root = None
+config.substitutions.append(("%{python}", '"%s"' % (sys.executable)))
diff --git a/llvm/utils/lit/tests/shtest-glob.py b/llvm/utils/lit/tests/shtest-glob.py
new file mode 100644
index 00000000000000..ae90f31907d492
--- /dev/null
+++ b/llvm/utils/lit/tests/shtest-glob.py
@@ -0,0 +1,12 @@
+## Tests glob pattern handling in echo command.
+
+# RUN: not %{lit} -a -v %{inputs}/shtest-glob \
+# RUN: | FileCheck -dump-input=fail -match-full-lines %s
+#
+# END.
+
+# CHECK: UNRESOLVED: shtest-glob :: glob-echo.txt ({{[^)]*}})
+# CHECK: TypeError: string argument expected, got 'GlobItem'
+
+# CHECK: FAIL: shtest-glob :: glob-mkdir.txt ({{[^)]*}})
+# CHECK: # error: command failed with exit status: 1
|
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.
LGTM
kicked off a build of this CL on one of the bots that were failing on the original CL: https://lab.llvm.org/buildbot/#/buildrequests/1080411?redirect_to_build=true
Ah, this patch is not using |
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.
I ran git fetch origin pull/107169/head && git merge FETCH_HEAD
and confirmed that check-lit
passes. LGTM
This reverts commit 5af4ba2.
The previous patch was missing the closing parenthesis
)
in theCHECK
statement in thellvm/utils/lit/tests/shtest-glob.py
file:# CHECK: FAIL: shtest-glob :: glob-mkdir.txt ({{[^)]*}}
This issue broke some build bots. This patch corrects the
CHECK
statement by adding the closing parenthesis:# CHECK: FAIL: shtest-glob :: glob-mkdir.txt ({{[^)]*}})