summaryrefslogtreecommitdiffstats
path: root/Tests/CTestTestFdSetSize/sleep.c
diff options
context:
space:
mode:
authorPaul Kunysch <kunysch@me.com>2013-03-05 23:14:58 (GMT)
committerBrad King <brad.king@kitware.com>2013-03-22 13:02:12 (GMT)
commit875eb8e158e9b8541b2efab09df44b32c6854f04 (patch)
tree82bed8297c805cfb51521cf9ea7d9bc8c23db613 /Tests/CTestTestFdSetSize/sleep.c
parent3ed2d03ee9ed9736656c8021e8f740540c9a2b7a (diff)
downloadCMake-875eb8e158e9b8541b2efab09df44b32c6854f04.zip
CMake-875eb8e158e9b8541b2efab09df44b32c6854f04.tar.gz
CMake-875eb8e158e9b8541b2efab09df44b32c6854f04.tar.bz2
CTest: Add test for running many tests in parallel
In particular, this checks that CTest's use of select() has a sufficient file descriptor set size limit (FD_SETSIZE) to handle many child processes at the same time. Running 20 tests requires more than 64 descriptors, the Cygwin default that we override.
Diffstat (limited to 'Tests/CTestTestFdSetSize/sleep.c')
-rw-r--r--Tests/CTestTestFdSetSize/sleep.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/Tests/CTestTestFdSetSize/sleep.c b/Tests/CTestTestFdSetSize/sleep.c
new file mode 100644
index 0000000..b2e6a87
--- /dev/null
+++ b/Tests/CTestTestFdSetSize/sleep.c
@@ -0,0 +1,16 @@
+#if defined(_WIN32)
+# include <windows.h>
+#else
+# include <unistd.h>
+#endif
+
+/* sleeps for 0.1 second */
+int main(int argc, char** argv)
+{
+#if defined(_WIN32)
+ Sleep(100);
+#else
+ usleep(100 * 1000);
+#endif
+ return 0;
+}