ReactOS  0.4.14-dev-1338-g0d187f7
main.cpp File Reference
#include "precomp.h"
#include <cstdio>
Include dependency graph for main.cpp:

Go to the source code of this file.

Functions

static void IntPrintUsage ()
 
int wmain (int argc, wchar_t *argv[])
 

Variables

CConfiguration Configuration
 

Function Documentation

◆ IntPrintUsage()

static void IntPrintUsage ( )
static

Prints the application usage.

Definition at line 17 of file main.cpp.

18 {
19  cout << "rosautotest - ReactOS Automatic Testing Utility" << endl
20  << "Usage: rosautotest [options] [module] [test]" << endl
21  << " options:" << endl
22  << " /? - Shows this help." << endl
23  << " /c <comment> - Specifies the comment to be submitted to the Web Service." << endl
24  << " Skips the comment set in the configuration file (if any)." << endl
25  << " Only has an effect when /w is also used." << endl
26  << " /n - Do not print test output to console" << endl
27  << " /r - Maintain information to resume from ReactOS crashes" << endl
28  << " Can only be run under ReactOS and relies on sysreg2," << endl
29  << " so incompatible with /w" << endl
30  << " /s - Shut down the system after finishing the tests." << endl
31  << " /w - Submit the results to the webservice." << endl
32  << " Requires a \"rosautotest.ini\" with valid login data." << endl
33  << " Incompatible with the /r option." << endl
34  << endl
35  << " module:" << endl
36  << " The module to be tested (i.e. \"advapi32\")" << endl
37  << " If this parameter is specified without any test parameter," << endl
38  << " all tests of the specified module are run." << endl
39  << endl
40  << " test:" << endl
41  << " The test to be run. Needs to be a test of the specified module." << endl;
42 }
#define cout
Definition: iostream.cpp:38
basic_ostream< _CharT, _Traits > &_STLP_CALL endl(basic_ostream< _CharT, _Traits > &__os)
Definition: _ostream.h:357

Referenced by wmain().

◆ wmain()

int wmain ( int  argc,
wchar_t argv[] 
)

Main entry point

Definition at line 48 of file main.cpp.

49 {
50  CWineTest WineTest;
51  int ReturnValue = 1;
52 
53  try
54  {
56 
57  /* Set up the configuration */
61 
62  ss << endl
63  << endl
64  << "[ROSAUTOTEST] System uptime " << setprecision(2) << fixed;
65  ss << ((float)GetTickCount()/1000) << " seconds" << endl;
66  StringOut(ss.str());
67 
68  /* Report tests startup */
69  InitLogs();
72  0,
73  MSG_TESTS_STARTED,
74  NULL,
75  0,
76  0,
77  NULL,
78  NULL);
79 
80  /* Run the tests */
81  WineTest.Run();
82 
83  /* For sysreg2 */
84  DbgPrint("SYSREG_CHECKPOINT:THIRDBOOT_COMPLETE\n");
85 
86  ReturnValue = 0;
87  }
89  {
90  IntPrintUsage();
91  }
92  catch(CSimpleException& e)
93  {
95 
96  // e.GetMessage() must include ending '\n'.
97  ss << "[ROSAUTOTEST] " << e.GetMessage();
98  StringOut(ss.str());
99  }
100  catch(CFatalException& e)
101  {
103 
104  // e.GetMessage() must include ending '\n'.
105  ss << "An exception occured in rosautotest." << endl
106  << "Message: " << e.GetMessage()
107  << "File: " << e.GetFile() << endl
108  << "Line: " << e.GetLine() << endl
109  << "Last Win32 Error: " << GetLastError() << endl;
110  StringOut(ss.str());
111  }
112 
113  /* For sysreg2 to notice if rosautotest itself failed */
114  if(ReturnValue == 1)
115  DbgPrint("SYSREG_ROSAUTOTEST_FAILURE\n");
116 
117  /* Report successful end of tests */
120  0,
121  MSG_TESTS_SUCCESSFUL,
122  NULL,
123  0,
124  0,
125  NULL,
126  NULL);
127  FreeLogs();
128 
129  /* Shut down the system if requested, also in case of an exception above */
131  ReturnValue = 1;
132 
133  return ReturnValue;
134 }
static int argc
Definition: ServiceArgs.c:12
bool ShutdownSystem()
Definition: shutdown.cpp:16
static void IntPrintUsage()
Definition: main.cpp:17
#define DbgPrint
Definition: loader.c:25
bool DoShutdown() const
DWORD WINAPI GetTickCount(VOID)
Definition: time.c:455
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
_STLP_PRIV _Ios_Manip_1< streamsize > _STLP_CALL setprecision(int __n)
Definition: _iomanip.h:119
#define argv
Definition: mplay32.c:18
VOID FreeLogs()
Definition: misc.cpp:232
void Run()
Definition: CWineTest.cpp:352
VOID InitLogs()
Definition: misc.cpp:186
ios_base &_STLP_CALL fixed(ios_base &__s)
Definition: _ios_base.h:332
UINT32 void void ** ReturnValue
Definition: acevents.h:214
basic_ostream< _CharT, _Traits > &_STLP_CALL endl(basic_ostream< _CharT, _Traits > &__os)
Definition: _ostream.h:357
#define e
Definition: ke_i.h:82
smooth NULL
Definition: ftsmooth.c:416
void ParseParameters(int argc, wchar_t *argv[])
void GetConfigurationFromFile()
#define EVENTLOG_SUCCESS
Definition: winnt_old.h:2629
#define EVENTLOG_INFORMATION_TYPE
Definition: winnt_old.h:2632
static HANDLE hLog
Definition: misc.cpp:14
string StringOut(const string &String, bool forcePrint=true)
Definition: tools.cpp:96
CConfiguration Configuration
Definition: main.cpp:11
BOOL WINAPI ReportEventW(IN HANDLE hEventLog, IN WORD wType, IN WORD wCategory, IN DWORD dwEventID, IN PSID lpUserSid, IN WORD wNumStrings, IN DWORD dwDataSize, IN LPCWSTR *lpStrings, IN LPVOID lpRawData)
Definition: eventlog.c:1516
static float(__cdecl *square_half_float)(float x
#define ss
Definition: i386-dis.c:432
void GetSystemInformation()

Variable Documentation

◆ Configuration