aboutsummaryrefslogtreecommitdiff
path: root/llvm/utils/lit/tests
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/utils/lit/tests')
-rw-r--r--llvm/utils/lit/tests/Inputs/shtest-ulimit/ulimit_reset.txt3
-rw-r--r--llvm/utils/lit/tests/shtest-ulimit.py11
2 files changed, 12 insertions, 2 deletions
diff --git a/llvm/utils/lit/tests/Inputs/shtest-ulimit/ulimit_reset.txt b/llvm/utils/lit/tests/Inputs/shtest-ulimit/ulimit_reset.txt
new file mode 100644
index 0000000..011d6db
--- /dev/null
+++ b/llvm/utils/lit/tests/Inputs/shtest-ulimit/ulimit_reset.txt
@@ -0,0 +1,3 @@
+# RUN: %{python} %S/print_limits.py
+# Fail the test so that we can assert on the output.
+# RUN: not echo return
diff --git a/llvm/utils/lit/tests/shtest-ulimit.py b/llvm/utils/lit/tests/shtest-ulimit.py
index e843277..dadde70 100644
--- a/llvm/utils/lit/tests/shtest-ulimit.py
+++ b/llvm/utils/lit/tests/shtest-ulimit.py
@@ -5,9 +5,13 @@
# as well.
# UNSUPPORTED: system-windows, system-solaris
-# RUN: not %{lit} -a -v %{inputs}/shtest-ulimit | FileCheck %s
+# RUN: %{python} %S/Inputs/shtest-ulimit/print_limits.py | grep RLIMIT_NOFILE \
+# RUN: | sed -n -e 's/.*=//p' | tr -d '\n' > %t.nofile_limit
-# CHECK: -- Testing: 2 tests{{.*}}
+# RUN: not %{lit} -a -v %{inputs}/shtest-ulimit --order=lexical \
+# RUN: | FileCheck -DBASE_NOFILE_LIMIT=%{readfile:%t.nofile_limit} %s
+
+# CHECK: -- Testing: 3 tests{{.*}}
# CHECK-LABEL: FAIL: shtest-ulimit :: ulimit-bad-arg.txt ({{[^)]*}})
# CHECK: ulimit -n
@@ -16,3 +20,6 @@
# CHECK-LABEL: FAIL: shtest-ulimit :: ulimit_okay.txt ({{[^)]*}})
# CHECK: ulimit -n 50
# CHECK: RLIMIT_NOFILE=50
+
+# CHECK-LABEL: FAIL: shtest-ulimit :: ulimit_reset.txt ({{[^)]*}})
+# CHECK: RLIMIT_NOFILE=[[BASE_NOFILE_LIMIT]]