Skip to content

Commit aa03fba

Browse files
mstorsjotru
authored andcommitted
[libcxx] [test] Add a test parameter for disabling memory intensive tests (#68214)
Specifically, the test std/input.output/string.streams/stringstream/stringstream.members/gcount.pass.cpp allocates a std::string with INT_MAX-1 elements, and then writes this to a std::stringstream. On Linux, running this test consumes around 5.0 GB of memory; on Windows, it ends up using up to 6.8 GB of memory. This limits whether such tests can run on e.g. GitHub Actions runners, where the free runners are limited to 8 GB of memory. This is somewhat similar to, but still notably different, from the existing test parameter long_tests. (cherry picked from commit 122064a)
1 parent 71f408b commit aa03fba

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

libcxx/test/std/input.output/string.streams/stringstream/stringstream.members/gcount.pass.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
//===----------------------------------------------------------------------===//
88

99
// UNSUPPORTED: 32-bit-pointer
10+
// REQUIRES: large_tests
1011

1112
// Test that tellp() does not break the stringstream after INT_MAX, due to use
1213
// of pbump() that accept int.

libcxx/utils/libcxx/test/params.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,14 @@ def getModuleFlag(cfg, enable_modules):
299299
help="Whether to enable tests that take longer to run. This can be useful when running on a very slow device.",
300300
actions=lambda enabled: [] if not enabled else [AddFeature("long_tests")],
301301
),
302+
Parameter(
303+
name="large_tests",
304+
choices=[True, False],
305+
type=bool,
306+
default=True,
307+
help="Whether to enable tests that use a lot of memory. This can be useful when running on a device with limited amounts of memory.",
308+
actions=lambda enabled: [] if not enabled else [AddFeature("large_tests")],
309+
),
302310
Parameter(
303311
name="enable_assertions",
304312
choices=[True, False],

0 commit comments

Comments
 (0)