summaryrefslogtreecommitdiffstats
path: root/src/subprocess_test.cc
diff options
context:
space:
mode:
authorAmi Fischman <fischman@chromium.org>2012-03-04 01:42:39 (GMT)
committerAmi Fischman <fischman@chromium.org>2012-03-04 01:52:22 (GMT)
commitcd2e3c9115bd2df3db0d11cfc38ab82a17fcac06 (patch)
tree1b3a021d26fbc902954e67e693fd5584598dc275 /src/subprocess_test.cc
parent2338d9340bb2c13746805b4b878c889008850962 (diff)
downloadNinja-cd2e3c9115bd2df3db0d11cfc38ab82a17fcac06.zip
Ninja-cd2e3c9115bd2df3db0d11cfc38ab82a17fcac06.tar.gz
Ninja-cd2e3c9115bd2df3db0d11cfc38ab82a17fcac06.tar.bz2
pselect->ppoll on linux to raise the process limit roof
Diffstat (limited to 'src/subprocess_test.cc')
-rw-r--r--src/subprocess_test.cc22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/subprocess_test.cc b/src/subprocess_test.cc
index 5b3e8a3..d7ecb33 100644
--- a/src/subprocess_test.cc
+++ b/src/subprocess_test.cc
@@ -1,4 +1,4 @@
-// Copyright 2011 Google Inc. All Rights Reserved.
+// Copyright 2012 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -142,3 +142,23 @@ TEST_F(SubprocessTest, SetWithMulti) {
}
}
+#ifdef OS_LINUX
+TEST_F(SubprocessTest, SetWithLots) {
+ // Arbitrary big number; needs to be over 1024 to confirm we're no longer
+ // hostage to pselect.
+ const size_t kNumProcs = 1025;
+ 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());
+}
+#endif