2 * PROJECT: ReactOS Automatic Testing Utility
3 * LICENSE: GNU GPLv2 or any later version as published by the Free Software Foundation
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 << " /r - Maintain information to resume from ReactOS crashes" << endl
27 << " Can only be run under ReactOS and relies on sysreg2," << endl
28 << " so incompatible with /w" << endl
29 << " /s - Shut down the system after finishing the tests." << endl
30 << " /w - Submit the results to the webservice." << endl
31 << " Requires a \"rosautotest.ini\" with valid login data." << endl
32 << " Incompatible with the /r option." << endl
35 << " The module to be tested (i.e. \"advapi32\")" << endl
36 << " If this parameter is specified without any test parameter," << endl
37 << " all tests of the specified module are run." << endl
40 << " The test to be run. Needs to be a test of the specified module." << endl
;
47 wmain(int argc
, wchar_t* argv
[])
56 /* Set up the configuration */
57 Configuration
.ParseParameters(argc
, argv
);
58 Configuration
.GetSystemInformation();
59 Configuration
.GetConfigurationFromFile();
61 ss
<< "\n\nSystem uptime " << setprecision(2) << fixed
;
62 ss
<< ((float)GetTickCount()/1000) << " seconds\n";
65 /* Report tests startup */
68 EVENTLOG_INFORMATION_TYPE
,
81 DbgPrint("SYSREG_CHECKPOINT:THIRDBOOT_COMPLETE\n");
85 catch(CInvalidParameterException
)
89 catch(CSimpleException
& e
)
91 StringOut(e
.GetMessage());
93 catch(CFatalException
& e
)
97 ss
<< "An exception occured in rosautotest." << endl
98 << "Message: " << e
.GetMessage() << endl
99 << "File: " << e
.GetFile() << endl
100 << "Line: " << e
.GetLine() << endl
101 << "Last Win32 Error: " << GetLastError() << endl
;
105 /* For sysreg2 to notice if rosautotest itself failed */
107 DbgPrint("SYSREG_ROSAUTOTEST_FAILURE\n");
109 /* Report successful end of tests */
113 MSG_TESTS_SUCCESSFUL
,
121 /* Shut down the system if requested, also in case of an exception above */
122 if(Configuration
.DoShutdown() && !ShutdownSystem())