#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}
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 156 of file CWineTest.cpp.
157{
161 CHAR TempBuffer[1024];
163
165
166
169 CommandLine +=
L" --list";
170
171
173
174 for (;;)
175 {
176
178
179
181 break;
182
183
185 break;
186
189
191 }
192
194 TESTEXCEPTION(
"WaitForSingleObject failed for the test list\n");
195
198}
static const DWORD ListTimeout
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
#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)
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR _In_opt_ PLONGLONG _In_opt_ PWDF_REQUEST_SEND_OPTIONS _Out_opt_ PULONG_PTR BytesRead
#define ERROR_BROKEN_PIPE
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 58 of file CWineTest.cpp.
59{
60 bool FoundFile = false;
62
63
66
67
69 {
70
72 {
73
74
76 {
77 FoundFile = true;
78 }
79 else
80 {
81
83 {
84 FoundFile = true;
85 }
86
87 }
88 }
89 }
90 else
91 {
92
95
96
97 if(Module.empty())
98 {
99
100 FindPath +=
L"*test.exe";
101 }
102 else
103 {
104
105 if (Module.substr(Module.length() - 4, 4) ==
L"test")
106 {
107
110 }
111 else
112 {
113
115 FindPath +=
L"_*test.exe";
116 }
117 }
118
119
121
122
124 {
125
126
128 {
129 FoundFile = true;
130 }
131 else
132 {
133
135 {
136 FoundFile = true;
137 }
138
139 }
140 }
141 }
142
143 if(FoundFile)
145
146 return FoundFile;
147}
#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)
_ACRTIMP int __cdecl _wcsicmp(const wchar_t *, const wchar_t *)
_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 207 of file CWineTest.cpp.
208{
212
214 {
215
217
219 {
223 }
224
225
227 pStart += 5;
228 }
229
230
232 {
233
235
236
239
240 return false;
241 }
242
243
244 pEnd = pStart;
245
246 while (*pEnd != '\r')
247 {
248 if (*pEnd == '\0')
250 ++pEnd;
251 }
252
253
255
256
257 pStart = pEnd + 6;
258
259 return true;
260}
basic_ostream< _CharT, _Traits > &_STLP_CALL endl(basic_ostream< _CharT, _Traits > &__os)
_ACRTIMP char *__cdecl strchr(const char *, int)
string UnicodeToAscii(PCWSTR UnicodeString)
_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 269 of file CWineTest.cpp.
270{
272 {
273
275 {
276 std::stringstream
ss;
280 continue;
281 }
282
283 try
284 {
286 {
287
289 continue;
290
291 {
293 size_t UnderscorePosition;
294
295
298 TestInfo->CommandLine += ' ';
300
301
303
305 {
306
310 }
311
313
314
316
317 return TestInfo.release();
318 }
319 }
320 }
322 {
324
331 }
332 }
333
335}
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 421 of file CWineTest.cpp.
422{
427
428
429
430
431
432
433
435 {
436
438 }
439 else
440 {
441
443 }
444
445
447 {
449 {
450 StringOut(
"[ROSAUTOTEST] Using libcurl\n");
452 }
453 else
454 {
455 StringOut(
"[ROSAUTOTEST] Using wininet\n");
457 }
458 }
459
460
463
464
465 while((TestInfo =
TestList->GetNextTestInfo()) != 0)
466 {
468
470
472 WebService->Submit("wine", TestInfo);
473
475 }
476
477
479 WebService->Finish("wine");
480
481
484}
static KSTART_ROUTINE RunTest
friend class CJournaledTestList
friend class CVirtualTestList
static bool CanUseLibCurl()
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 345 of file CWineTest.cpp.
346{
347 DWORD BytesAvailable;
350 float TotalTime;
351 string tailString;
354
355 ss <<
"Running Wine Test, Module: " << TestInfo->
Module <<
", Test: " << TestInfo->
Test <<
endl;
357
359
361
362 try
363 {
364
366
367
368 for (;;)
369 {
372 {
373
374 Buffer[BytesAvailable] = 0;
376
379 }
381 {
382
383 break;
384 }
386 {
387
388 TESTEXCEPTION(
"Timeout while waiting for the test process\n");
389 }
390 else
391 {
392
394 }
395 }
396 }
398 {
399 if(!tailString.
empty())
403 TestInfo->
Log +=
e.GetMessage();
404 }
405
406
407 if(!tailString.
empty())
409
411 ssFinish <<
"Test " << TestInfo->
Test <<
" completed in ";
414 TestInfo->
Log += ssFinish.
str();
415}
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)
ULONG WINAPI DECLSPEC_HOTPATCH GetTickCount(void)
static LARGE_INTEGER StartTime
static float(__cdecl *square_half_float)(float x
◆ 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_ListString
| std::string CWineTest::m_ListString |
|
private |
◆ m_TestPath
The documentation for this class was generated from the following files: