2015-07-01 10:59:14 +02:00
|
|
|
Index: ninja-1.6.0/src/subprocess_test.cc
|
2014-11-26 09:03:10 +01:00
|
|
|
===================================================================
|
2015-07-01 10:59:14 +02:00
|
|
|
--- ninja-1.6.0/src/subprocess_test.cc.orig
|
|
|
|
+++ ninja-1.6.0/src/subprocess_test.cc
|
|
|
|
@@ -215,38 +215,6 @@
|
2014-11-26 09:03:10 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
-// OS X's process limit is less than 1025 by default
|
|
|
|
-// (|sysctl kern.maxprocperuid| is 709 on 10.7 and 10.8 and less prior to that).
|
|
|
|
-#if !defined(__APPLE__) && !defined(_WIN32)
|
|
|
|
-TEST_F(SubprocessTest, SetWithLots) {
|
|
|
|
- // Arbitrary big number; needs to be over 1024 to confirm we're no longer
|
|
|
|
- // hostage to pselect.
|
|
|
|
- const unsigned kNumProcs = 1025;
|
|
|
|
-
|
|
|
|
- // Make sure [ulimit -n] isn't going to stop us from working.
|
|
|
|
- rlimit rlim;
|
|
|
|
- ASSERT_EQ(0, getrlimit(RLIMIT_NOFILE, &rlim));
|
2015-07-01 10:59:14 +02:00
|
|
|
- if (rlim.rlim_cur < kNumProcs) {
|
|
|
|
- printf("Raise [ulimit -n] well above %u (currently %lu) to make this test go\n", kNumProcs, rlim.rlim_cur);
|
2014-11-26 09:03:10 +01:00
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- vector<Subprocess*> procs;
|
|
|
|
- for (size_t i = 0; i < kNumProcs; ++i) {
|
|
|
|
- Subprocess* subproc = subprocs_.Add("/bin/echo");
|
|
|
|
- ASSERT_NE((Subprocess *) 0, subproc);
|
|
|
|
- procs.push_back(subproc);
|
|
|
|
- }
|
|
|
|
- while (!subprocs_.running_.empty())
|
|
|
|
- subprocs_.DoWork();
|
|
|
|
- for (size_t i = 0; i < procs.size(); ++i) {
|
|
|
|
- ASSERT_EQ(ExitSuccess, procs[i]->Finish());
|
|
|
|
- ASSERT_NE("", procs[i]->GetOutput());
|
|
|
|
- }
|
|
|
|
- ASSERT_EQ(kNumProcs, subprocs_.finished_.size());
|
|
|
|
-}
|
2015-07-01 10:59:14 +02:00
|
|
|
-#endif // !__APPLE__ && !_WIN32
|
2014-11-26 09:03:10 +01:00
|
|
|
-
|
|
|
|
// TODO: this test could work on Windows, just not sure how to simply
|
|
|
|
// read stdin.
|
|
|
|
#ifndef _WIN32
|
2015-07-01 10:59:14 +02:00
|
|
|
|