summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPino Toscano <toscano.pino@tiscali.it>2015-02-28 11:04:09 +0100
committerPino Toscano <toscano.pino@tiscali.it>2015-02-28 11:04:09 +0100
commitde57020bd1f2bf4781c14375ed1717a44cac8016 (patch)
tree40ae054ed1a478ef23db0b9c74803a0e456198a7
parentc406d1c8adfedc1982e2c08ab95d581f65eb65de (diff)
downloadninja-de57020bd1f2bf4781c14375ed1717a44cac8016.tar.gz
subprocess_test: gracefully handle rlim.rlim_cur < kNumProcs
Instead of expecting that the number of open files is well above kNumProcs, simply "skip" the test in that case, still printing the message about the test limit (adding the current system limit too).
-rw-r--r--src/subprocess_test.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/subprocess_test.cc b/src/subprocess_test.cc
index 8a0787c..7759863 100644
--- a/src/subprocess_test.cc
+++ b/src/subprocess_test.cc
@@ -177,8 +177,8 @@ TEST_F(SubprocessTest, SetWithLots) {
// Make sure [ulimit -n] isn't going to stop us from working.
rlimit rlim;
ASSERT_EQ(0, getrlimit(RLIMIT_NOFILE, &rlim));
- if (!EXPECT_GT(rlim.rlim_cur, kNumProcs)) {
- printf("Raise [ulimit -n] well above %u to make this test go\n", kNumProcs);
+ if (rlim.rlim_cur < kNumProcs) {
+ printf("Raise [ulimit -n] well above %u (currently %lu) to make this test go\n", kNumProcs, rlim.rlim_cur);
return;
}