Skip to content

Commit 2d37e48

Browse files
authored
[compiler-rt][test] Add REQUIRES: shell in tests that use the ulimit command (#105339)
This patch adds the `REQUIRES: shell` directive to six test files that use the `ulimit` command, ensuring these tests are only run in environments where a full POSIX-compliant shell is available. The lit internal shell does not use or support the `ulimit` command, which causes failures when running tests with `LIT_USE_INTERNAL_SHELL=1 ninja check-compiler-rt` Specifically, one of the errors encountered is: ``` # RUN: at line 4 ulimit -s 1000 # executed command: ulimit -s 1000 # .---command stderr------------ # | 'ulimit': command not found # `----------------------------- # error: command failed with exit status: 127 ``` Since, the lit internal shell doesn't support `ulimit`, adding this requirement prevents these tests from failing in the lit internal shell, thereby improving the reliability of the test suite in environments where the full shell is not available. This change is relevant for [[RFC] Enabling the Lit Internal Shell by Default](https://discourse.llvm.org/t/rfc-enabling-the-lit-internal-shell-by-default/80179/3) fixes: #102398
1 parent 89c27d6 commit 2d37e48

File tree

6 files changed

+6
-4
lines changed

6 files changed

+6
-4
lines changed

compiler-rt/test/asan/TestCases/Linux/allocator_oom_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
// ASan shadow memory on s390 is too large for this test.
3232
// AArch64 bots fail on this test.
3333
// TODO(alekseys): Android lit do not run ulimit on device.
34-
// REQUIRES: shadow-scale-3
34+
// REQUIRES: shell, shadow-scale-3
3535
// UNSUPPORTED: android, target={{(s390|aarch64|powerpc64le).*}}
3636

3737
#include <stdlib.h>

compiler-rt/test/asan/TestCases/Posix/deep_call_stack.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// Check that UAR mode can handle very deep recusrion.
2+
// REQUIRES: shell
23
// RUN: %clangxx_asan -O2 %s -o %t
34
// RUN: ulimit -s 4096
45
// RUN: %env_asan_opts=detect_stack_use_after_return=1 %run %t 2>&1 | FileCheck %s

compiler-rt/test/fuzzer/merge-posix.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
REQUIRES: shell
12
XFAIL: ios
2-
UNSUPPORTED: target={{.*windows.*}}
33
RUN: %cpp_compiler %S/FullCoverageSetTest.cpp -o %t-FullCoverageSetTest
44

55
RUN: rm -rf %tmp/T1 %tmp/T2

compiler-rt/test/fuzzer/ulimit.test

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
# FIXME: Disabled on Windows for now because Windows has no ulimit command.
2-
UNSUPPORTED: target={{.*windows.*}}
1+
REQUIRES: shell
32
RUN: %cpp_compiler %S/SimpleTest.cpp -o %t-SimpleTest
43
RUN: ulimit -s 1000
54
RUN: not %run %t-SimpleTest

compiler-rt/test/hwasan/TestCases/print-memory-usage.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// Tests __hwasan_print_memory_usage.
2+
// REQUIRES: shell
23
// RUN: %clang_hwasan %s -o %t
34
// RUN: ulimit -s 1000
45
// RUN: %run %t 2>&1 | FileCheck %s

compiler-rt/test/msan/Linux/reexec_unlimited_stack.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// MSAN re-execs on unlimited stacks. We use that to verify ReExec() uses the
22
// right path.
3+
// REQUIRES: shell
34
// RUN: %clangxx_msan -O0 %s -o %t && ulimit -s unlimited && %run %t | FileCheck %s
45

56
#include <stdio.h>

0 commit comments

Comments
 (0)