2 * PROJECT: ReactOS Automatic Testing Utility
3 * LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
4 * PURPOSE: Main implementation file
5 * COPYRIGHT: Copyright 2008-2009 Colin Finck (colin@reactos.org)
11 CConfiguration Configuration
;
14 * Prints the application usage.
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
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
41 << " The test to be run. Needs to be a test of the specified module." << endl
;
48 wmain(int argc
, wchar_t* argv
[])
57 /* Set up the configuration */
58 Configuration
.ParseParameters(argc
, argv
);
59 Configuration
.GetSystemInformation();
60 Configuration
.GetConfigurationFromFile();
64 << "[ROSAUTOTEST] System uptime " << setprecision(2) << fixed
;
65 ss
<< ((float)GetTickCount()/1000) << " seconds" << endl
;
68 /* Report tests startup */
71 EVENTLOG_INFORMATION_TYPE
,
84 DbgPrint("SYSREG_CHECKPOINT:THIRDBOOT_COMPLETE\n");
88 catch(CInvalidParameterException
)
92 catch(CSimpleException
& e
)
96 // e.GetMessage() must include ending '\n'.
97 ss
<< "[ROSAUTOTEST] " << e
.GetMessage();
100 catch(CFatalException
& e
)
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
;
113 /* For sysreg2 to notice if rosautotest itself failed */
115 DbgPrint("SYSREG_ROSAUTOTEST_FAILURE\n");
117 /* Report successful end of tests */
121 MSG_TESTS_SUCCESSFUL
,
129 /* Shut down the system if requested, also in case of an exception above */
130 if(Configuration
.DoShutdown() && !ShutdownSystem())