summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/CTestTimeout/TestTimeout.c
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/RunCMake/CTestTimeout/TestTimeout.c')
-rw-r--r--Tests/RunCMake/CTestTimeout/TestTimeout.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/Tests/RunCMake/CTestTimeout/TestTimeout.c b/Tests/RunCMake/CTestTimeout/TestTimeout.c
new file mode 100644
index 0000000..5a008a7
--- /dev/null
+++ b/Tests/RunCMake/CTestTimeout/TestTimeout.c
@@ -0,0 +1,24 @@
+#if defined(_WIN32)
+# include <windows.h>
+#else
+# include <unistd.h>
+#endif
+
+#include <stdio.h>
+
+int main(void)
+{
+#ifdef FORK
+ pid_t pid = fork();
+ if (pid != 0) {
+ return 0;
+ }
+#endif
+
+#if defined(_WIN32)
+ Sleep((TIMEOUT + 4) * 1000);
+#else
+ sleep((TIMEOUT + 4));
+#endif
+ return 0;
+}