Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 2 additions & 2 deletions llvm/utils/lit/lit/TestRunner.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,12 @@ class ShellEnvironment(object):
we maintain a dir stack for pushd/popd.
"""

def __init__(self, cwd, env, umask=-1, ulimit={}):
def __init__(self, cwd, env, umask=-1, ulimit=None):
self.cwd = cwd
self.env = dict(env)
self.umask = umask
self.dirStack = []
self.ulimit = ulimit
self.ulimit = ulimit if ulimit else {}

def change_dir(self, newdir):
if os.path.isabs(newdir):
Expand Down
3 changes: 3 additions & 0 deletions llvm/utils/lit/tests/Inputs/shtest-ulimit/ulimit_reset.txt
Original file line number Diff line number Diff line change
@@ -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
7 changes: 5 additions & 2 deletions llvm/utils/lit/tests/shtest-ulimit.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
# as well.
# UNSUPPORTED: system-windows, system-solaris

# RUN: not %{lit} -a -v %{inputs}/shtest-ulimit | FileCheck %s
# RUN: not %{lit} -a -v %{inputs}/shtest-ulimit --order=lexical | FileCheck %s

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

# CHECK-LABEL: FAIL: shtest-ulimit :: ulimit-bad-arg.txt ({{[^)]*}})
# CHECK: ulimit -n
Expand All @@ -16,3 +16,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-NOT: RLIMIT_NOFILE=50