aboutsummaryrefslogtreecommitdiff
path: root/winsup/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/testsuite')
-rw-r--r--winsup/testsuite/cygrun.c26
1 files changed, 22 insertions, 4 deletions
diff --git a/winsup/testsuite/cygrun.c b/winsup/testsuite/cygrun.c
index d8de7d1..4502013 100644
--- a/winsup/testsuite/cygrun.c
+++ b/winsup/testsuite/cygrun.c
@@ -23,24 +23,42 @@ main (int argc, char **argv)
DWORD res;
DWORD ec = 1;
char *p;
+ DWORD timeout = 60 * 1000;
if (argc < 2)
{
fprintf (stderr, "Usage: cygrun [program]\n");
- exit (0);
+ exit (1);
+ }
+
+ int i;
+ for (i = 1; i < argc; ++i)
+ {
+ if (strcmp (argv[i], "-notimeout") == 0)
+ timeout = INFINITE;
+ else
+ break;
+ }
+
+ char *command = argv[i];
+
+ if (i < (argc-1))
+ {
+ fprintf (stderr, "cygrun: excess arguments\n");
+ exit (1);
}
SetEnvironmentVariable ("CYGWIN_TESTING", "1");
memset (&sa, 0, sizeof (sa));
memset (&pi, 0, sizeof (pi));
- if (!CreateProcess (0, argv[1], 0, 0, 1, 0, 0, 0, &sa, &pi))
+ if (!CreateProcess (0, command, 0, 0, 1, 0, 0, 0, &sa, &pi))
{
- fprintf (stderr, "CreateProcess %s failed\n", argv[1]);
+ fprintf (stderr, "CreateProcess %s failed\n", command);
exit (1);
}
- res = WaitForSingleObject (pi.hProcess, 60 * 1000);
+ res = WaitForSingleObject (pi.hProcess, timeout);
if (res == WAIT_TIMEOUT)
{