#include <CWineTest.h>
Definition at line 8 of file CWineTest.h.
◆ CWineTest()
Constructs a CWineTest object.
Definition at line 20 of file CWineTest.cpp.
22{
24
25
27 {
31 }
32 else
33 {
35 FATAL(
"GetWindowsDirectoryW failed\n");
36
39 }
40}
#define GetEnvironmentVariableW(x, y, z)
UINT WINAPI GetWindowsDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
◆ ~CWineTest()
CWineTest::~CWineTest |
( |
| ) |
|
Destructs a CWineTest object.
Definition at line 45 of file CWineTest.cpp.
46{
49
52}
BOOL WINAPI FindClose(HANDLE hFindFile)
◆ DoListCommand()
DWORD CWineTest::DoListCommand |
( |
| ) |
|
|
private |
Executes the –list command of a module test file to get information about the available tests.
- Returns
- The number of bytes we read into the m_ListBuffer member variable by capturing the output of the –list command.
Definition at line 111 of file CWineTest.cpp.
112{
113 DWORD BytesAvailable;
115 wstring CommandLine;
117
118
121 CommandLine +=
L" --list";
122
123 {
124
126
127
129 TESTEXCEPTION(
"WaitForSingleObject failed for the test list\n");
130 }
131
132
135
136
137 if(!BytesAvailable)
138 {
140
143 }
144
145
147
150
151 return BytesAvailable;
152}
static const DWORD ListTimeout
basic_ostream< _CharT, _Traits > &_STLP_CALL endl(basic_ostream< _CharT, _Traits > &__os)
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
string UnicodeToAscii(PCWSTR UnicodeString)
#define TESTEXCEPTION(Message)
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Referenced by GetNextTest().
◆ GetNextFile()
bool CWineTest::GetNextFile |
( |
| ) |
|
|
private |
Gets the next module test file using the FindFirstFileW/FindNextFileW API.
- Returns
- true if we found a next file, otherwise false.
Definition at line 61 of file CWineTest.cpp.
62{
63 bool FoundFile = false;
65
66
68 {
69
71 FoundFile = true;
72 }
73 else
74 {
75
77
78
80 {
81
83 }
84 else
85 {
86
88 FindPath +=
L"_*.exe";
89 }
90
91
93
95 FoundFile = true;
96 }
97
98 if(FoundFile)
100
101 return FoundFile;
102}
#define INVALID_HANDLE_VALUE
HANDLE WINAPI FindFirstFileW(IN LPCWSTR lpFileName, OUT LPWIN32_FIND_DATAW lpFindFileData)
BOOL WINAPI FindNextFileW(IN HANDLE hFindFile, OUT LPWIN32_FIND_DATAW lpFindFileData)
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_INTERRUPT_CONFIG Configuration
Referenced by GetNextTestInfo().
◆ GetNextTest()
bool CWineTest::GetNextTest |
( |
| ) |
|
|
private |
Gets the next test from m_ListBuffer, which was filled with information from the –list command.
- Returns
- true if a next test was found, otherwise false.
Definition at line 161 of file CWineTest.cpp.
162{
166
168 {
169
171
172
174 pStart += 5;
175 }
176
177
179 {
180
182
183
186
187 return false;
188 }
189
190
191 pEnd = pStart;
192
193 while(*pEnd != '\r')
194 ++pEnd;
195
196
198
199
200 pStart = pEnd + 6;
201
202 return true;
203}
char * strchr(const char *String, int ch)
_In_ WDFMEMORY _Out_opt_ size_t * BufferSize
Referenced by GetNextTestInfo().
◆ GetNextTestInfo()
Interface to CTestList-derived classes for getting all information about the next test to be run.
- Returns
- Returns a pointer to a CTestInfo object containing all available information about the next test.
Implements CTest.
Definition at line 212 of file CWineTest.cpp.
213{
215 {
216
218 {
219 std::stringstream
ss;
223 continue;
224 }
225
226 try
227 {
229 {
230
232 continue;
233
234 {
236 size_t UnderscorePosition;
237
238
241 TestInfo->CommandLine += ' ';
243
244
246
248 {
250
253 }
254
256
257
259
260 return TestInfo.release();
261 }
262 }
263 }
265 {
267
274 }
275 }
276
278}
string StringOut(const string &String, bool forcePrint=true)
wstring AsciiToUnicode(const char *AsciiString)
◆ Run()
Interface to other classes for running all desired Wine tests.
Implements CTest.
Definition at line 364 of file CWineTest.cpp.
365{
370
371
372
373
374
375
376
378 {
379
381 }
382 else
383 {
384
386 }
387
388
391
392
395
396
397 while((TestInfo =
TestList->GetNextTestInfo()) != 0)
398 {
400
402
404 WebService->Submit("wine", TestInfo);
405
407 }
408
409
411 WebService->Finish("wine");
412
413
416}
static KSTART_ROUTINE RunTest
friend class CJournaledTestList
friend class CVirtualTestList
void reset(_Tp *__px=0) _STLP_NOTHROW
UINT WINAPI SetErrorMode(IN UINT uMode)
#define SEM_FAILCRITICALERRORS
#define SEM_NOGPFAULTERRORBOX
EH_STD::__list__< TestClass, eh_allocator(TestClass) > TestList
Referenced by wmain().
◆ RunTest()
Runs a Wine test and captures the output
- Parameters
-
TestInfo | Pointer to a CTestInfo object containing information about the test. Will contain the test log afterwards if the user wants to submit data. |
Definition at line 288 of file CWineTest.cpp.
289{
290 DWORD BytesAvailable;
293 float TotalTime;
294 string tailString;
297
298 ss <<
"Running Wine Test, Module: " << TestInfo->
Module <<
", Test: " << TestInfo->
Test <<
endl;
300
302
304
305 try
306 {
307
309
310
311 for (;;)
312 {
315 {
316
317 Buffer[BytesAvailable] = 0;
319
322 }
324 {
325
326 break;
327 }
329 {
330
331 TESTEXCEPTION(
"Timeout while waiting for the test process\n");
332 }
333 else
334 {
335
337 }
338 }
339 }
341 {
342 if(!tailString.
empty())
346 TestInfo->
Log +=
e.GetMessage();
347 }
348
349
350 if(!tailString.
empty())
352
354 ssFinish <<
"Test " << TestInfo->
Test <<
" completed in ";
357 TestInfo->
Log += ssFinish.
str();
358}
static const DWORD ProcessActivityTimeout
_STLP_PRIV _Ios_Manip_1< streamsize > _STLP_CALL setprecision(int __n)
ios_base &_STLP_CALL fixed(ios_base &__s)
_Self & append(const _CharT *__first, const _CharT *__last)
BOOL WINAPI SetCurrentDirectoryW(IN LPCWSTR lpPathName)
DWORD WINAPI GetTickCount(VOID)
static LARGE_INTEGER StartTime
static float(__cdecl *square_half_float)(float x
#define ERROR_BROKEN_PIPE
◆ m_CurrentFile
wstring CWineTest::m_CurrentFile |
|
private |
◆ m_CurrentListCommand
wstring CWineTest::m_CurrentListCommand |
|
private |
◆ m_CurrentTest
string CWineTest::m_CurrentTest |
|
private |
◆ m_hFind
◆ m_ListBuffer
PCHAR CWineTest::m_ListBuffer |
|
private |
◆ m_TestPath
wstring CWineTest::m_TestPath |
|
private |
The documentation for this class was generated from the following files: