Prepare for a change of architecture.

Instead of building all Wine tests as dlls, we'll revert back to separate processes, but redirect the client processes stdin, stdout and stderr to named pipes set by the parent.

svn path=/trunk/; revision=36844
This commit is contained in:
Ged Murphy 2008-10-20 14:49:59 +00:00
parent f3d835f4a1
commit b686c53533
7 changed files with 244 additions and 164 deletions

View file

@ -9,18 +9,16 @@
#include <precomp.h> #include <precomp.h>
#define DLL_SEARCH_DIR L"\\Debug\\testlibs\\*" #define EXE_SEARCH_DIR L"\\Debug\\testexes\\*"
#define IL_MAIN 0 #define IL_MAIN 0
#define IL_TEST 1 #define IL_TEST 1
#define HAS_NO_CHILD 0 #define HAS_NO_CHILD 0
#define HAS_CHILD 1 #define HAS_CHILD 1
typedef wchar_t *(__cdecl *DLLNAME)();
typedef int (_cdecl *MODULES)(char **);
static INT static INT
GetNumberOfDllsInFolder(LPWSTR lpFolder) GetNumberOfExesInFolder(LPWSTR lpFolder)
{ {
HANDLE hFind; HANDLE hFind;
WIN32_FIND_DATAW findFileData; WIN32_FIND_DATAW findFileData;
@ -46,52 +44,52 @@ GetNumberOfDllsInFolder(LPWSTR lpFolder)
} }
static INT static INT
GetListOfTestDlls(PMAIN_WND_INFO pInfo) GetListOfTestExes(PMAIN_WND_INFO pInfo)
{ {
HANDLE hFind; HANDLE hFind;
WIN32_FIND_DATAW findFileData; WIN32_FIND_DATAW findFileData;
WCHAR szDllPath[MAX_PATH]; WCHAR szExePath[MAX_PATH];
LPWSTR ptr; LPWSTR ptr;
INT numFiles = 0; INT numFiles = 0;
INT len; INT len;
len = GetCurrentDirectory(MAX_PATH, szDllPath); len = GetCurrentDirectory(MAX_PATH, szExePath);
if (!len) return 0; if (!len) return 0;
wcsncat(szDllPath, DLL_SEARCH_DIR, MAX_PATH - (len + 1)); wcsncat(szExePath, EXE_SEARCH_DIR, MAX_PATH - (len + 1));
numFiles = GetNumberOfDllsInFolder(szDllPath); numFiles = GetNumberOfExesInFolder(szExePath);
if (!numFiles) return 0; if (!numFiles) return 0;
pInfo->lpDllList = HeapAlloc(GetProcessHeap(), pInfo->lpExeList = HeapAlloc(GetProcessHeap(),
0, 0,
numFiles * (MAX_PATH * sizeof(WCHAR))); numFiles * (MAX_PATH * sizeof(WCHAR)));
if (!pInfo->lpDllList) if (!pInfo->lpExeList)
return 0; return 0;
hFind = FindFirstFileW(szDllPath, hFind = FindFirstFileW(szExePath,
&findFileData); &findFileData);
if (hFind == INVALID_HANDLE_VALUE) if (hFind == INVALID_HANDLE_VALUE)
{ {
DisplayError(GetLastError()); DisplayError(GetLastError());
HeapFree(GetProcessHeap(), 0, pInfo->lpDllList); HeapFree(GetProcessHeap(), 0, pInfo->lpExeList);
return 0; return 0;
} }
/* remove the glob */ /* remove the glob */
ptr = wcschr(szDllPath, L'*'); ptr = wcschr(szExePath, L'*');
if (ptr) if (ptr)
*ptr = L'\0'; *ptr = L'\0';
/* don't mod our base pointer */ /* don't modify our base pointer */
ptr = pInfo->lpDllList; ptr = pInfo->lpExeList;
do do
{ {
if (!(findFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) if (!(findFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))
{ {
/* set the path */ /* set the path */
wcscpy(ptr, szDllPath); wcscpy(ptr, szExePath);
/* tag the file onto the path */ /* tag the file onto the path */
len = MAX_PATH - (wcslen(ptr) + 1); len = MAX_PATH - (wcslen(ptr) + 1);
@ -207,7 +205,7 @@ InsertIntoTreeView(HWND hTreeView,
} }
static PTEST_ITEM static PTEST_ITEM
BuildTestItemData(LPWSTR lpDll, BuildTestItemData(LPWSTR lpExe,
LPWSTR lpRun) LPWSTR lpRun)
{ {
PTEST_ITEM pItem; PTEST_ITEM pItem;
@ -217,8 +215,8 @@ BuildTestItemData(LPWSTR lpDll,
sizeof(TEST_ITEM)); sizeof(TEST_ITEM));
if (pItem) if (pItem)
{ {
if (lpDll) if (lpExe)
wcsncpy(pItem->szSelectedDll, lpDll, MAX_PATH); wcsncpy(pItem->szSelectedExe, lpExe, MAX_PATH);
if (lpRun) if (lpRun)
wcsncpy(pItem->szRunString, lpRun, MAX_RUN_CMD); wcsncpy(pItem->szRunString, lpRun, MAX_RUN_CMD);
} }
@ -232,12 +230,9 @@ PopulateTreeView(PMAIN_WND_INFO pInfo)
HTREEITEM hRoot; HTREEITEM hRoot;
HIMAGELIST hImgList; HIMAGELIST hImgList;
PTEST_ITEM pTestItem; PTEST_ITEM pTestItem;
DLLNAME GetTestName; LPWSTR lpExePath;
MODULES GetModulesInTest;
HMODULE hDll;
LPWSTR lpDllPath;
LPWSTR lpTestName; LPWSTR lpTestName;
INT RootImage, i; INT i;
pInfo->hBrowseTV = GetDlgItem(pInfo->hBrowseDlg, IDC_TREEVIEW); pInfo->hBrowseTV = GetDlgItem(pInfo->hBrowseDlg, IDC_TREEVIEW);
@ -259,76 +254,36 @@ PopulateTreeView(PMAIN_WND_INFO pInfo)
hRoot = InsertIntoTreeView(pInfo->hBrowseTV, hRoot = InsertIntoTreeView(pInfo->hBrowseTV,
NULL, NULL,
L"Full", L"Full",
pTestItem, (LPARAM)pTestItem,
IL_MAIN, IL_MAIN,
HAS_CHILD); HAS_CHILD);
for (i = 0; i < pInfo->numDlls; i++) for (i = 0; i < pInfo->numExes; i++)
{ {
lpDllPath = pInfo->lpDllList + (MAX_PATH * i); HTREEITEM hParent;
LPWSTR lpStr;
hDll = LoadLibraryW(lpDllPath); lpExePath = pInfo->lpExeList + (MAX_PATH * i);
if (hDll)
lpTestName = wcsrchr(lpExePath, L'\\');
if (lpTestName)
{ {
GetTestName = (DLLNAME)GetProcAddress(hDll, "GetTestName"); lpTestName++;
if (GetTestName)
lpStr = wcschr(lpTestName, L'_');
if (lpStr)
{ {
HTREEITEM hParent; //FIXME: Query the test name from the exe directly
LPSTR lpModules, ptr;
LPWSTR lpModW;
INT numMods;
lpTestName = GetTestName(); pTestItem = BuildTestItemData(lpExePath, lpTestName);
pTestItem = BuildTestItemData(lpDllPath, lpTestName);
hParent = InsertIntoTreeView(pInfo->hBrowseTV, hParent = InsertIntoTreeView(pInfo->hBrowseTV,
hRoot, hRoot,
lpTestName, lpTestName,
pTestItem, (LPARAM)pTestItem,
IL_TEST, IL_TEST,
HAS_CHILD); HAS_CHILD);
if (hParent)
{
/* Get the list of modules a dll offers. This is returned as list of
* Ansi null-terminated strings, terminated with an empty string (double null) */
GetModulesInTest = (MODULES)GetProcAddress(hDll, "GetModulesInTest");
if ((numMods = GetModulesInTest(&lpModules)))
{
ptr = lpModules;
while (numMods && *ptr != '\0')
{
/* convert the string to unicode */
if (AnsiToUnicode(ptr, &lpModW))
{
WCHAR szRunCmd[MAX_RUN_CMD];
_snwprintf(szRunCmd, MAX_RUN_CMD, L"%s:%s", lpTestName, lpModW);
pTestItem = BuildTestItemData(lpDllPath, szRunCmd);
InsertIntoTreeView(pInfo->hBrowseTV,
hParent,
lpModW,
pTestItem,
IL_TEST,
HAS_NO_CHILD);
HeapFree(GetProcessHeap(), 0, lpModW);
}
/* move onto next string */
while (*(ptr++) != '\0')
;
numMods--;
}
HeapFree(GetProcessHeap(), 0, lpModules);
}
}
} }
FreeLibrary(hDll);
} }
} }
@ -343,8 +298,8 @@ PopulateTreeView(PMAIN_WND_INFO pInfo)
static VOID static VOID
PopulateTestList(PMAIN_WND_INFO pInfo) PopulateTestList(PMAIN_WND_INFO pInfo)
{ {
pInfo->numDlls = GetListOfTestDlls(pInfo); pInfo->numExes = GetListOfTestExes(pInfo);
if (pInfo->numDlls) if (pInfo->numExes)
{ {
PopulateTreeView(pInfo); PopulateTreeView(pInfo);
} }
@ -417,16 +372,17 @@ BrowseDlgProc(HWND hDlg,
DisplayMessage(L"Please select an item"); DisplayMessage(L"Please select an item");
} }
break; return TRUE;
} }
case IDCANCEL: case IDCANCEL:
{ {
HeapFree(GetProcessHeap(), 0, pInfo->lpDllList); HeapFree(GetProcessHeap(), 0, pInfo->lpExeList);
pInfo->lpDllList = NULL; pInfo->lpExeList = NULL;
EndDialog(hDlg, EndDialog(hDlg,
LOWORD(wParam)); LOWORD(wParam));
return TRUE; return TRUE;
} }
} }

View file

@ -8,7 +8,7 @@ BEGIN
DEFPUSHBUTTON "OK",IDOK,236,241,50,14,WS_GROUP DEFPUSHBUTTON "OK",IDOK,236,241,50,14,WS_GROUP
CONTROL "",IDC_LIST,"SysListView32",LVS_ALIGNLEFT | WS_BORDER | WS_TABSTOP,7,69,279,103 CONTROL "",IDC_LIST,"SysListView32",LVS_ALIGNLEFT | WS_BORDER | WS_TABSTOP,7,69,279,103
EDITTEXT IDC_OUTPUT,7,175,279,62,ES_MULTILINE | ES_AUTOHSCROLL | ES_READONLY EDITTEXT IDC_OUTPUT,7,175,279,62,ES_MULTILINE | ES_AUTOHSCROLL | ES_READONLY
COMBOBOX IDC_TESTSELECTION,27,12,205,30,CBS_DROPDOWN | CBS_SORT | WS_VSCROLL | WS_TABSTOP COMBOBOX IDC_TESTSELECTION,27,12,205,30,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
LTEXT "Test:",IDC_STATIC,6,14,18,8 LTEXT "Test:",IDC_STATIC,6,14,18,8
PUSHBUTTON "Browse...",IDC_BROWSE,236,11,50,14 PUSHBUTTON "Browse...",IDC_BROWSE,236,11,50,14
PUSHBUTTON "Run",IDC_RUN,236,30,50,14 PUSHBUTTON "Run",IDC_RUN,236,30,50,14
@ -19,8 +19,9 @@ BEGIN
LTEXT "?",IDC_NUMERRORS,85,53,8,8 LTEXT "?",IDC_NUMERRORS,85,53,8,8
LTEXT "Failures:",IDC_STATIC,107,53,28,8 LTEXT "Failures:",IDC_STATIC,107,53,28,8
LTEXT "?",IDC_NUMFAILURES,141,53,8,8 LTEXT "?",IDC_NUMFAILURES,141,53,8,8
PUSHBUTTON "Options",IDC_OPTIONS,181,49,50,14
PUSHBUTTON "Stop",IDC_STOP,236,49,50,14 PUSHBUTTON "Stop",IDC_STOP,236,49,50,14
CONTROL "Run on start",IDC_RUNONSTART,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,174,52,56,10
LTEXT "status bar",IDC_STATUS,7,244,210,8 LTEXT "status bar",IDC_STATUS,7,244,210,8
END END
@ -29,7 +30,18 @@ STYLE DS_SHELLFONT | WS_BORDER | WS_DLGFRAME | WS_SYSMENU | DS_MODALFRAME
CAPTION "Test hierarchy" CAPTION "Test hierarchy"
FONT 8, "MS Shell Dlg", 0, 0, 0x1 FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN BEGIN
PUSHBUTTON "Select", IDOK, 202, 7, 50, 14 PUSHBUTTON "Select", IDOK, 202, 7, 50, 14
PUSHBUTTON "Close", IDCANCEL, 202, 34, 50, 14 PUSHBUTTON "Close", IDCANCEL, 202, 34, 50, 14
CONTROL "", IDC_TREEVIEW, "SysTreeView32", WS_BORDER | TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT, 7, 7, 189, 236 CONTROL "", IDC_TREEVIEW, "SysTreeView32", WS_BORDER | TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT, 7, 7, 189, 236
END
IDD_OPTIONS DIALOGEX 0, 0, 180, 100
STYLE DS_SHELLFONT | WS_BORDER | WS_DLGFRAME | WS_SYSMENU | DS_MODALFRAME
CAPTION "Options"
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
PUSHBUTTON "OK", IDOK, 70, 80, 50, 14
PUSHBUTTON "Cancel", IDCANCEL, 125, 80, 50, 14
CONTROL "Hide console window",IDC_HIDECONSOLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,10,80,10
CONTROL "Run on start",IDC_RUNONSTART,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,30,80,10
END END

View file

@ -8,17 +8,30 @@
*/ */
#include <precomp.h> #include <precomp.h>
#include <io.h>
#define BUFSIZE 4096
HINSTANCE hInstance; HINSTANCE hInstance;
WCHAR szPipeName[] = L"\\\\.\\pipe\\winetest_pipe";
typedef int (_cdecl *RUNTEST)(char **); typedef int (_cdecl *RUNTEST)(char **);
VOID
CreateClientProcess(PMAIN_WND_INFO pInfo,
LPWSTR lpExePath)
{
}
static BOOL static BOOL
OnInitMainDialog(HWND hDlg, OnInitMainDialog(HWND hDlg,
LPARAM lParam) LPARAM lParam)
{ {
PMAIN_WND_INFO pInfo; PMAIN_WND_INFO pInfo;
LPWSTR lpAboutText;
pInfo = (PMAIN_WND_INFO)lParam; pInfo = (PMAIN_WND_INFO)lParam;
@ -65,8 +78,8 @@ RunSelectedTest(PMAIN_WND_INFO pInfo)
{ {
HWND hRunCmd; HWND hRunCmd;
WCHAR szTextCmd[MAX_RUN_CMD]; WCHAR szTextCmd[MAX_RUN_CMD];
LPWSTR lpDllPath; LPWSTR lpExePath;
INT sel, len; INT sel;
hRunCmd = GetDlgItem(pInfo->hMainWnd, IDC_TESTSELECTION); hRunCmd = GetDlgItem(pInfo->hMainWnd, IDC_TESTSELECTION);
@ -79,44 +92,15 @@ RunSelectedTest(PMAIN_WND_INFO pInfo)
if (SendMessageW(hRunCmd, if (SendMessageW(hRunCmd,
CB_GETLBTEXT, CB_GETLBTEXT,
sel, sel,
szTextCmd) != CB_ERR) (LPARAM)szTextCmd) != CB_ERR)
{ {
lpDllPath = SendMessage(hRunCmd, lpExePath = (LPWSTR)SendMessage(hRunCmd,
CB_GETITEMDATA, CB_GETITEMDATA,
0, 0,
0); 0);
if (lpDllPath) if (lpExePath)
{ {
LPWSTR module = szTextCmd; CreateClientProcess(pInfo, lpExePath);
LPSTR lpTest;
while (*(module++) != L':' && *module != L'\0')
;
if (*module)
{
if (UnicodeToAnsi(module, &lpTest))
{
HMODULE hDll;
RUNTEST RunTest;
hDll = LoadLibraryW(lpDllPath);
if (hDll)
{
RunTest = (RUNTEST)GetProcAddress(hDll, "RunTest");
if (RunTest)
{
RunTest(lpTest);
}
FreeLibrary(hDll);
}
DisplayError(GetLastError());
HeapFree(GetProcessHeap(), 0, lpTest);
}
}
} }
} }
} }
@ -126,7 +110,7 @@ static VOID
AddTestToCombo(PMAIN_WND_INFO pInfo) AddTestToCombo(PMAIN_WND_INFO pInfo)
{ {
HWND hRunCmd; HWND hRunCmd;
LPWSTR lpDllPath; LPWSTR lpExePath;
INT len; INT len;
hRunCmd = GetDlgItem(pInfo->hMainWnd, IDC_TESTSELECTION); hRunCmd = GetDlgItem(pInfo->hMainWnd, IDC_TESTSELECTION);
@ -135,21 +119,21 @@ AddTestToCombo(PMAIN_WND_INFO pInfo)
SendMessageW(hRunCmd, SendMessageW(hRunCmd,
CB_INSERTSTRING, CB_INSERTSTRING,
0, 0,
pInfo->SelectedTest.szRunString); (LPARAM)pInfo->SelectedTest.szRunString);
len = (wcslen(pInfo->SelectedTest.szSelectedDll) + 1) * sizeof(WCHAR); len = (wcslen(pInfo->SelectedTest.szSelectedExe) + 1) * sizeof(WCHAR);
lpDllPath = HeapAlloc(GetProcessHeap(), 0, len); lpExePath = HeapAlloc(GetProcessHeap(), 0, len);
if (lpDllPath) if (lpExePath)
{ {
wcsncpy(lpDllPath, wcsncpy(lpExePath,
pInfo->SelectedTest.szSelectedDll, pInfo->SelectedTest.szSelectedExe,
len / sizeof(WCHAR)); len / sizeof(WCHAR));
} }
SendMessageW(hRunCmd, SendMessageW(hRunCmd,
CB_SETITEMDATA, CB_SETITEMDATA,
0, 0,
lpDllPath); (LPARAM)lpExePath);
SendMessageW(hRunCmd, SendMessageW(hRunCmd,
CB_SETCURSEL, CB_SETCURSEL,
0, 0,
@ -161,8 +145,7 @@ static VOID
FreeTestCmdStrings(PMAIN_WND_INFO pInfo) FreeTestCmdStrings(PMAIN_WND_INFO pInfo)
{ {
HWND hRunCmd; HWND hRunCmd;
WCHAR szTextCmd[MAX_RUN_CMD]; LPWSTR lpExePath;
LPWSTR lpDllPath;
INT cnt, i; INT cnt, i;
hRunCmd = GetDlgItem(pInfo->hMainWnd, IDC_TESTSELECTION); hRunCmd = GetDlgItem(pInfo->hMainWnd, IDC_TESTSELECTION);
@ -175,13 +158,13 @@ FreeTestCmdStrings(PMAIN_WND_INFO pInfo)
{ {
for (i = 0; i < cnt; i++) for (i = 0; i < cnt; i++)
{ {
lpDllPath = SendMessage(hRunCmd, lpExePath = (LPWSTR)SendMessage(hRunCmd,
CB_GETITEMDATA, CB_GETITEMDATA,
i, i,
0); 0);
if (lpDllPath) if (lpExePath)
{ {
HeapFree(GetProcessHeap(), 0, lpDllPath); HeapFree(GetProcessHeap(), 0, lpExePath);
} }
} }
} }
@ -228,6 +211,13 @@ MainDlgProc(HWND hDlg,
break; break;
} }
case IDC_OPTIONS:
DialogBoxParamW(hInstance,
MAKEINTRESOURCEW(IDD_OPTIONS),
hDlg,
(DLGPROC)OptionsDlgProc,
(LPARAM)pInfo);
break;
case IDC_RUN: case IDC_RUN:
RunSelectedTest(pInfo); RunSelectedTest(pInfo);
@ -271,7 +261,12 @@ wWinMain(HINSTANCE hInst,
{ {
INITCOMMONCONTROLSEX iccx; INITCOMMONCONTROLSEX iccx;
PMAIN_WND_INFO pInfo; PMAIN_WND_INFO pInfo;
INT Ret = 1; HANDLE hThread;
INT Ret = -1;
UNREFERENCED_PARAMETER(hPrev);
UNREFERENCED_PARAMETER(Cmd);
UNREFERENCED_PARAMETER(iCmd);
hInstance = hInst; hInstance = hInst;
@ -280,7 +275,9 @@ wWinMain(HINSTANCE hInst,
iccx.dwICC = ICC_TAB_CLASSES; iccx.dwICC = ICC_TAB_CLASSES;
InitCommonControlsEx(&iccx); InitCommonControlsEx(&iccx);
pInfo = HeapAlloc(GetProcessHeap(), 0, sizeof(MAIN_WND_INFO)); pInfo = HeapAlloc(GetProcessHeap(),
0,
sizeof(MAIN_WND_INFO));
if (pInfo) if (pInfo)
{ {
Ret = (DialogBoxParamW(hInstance, Ret = (DialogBoxParamW(hInstance,
@ -289,8 +286,9 @@ wWinMain(HINSTANCE hInst,
(DLGPROC)MainDlgProc, (DLGPROC)MainDlgProc,
(LPARAM)pInfo) == IDOK); (LPARAM)pInfo) == IDOK);
HeapFree(GetProcessHeap(), 0, pInfo); HeapFree(GetProcessHeap(),
0,
pInfo);
} }
return Ret; return Ret;

View file

@ -238,12 +238,12 @@ InitImageList(UINT StartResource,
/* Add all icons to the image list */ /* Add all icons to the image list */
for (i = StartResource; i <= EndResource; i++) for (i = StartResource; i <= EndResource; i++)
{ {
hIcon = (HBITMAP)LoadImageW(hInstance, hIcon = (HICON)LoadImageW(hInstance,
MAKEINTRESOURCEW(i), MAKEINTRESOURCEW(i),
IMAGE_ICON, IMAGE_ICON,
Width, Width,
Height, Height,
LR_DEFAULTCOLOR); LR_DEFAULTCOLOR);
if (hIcon == NULL) if (hIcon == NULL)
goto fail; goto fail;
@ -294,7 +294,7 @@ UnicodeToAnsi(LPCWSTR lpSrcStr,
length = wcslen(lpSrcStr) + 1; length = wcslen(lpSrcStr) + 1;
*lpDstStr = (LPWSTR)HeapAlloc(GetProcessHeap(), 0, length); *lpDstStr = (LPSTR)HeapAlloc(GetProcessHeap(), 0, length);
if (*lpDstStr) if (*lpDstStr)
{ {
ret = WideCharToMultiByte(CP_ACP, ret = WideCharToMultiByte(CP_ACP,

View file

@ -0,0 +1,100 @@
/*
* PROJECT: ReactOS API Test GUI
* LICENSE: GPL - See COPYING in the top level directory
* FILE:
* PURPOSE: options dialog implementation
* COPYRIGHT: Copyright 2008 Ged Murphy <gedmurphy@reactos.org>
*
*/
#include <precomp.h>
static BOOL
OnInitBrowseDialog(HWND hDlg,
LPARAM lParam)
{
PMAIN_WND_INFO pInfo;
pInfo = (PMAIN_WND_INFO)lParam;
pInfo->hBrowseDlg = hDlg;
SetWindowLongPtr(hDlg,
GWLP_USERDATA,
(LONG_PTR)pInfo);
return TRUE;
}
BOOL CALLBACK
OptionsDlgProc(HWND hDlg,
UINT Message,
WPARAM wParam,
LPARAM lParam)
{
PMAIN_WND_INFO pInfo;
//UNREFERENCED_PARAM(
/* Get the window context */
pInfo = (PMAIN_WND_INFO)GetWindowLongPtr(hDlg,
GWLP_USERDATA);
if (pInfo == NULL && Message != WM_INITDIALOG)
{
goto HandleDefaultMessage;
}
switch(Message)
{
case WM_INITDIALOG:
return OnInitBrowseDialog(hDlg, lParam);
case WM_COMMAND:
{
switch (LOWORD(wParam))
{
case IDOK:
{
if (SendMessageW(GetDlgItem(hDlg, IDC_RUNONSTART), BM_GETCHECK, 0, 0) == BST_CHECKED)
{
pInfo->bRunOnStart = TRUE;
}
else
{
pInfo->bRunOnStart = FALSE;
}
if (SendMessageW(GetDlgItem(hDlg, IDC_HIDECONSOLE), BM_GETCHECK, 0, 0) == BST_CHECKED)
{
pInfo->bHideConsole = TRUE;
}
else
{
pInfo->bHideConsole = FALSE;
}
EndDialog(hDlg,
LOWORD(wParam));
return TRUE;
}
case IDCANCEL:
{
EndDialog(hDlg,
LOWORD(wParam));
return TRUE;
}
}
break;
}
HandleDefaultMessage:
default:
return FALSE;
}
return FALSE;
}

View file

@ -13,7 +13,7 @@ extern HINSTANCE hInstance;
typedef struct _TEST_ITEM typedef struct _TEST_ITEM
{ {
WCHAR szSelectedDll[MAX_PATH]; WCHAR szSelectedExe[MAX_PATH];
WCHAR szRunString[MAX_RUN_CMD]; WCHAR szRunString[MAX_RUN_CMD];
} TEST_ITEM, *PTEST_ITEM; } TEST_ITEM, *PTEST_ITEM;
@ -24,16 +24,20 @@ typedef struct _MAIN_WND_INFO
HWND hBrowseDlg; HWND hBrowseDlg;
HWND hBrowseTV; HWND hBrowseTV;
HWND hStatus; HWND hStatus;
HANDLE hPipe;
int nCmdShow; int nCmdShow;
HICON hSmIcon; HICON hSmIcon;
HICON hBgIcon; HICON hBgIcon;
LPWSTR lpDllList; LPWSTR lpExeList;
INT numDlls; INT numExes;
TEST_ITEM SelectedTest; TEST_ITEM SelectedTest;
BOOL bRunOnStart;
BOOL bHideConsole;
} MAIN_WND_INFO, *PMAIN_WND_INFO; } MAIN_WND_INFO, *PMAIN_WND_INFO;
/* dll exports */ /* dll exports */
@ -42,9 +46,15 @@ int GetModulesInTest(char **modules);
int RunTest(const char *lpTest); int RunTest(const char *lpTest);
/* mainwnd.c */
BOOL SendCommandToClient(PMAIN_WND_INFO pInfo, LPWSTR lpCommand);
/* browsewnd.c */ /* browsewnd.c */
BOOL CALLBACK BrowseDlgProc(HWND hDlg, UINT Message, WPARAM wParam, LPARAM lParam); BOOL CALLBACK BrowseDlgProc(HWND hDlg, UINT Message, WPARAM wParam, LPARAM lParam);
/* optionswnd.c */
BOOL CALLBACK OptionsDlgProc(HWND hDlg, UINT Message, WPARAM wParam, LPARAM lParam);
/* misc.c */ /* misc.c */
HIMAGELIST InitImageList(UINT StartResource, UINT EndResource, UINT Width, UINT Height); HIMAGELIST InitImageList(UINT StartResource, UINT EndResource, UINT Width, UINT Height);
VOID DisplayMessage(LPWSTR lpMsg); VOID DisplayMessage(LPWSTR lpMsg);

View file

@ -1,6 +1,7 @@
#define IDD_WINETESTGUI 102 #define IDD_WINETESTGUI 102
#define IDD_TESTBROWSER 103 #define IDD_TESTBROWSER 103
#define IDM_ABOUT 104 #define IDD_OPTIONS 104
//#define IDM_ABOUT 104
#define IDM_EXIT 105 #define IDM_EXIT 105
#define IDI_ICON 107 #define IDI_ICON 107
#define IDI_TESTS 108 #define IDI_TESTS 108
@ -16,9 +17,12 @@
#define IDC_NUMERRORS 1007 #define IDC_NUMERRORS 1007
#define IDC_NUMFAILURES 1008 #define IDC_NUMFAILURES 1008
#define IDC_STOP 1010 #define IDC_STOP 1010
#define IDC_CHECK2 1011 #define IDC_OPTIONS 1011
#define IDC_RUNONSTART 1011 #define IDC_SELECT 1013
#define IDC_TREEVIEW 1014
#define IDC_HIDECONSOLE 1020
#define IDC_RUNONSTART 1021
#define IDC_STATUS 1012 #define IDC_STATUS 1012
#define IDC_SELECT 1020
#define IDC_TREEVIEW 1021
#define IDC_STATIC -1 #define IDC_STATIC -1