mirror of
https://github.com/reactos/reactos.git
synced 2025-05-15 07:17:23 +00:00
Add a /c option to supply a comment for the web service submission.
This can be useful for giving more information about the used build for the test. The necessary changes in testman will follow later :-P svn path=/trunk/; revision=39698
This commit is contained in:
parent
f808139835
commit
a98eb8d135
3 changed files with 84 additions and 55 deletions
|
@ -73,13 +73,9 @@ IntGetConfigurationValues()
|
||||||
PCHAR UserName = NULL;
|
PCHAR UserName = NULL;
|
||||||
WCHAR ConfigFile[MAX_PATH];
|
WCHAR ConfigFile[MAX_PATH];
|
||||||
|
|
||||||
/* We only need this if the results are going to be submitted */
|
/* Most values are only needed if we're going to submit */
|
||||||
if(!AppOptions.Submit)
|
if(AppOptions.Submit)
|
||||||
{
|
{
|
||||||
ReturnValue = TRUE;
|
|
||||||
goto Cleanup;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Build the path to the configuration file from the application's path */
|
/* Build the path to the configuration file from the application's path */
|
||||||
GetModuleFileNameW(NULL, ConfigFile, MAX_PATH);
|
GetModuleFileNameW(NULL, ConfigFile, MAX_PATH);
|
||||||
Length = wcsrchr(ConfigFile, '\\') - ConfigFile;
|
Length = wcsrchr(ConfigFile, '\\') - ConfigFile;
|
||||||
|
@ -125,6 +121,11 @@ IntGetConfigurationValues()
|
||||||
strcat(AuthenticationRequestString, PasswordProp);
|
strcat(AuthenticationRequestString, PasswordProp);
|
||||||
EscapeString(&AuthenticationRequestString[strlen(AuthenticationRequestString)], Password);
|
EscapeString(&AuthenticationRequestString[strlen(AuthenticationRequestString)], Password);
|
||||||
|
|
||||||
|
/* If we don't have any Comment string yet, try to find one in the INI file */
|
||||||
|
if(!AppOptions.Comment)
|
||||||
|
IntGetINIValueA(L"Submission", L"Comment", ConfigFile, &AppOptions.Comment);
|
||||||
|
}
|
||||||
|
|
||||||
ReturnValue = TRUE;
|
ReturnValue = TRUE;
|
||||||
|
|
||||||
Cleanup:
|
Cleanup:
|
||||||
|
@ -236,6 +237,9 @@ IntPrintUsage()
|
||||||
printf("Usage: rosautotest [options] [module] [test]\n");
|
printf("Usage: rosautotest [options] [module] [test]\n");
|
||||||
printf(" options:\n");
|
printf(" options:\n");
|
||||||
printf(" /? - Shows this help\n");
|
printf(" /? - Shows this help\n");
|
||||||
|
printf(" /c <comment> - Specifies the comment to be submitted to the Web Service.\n");
|
||||||
|
printf(" Skips the comment set in the configuration file (if any).\n");
|
||||||
|
printf(" Only has an effect when /w is also used.\n");
|
||||||
printf(" /s - Shut down the system after finishing the tests\n");
|
printf(" /s - Shut down the system after finishing the tests\n");
|
||||||
printf(" /w - Submit the results to the webservice\n");
|
printf(" /w - Submit the results to the webservice\n");
|
||||||
printf(" Requires a \"rosautotest.ini\" with valid login data.\n");
|
printf(" Requires a \"rosautotest.ini\" with valid login data.\n");
|
||||||
|
@ -256,6 +260,7 @@ int
|
||||||
wmain(int argc, wchar_t* argv[])
|
wmain(int argc, wchar_t* argv[])
|
||||||
{
|
{
|
||||||
int ReturnValue = 0;
|
int ReturnValue = 0;
|
||||||
|
size_t Length;
|
||||||
UINT i;
|
UINT i;
|
||||||
|
|
||||||
hProcessHeap = GetProcessHeap();
|
hProcessHeap = GetProcessHeap();
|
||||||
|
@ -267,6 +272,16 @@ wmain(int argc, wchar_t* argv[])
|
||||||
{
|
{
|
||||||
switch(argv[i][1])
|
switch(argv[i][1])
|
||||||
{
|
{
|
||||||
|
case 'c':
|
||||||
|
++i;
|
||||||
|
|
||||||
|
/* Copy the parameter converted to ASCII */
|
||||||
|
Length = WideCharToMultiByte(CP_ACP, 0, argv[i], -1, NULL, 0, NULL, NULL);
|
||||||
|
AppOptions.Comment = HeapAlloc(hProcessHeap, 0, Length);
|
||||||
|
WideCharToMultiByte(CP_ACP, 0, argv[i], -1, AppOptions.Comment, Length, NULL, NULL);
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
case 's':
|
case 's':
|
||||||
AppOptions.Shutdown = TRUE;
|
AppOptions.Shutdown = TRUE;
|
||||||
break;
|
break;
|
||||||
|
@ -286,8 +301,6 @@ wmain(int argc, wchar_t* argv[])
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
size_t Length;
|
|
||||||
|
|
||||||
/* Which parameter is this? */
|
/* Which parameter is this? */
|
||||||
if(!AppOptions.Module)
|
if(!AppOptions.Module)
|
||||||
{
|
{
|
||||||
|
@ -322,6 +335,9 @@ wmain(int argc, wchar_t* argv[])
|
||||||
OutputDebugStringA("SYSREG_CHECKPOINT:THIRDBOOT_COMPLETE\n");
|
OutputDebugStringA("SYSREG_CHECKPOINT:THIRDBOOT_COMPLETE\n");
|
||||||
|
|
||||||
Cleanup:
|
Cleanup:
|
||||||
|
if(AppOptions.Comment)
|
||||||
|
HeapFree(hProcessHeap, 0, AppOptions.Comment);
|
||||||
|
|
||||||
if(AppOptions.Module)
|
if(AppOptions.Module)
|
||||||
HeapFree(hProcessHeap, 0, AppOptions.Module);
|
HeapFree(hProcessHeap, 0, AppOptions.Module);
|
||||||
|
|
||||||
|
|
|
@ -26,6 +26,7 @@ typedef struct _APP_OPTIONS
|
||||||
{
|
{
|
||||||
BOOL Shutdown;
|
BOOL Shutdown;
|
||||||
BOOL Submit;
|
BOOL Submit;
|
||||||
|
PCHAR Comment;
|
||||||
PWSTR Module;
|
PWSTR Module;
|
||||||
PCHAR Test;
|
PCHAR Test;
|
||||||
}
|
}
|
||||||
|
|
|
@ -142,6 +142,7 @@ PCHAR
|
||||||
GetTestID(TESTTYPES TestType)
|
GetTestID(TESTTYPES TestType)
|
||||||
{
|
{
|
||||||
const CHAR GetTestIDAction[] = "gettestid";
|
const CHAR GetTestIDAction[] = "gettestid";
|
||||||
|
const CHAR CommentProp[] = "&comment=";
|
||||||
|
|
||||||
DWORD DataLength;
|
DWORD DataLength;
|
||||||
PCHAR Data;
|
PCHAR Data;
|
||||||
|
@ -150,6 +151,10 @@ GetTestID(TESTTYPES TestType)
|
||||||
/* Build the full request string */
|
/* Build the full request string */
|
||||||
DataLength = sizeof(ActionProp) - 1 + sizeof(GetTestIDAction) - 1;
|
DataLength = sizeof(ActionProp) - 1 + sizeof(GetTestIDAction) - 1;
|
||||||
DataLength += strlen(AuthenticationRequestString) + strlen(SystemInfoRequestString);
|
DataLength += strlen(AuthenticationRequestString) + strlen(SystemInfoRequestString);
|
||||||
|
|
||||||
|
if(AppOptions.Comment)
|
||||||
|
DataLength += sizeof(CommentProp) - 1 + strlen(AppOptions.Comment);
|
||||||
|
|
||||||
DataLength += sizeof(TestTypeProp) - 1;
|
DataLength += sizeof(TestTypeProp) - 1;
|
||||||
|
|
||||||
switch(TestType)
|
switch(TestType)
|
||||||
|
@ -164,6 +169,13 @@ GetTestID(TESTTYPES TestType)
|
||||||
strcat(Data, GetTestIDAction);
|
strcat(Data, GetTestIDAction);
|
||||||
strcat(Data, AuthenticationRequestString);
|
strcat(Data, AuthenticationRequestString);
|
||||||
strcat(Data, SystemInfoRequestString);
|
strcat(Data, SystemInfoRequestString);
|
||||||
|
|
||||||
|
if(AppOptions.Comment)
|
||||||
|
{
|
||||||
|
strcat(Data, CommentProp);
|
||||||
|
strcat(Data, AppOptions.Comment);
|
||||||
|
}
|
||||||
|
|
||||||
strcat(Data, TestTypeProp);
|
strcat(Data, TestTypeProp);
|
||||||
|
|
||||||
switch(TestType)
|
switch(TestType)
|
||||||
|
|
Loading…
Reference in a new issue