#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 144 of file CWineTest.cpp.
145{
146 DWORD BytesAvailable;
150
151
154 CommandLine +=
L" --list";
155
156 {
157
159
160
162 TESTEXCEPTION(
"WaitForSingleObject failed for the test list\n");
163 }
164
165
168
169
170 if(!BytesAvailable)
171 {
173
176 }
177
178
180
183
184 return BytesAvailable;
185}
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)
__crt_unique_heap_ptr< wchar_t > const wstring(_malloc_crt_t(wchar_t, maxsize))
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 {
72
73
75 {
76 FoundFile = true;
77 }
78 else
79 {
80
82 {
83 FoundFile = true;
84 }
85
86 }
87 }
88 }
89 else
90 {
91
93
94
96 {
97
99 }
100 else
101 {
102
104 FindPath +=
L"_*.exe";
105 }
106
107
109
110
112 {
113
114
116 {
117 FoundFile = true;
118 }
119 else
120 {
121
123 {
124 FoundFile = true;
125 }
126
127 }
128 }
129 }
130
131 if(FoundFile)
133
134 return FoundFile;
135}
#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)
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
_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 194 of file CWineTest.cpp.
195{
199
201 {
202
204
205
207 pStart += 5;
208 }
209
210
212 {
213
215
216
219
220 return false;
221 }
222
223
224 pEnd = pStart;
225
226 while(*pEnd != '\r')
227 ++pEnd;
228
229
231
232
233 pStart = pEnd + 6;
234
235 return true;
236}
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 245 of file CWineTest.cpp.
246{
248 {
249
251 {
252 std::stringstream
ss;
256 continue;
257 }
258
259 try
260 {
262 {
263
265 continue;
266
267 {
269 size_t UnderscorePosition;
270
271
274 TestInfo->CommandLine += ' ';
276
277
279
281 {
283
286 }
287
289
290
292
293 return TestInfo.release();
294 }
295 }
296 }
298 {
300
307 }
308 }
309
311}
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 397 of file CWineTest.cpp.
398{
403
404
405
406
407
408
409
411 {
412
414 }
415 else
416 {
417
419 }
420
421
424
425
428
429
430 while((TestInfo =
TestList->GetNextTestInfo()) != 0)
431 {
433
435
437 WebService->Submit("wine", TestInfo);
438
440 }
441
442
444 WebService->Finish("wine");
445
446
449}
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 321 of file CWineTest.cpp.
322{
323 DWORD BytesAvailable;
326 float TotalTime;
327 string tailString;
330
331 ss <<
"Running Wine Test, Module: " << TestInfo->
Module <<
", Test: " << TestInfo->
Test <<
endl;
333
335
337
338 try
339 {
340
342
343
344 for (;;)
345 {
348 {
349
350 Buffer[BytesAvailable] = 0;
352
355 }
357 {
358
359 break;
360 }
362 {
363
364 TESTEXCEPTION(
"Timeout while waiting for the test process\n");
365 }
366 else
367 {
368
370 }
371 }
372 }
374 {
375 if(!tailString.
empty())
379 TestInfo->
Log +=
e.GetMessage();
380 }
381
382
383 if(!tailString.
empty())
385
387 ssFinish <<
"Test " << TestInfo->
Test <<
" completed in ";
390 TestInfo->
Log += ssFinish.
str();
391}
static const DWORD ProcessActivityTimeout
_STLP_PRIV _Ios_Manip_1< streamsize > _STLP_CALL setprecision(int __n)
_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
◆ 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
The documentation for this class was generated from the following files: