Author: cwittich Date: Thu Sep 4 03:56:03 2008 New Revision: 35923
URL: http://svn.reactos.org/svn/reactos?rev=35923&view=rev Log: add a --winetest parameter which will run all sub tests from the given winetest module and redirect output to dbgout
Modified: trunk/reactos/base/applications/cmdutils/dbgprint/dbgprint.c
Modified: trunk/reactos/base/applications/cmdutils/dbgprint/dbgprint.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/cmdutils/... ============================================================================== --- trunk/reactos/base/applications/cmdutils/dbgprint/dbgprint.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/cmdutils/dbgprint/dbgprint.c [iso-8859-1] Thu Sep 4 03:56:03 2008 @@ -31,7 +31,44 @@ return -1; }
- if (_tcsstr(argv[1], "--process") && (argc == 3)) + if (_tcsstr(argv[1], "--winetest") && (argc == 3)) + { + char psBuffer[128]; + char psBuffer2[128]; + char cmd[255]; + FILE *pPipe; + FILE *pPipe2; + + /* get available tests */ + pPipe = _tpopen(argv[2], "r"); + if (pPipe != NULL) + { + while(fgets(psBuffer, 128, pPipe)) + { + char *nlptr = strchr(psBuffer, '\n'); + if (nlptr) + psBuffer[*psBuffer - *nlptr - 1] = '\0'; + if (psBuffer[0] == ' ') + { + strcpy(cmd, argv[2]); + strcat(cmd, " "); + strcat(cmd, psBuffer+4); + /* run the current test */ + pPipe2 = _tpopen(cmd, "r"); + if (pPipe2 != NULL) + { + while(fgets(psBuffer2, 128, pPipe2)) + { + OutputDebugStringA(psBuffer2); + } + _pclose(pPipe2); + } + } + } + _pclose(pPipe); + } + } + else if (_tcsstr(argv[1], "--process") && (argc == 3)) { char psBuffer[128]; FILE *pPipe;