diff options
author | Pino Toscano <toscano.pino@tiscali.it> | 2015-02-28 10:04:09 (GMT) |
---|---|---|
committer | Pino Toscano <toscano.pino@tiscali.it> | 2015-02-28 10:04:09 (GMT) |
commit | de57020bd1f2bf4781c14375ed1717a44cac8016 (patch) | |
tree | 40ae054ed1a478ef23db0b9c74803a0e456198a7 /src | |
parent | c406d1c8adfedc1982e2c08ab95d581f65eb65de (diff) | |
download | Ninja-de57020bd1f2bf4781c14375ed1717a44cac8016.zip Ninja-de57020bd1f2bf4781c14375ed1717a44cac8016.tar.gz Ninja-de57020bd1f2bf4781c14375ed1717a44cac8016.tar.bz2 |
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).
Diffstat (limited to 'src')
-rw-r--r-- | src/subprocess_test.cc | 4 |
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; } |