mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-02-23 00:59:51 +08:00

Sprout from cygwin-1-3-2 2001-05-08 15:16:50 UTC cvs2svn 'This commit was manufactured by cvs2svn to create branch 'cygwin-1-3-2'.' Cherrypick from master 2001-09-11 20:01:02 UTC Christopher Faylor <me@cgf.cx> 'Update copyrights.': winsup/cygwin/cygrun.c winsup/cygwin/host_dependent.h winsup/cygwin/include/wchar.h winsup/cygwin/shortcut.c winsup/cygwin/shortcut.h winsup/cygwin/test.c winsup/mingw/dirent.c Delete: winsup/cygwin/delqueue.h winsup/cygwin/localtime.c
52 lines
1.2 KiB
C
52 lines
1.2 KiB
C
/* cygrun.c: testsuite support program
|
|
|
|
Copyright 1999, 2000, 2001 Red Hat, Inc.
|
|
|
|
This file is part of Cygwin.
|
|
|
|
This software is a copyrighted work licensed under the terms of the
|
|
Cygwin license. Please consult the file "CYGWIN_LICENSE" for
|
|
details. */
|
|
|
|
/* This program is intended to be used only by the testsuite. It runs
|
|
programs without using the cygwin api, so that the just-built dll
|
|
can be tested without interference from the currently installed
|
|
dll. */
|
|
|
|
#include <stdio.h>
|
|
#include <windows.h>
|
|
#include <stdlib.h>
|
|
|
|
int
|
|
main(int argc, char **argv)
|
|
{
|
|
STARTUPINFO sa;
|
|
PROCESS_INFORMATION pi;
|
|
DWORD ec = 1;
|
|
|
|
if (argc < 2)
|
|
{
|
|
fprintf(stderr, "Usage: cygrun [program]\n");
|
|
exit (0);
|
|
}
|
|
|
|
putenv("CYGWIN_TESTING=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))
|
|
{
|
|
fprintf(stderr, "CreateProcess %s failed\n", argv[1]);
|
|
exit(1);
|
|
}
|
|
|
|
WaitForSingleObject(pi.hProcess, INFINITE);
|
|
|
|
GetExitCodeProcess(pi.hProcess, &ec);
|
|
|
|
CloseHandle(pi.hProcess);
|
|
CloseHandle(pi.hThread);
|
|
return ec;
|
|
}
|