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 0000000000000..0987c9081ca1f --- /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 0000000000000..f1a843f308262 --- /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 0000000000000..b69f5e74fd728 --- /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 0000000000000..d1329f5dbfaae --- /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 0000000000000..4e5f4cac4c465 --- /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 0000000000000..ae90f31907d49 --- /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