Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions llvm/utils/lit/tests/Inputs/shtest-ulimit-linux/lit.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import lit.formats

config.name = "shtest-ulimit"
config.suffixes = [".txt"]
config.test_format = lit.formats.ShTest(execute_external=False)
config.test_source_root = None
config.test_exec_root = None
config.substitutions.append(("%{python}", '"%s"' % (sys.executable)))
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# RUN: ulimit -v 1048576
# RUN: %{python} %S/../shtest-ulimit/print_limits.py
# Fail the test so that we can assert on the output.
# RUN: not echo return
1 change: 0 additions & 1 deletion llvm/utils/lit/tests/Inputs/shtest-ulimit/ulimit_okay.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# RUN: ulimit -v 1048576
# RUN: ulimit -n 50
# RUN: %{python} %S/print_limits.py
# Fail the test so that we can assert on the output.
Expand Down
15 changes: 7 additions & 8 deletions llvm/utils/lit/tests/shtest-ulimit.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,8 @@
# ulimit does not work on non-POSIX platforms.
# UNSUPPORTED: system-windows

# TODO(boomanaiden154): The test fails on some non-Linux POSIX
# platforms (like MacOS) due to the underlying system not supporting
# ulimit -v. This test needs to be carved up so we keep full test
# coverage on Linux and as much as possible on other platforms.
# REQUIRES: system-linux

# RUN: not %{lit} -a -v %{inputs}/shtest-ulimit | FileCheck %s
# RUN: %if system-linux %{ not %{lit} -a -v %{inputs}/shtest-ulimit-linux | FileCheck %s --check-prefix CHECK-LINUX %}

# CHECK: -- Testing: 2 tests{{.*}}

Expand All @@ -18,7 +13,11 @@
# CHECK: 'ulimit' requires two arguments

# CHECK-LABEL: FAIL: shtest-ulimit :: ulimit_okay.txt ({{[^)]*}})
# CHECK: ulimit -v 1048576
# CHECK: ulimit -n 50
# CHECK: RLIMIT_AS=1073741824
# CHECK: RLIMIT_NOFILE=50

# CHECK-LINUX: -- Testing: 1 tests{{.*}}

# CHECK-LINUX-LABEL: FAIL: shtest-ulimit :: ulimit_okay.txt ({{[^)]*}})
# CHECK-LINUX: ulimit -v 1048576
# CHECK-LINUX: RLIMIT_AS=1073741824