[ROSAUTOTEST]

If the last chunk of the string sent to StringOut isn't a whole line and forcePrint is set to false, send back what's left after processing. The caller is then responsible for prepending that string next time it calls StringOut. Should fix the rest of debug log corruptions.

svn path=/trunk/; revision=55670
This commit is contained in:
Kamil Hornicek 2012-02-17 12:31:32 +00:00
parent c0f7614fb0
commit 04135b7ce4
7 changed files with 40 additions and 25 deletions

View file

@ -266,9 +266,10 @@ CWineTest::RunTest(CTestInfo* TestInfo)
stringstream ss, ssFinish;
DWORD StartTime = GetTickCount();
float TotalTime;
string tailString;
ss << "Running Wine Test, Module: " << TestInfo->Module << ", Test: " << TestInfo->Test << endl;
StringOut(ss.str());
StringOut(ss.str(), TRUE);
StartTime = GetTickCount();
@ -299,9 +300,9 @@ CWineTest::RunTest(CTestInfo* TestInfo)
if(!ReadFile(m_hReadPipe, Buffer, BytesAvailable, &Temp, NULL))
FATAL("ReadFile failed for the test run\n");
/* Output all test output through StringOut, even while the test is still running */
/* Output text through StringOut, even while the test is still running */
Buffer[BytesAvailable] = 0;
StringOut(string(Buffer));
tailString = StringOut(tailString.append(string(Buffer)), FALSE);
if(Configuration.DoSubmit())
TestInfo->Log += Buffer;
@ -310,10 +311,14 @@ CWineTest::RunTest(CTestInfo* TestInfo)
while(!BreakLoop);
}
/* Print what's left */
if(!tailString.empty())
StringOut(tailString, TRUE);
TotalTime = ((float)GetTickCount() - StartTime)/1000;
ssFinish << "Test " << TestInfo->Test << " completed in ";
ssFinish << setprecision(2) << fixed << TotalTime << " seconds." << endl;
StringOut(ssFinish.str());
StringOut(ssFinish.str(), TRUE);
}
/**
@ -370,6 +375,6 @@ CWineTest::Run()
if(Configuration.DoSubmit() && !TestInfo->Log.empty())
WebService->Submit("wine", TestInfo);
StringOut("\n\n");
StringOut("\n\n", TRUE);
}
}