This commit is contained in:
Doug Lyons 2025-03-30 17:16:04 +02:00 committed by GitHub
commit dd4052bb3f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 69 additions and 5 deletions

View file

@ -64,11 +64,27 @@ CWineTest::GetNextFile()
WIN32_FIND_DATAW fd;
/* Did we already begin searching for files? */
if(m_hFind)
if (m_hFind)
{
/* Then get the next file (if any) */
if(FindNextFileW(m_hFind, &fd))
FoundFile = true;
if (FindNextFileW(m_hFind, &fd))
{
// printf("cFileName is '%S'.\n", fd.cFileName);
/* if it was NOT rosautotest.exe then proceed as normal */
if (wcsicmp(fd.cFileName, TestName) != 0)
{
FoundFile = true;
}
else
{
/* It was rosautotest.exe so get the next file (if any) */
if (FindNextFileW(m_hFind, &fd))
{
FoundFile = true;
}
// printf("cFileName is '%S'.\n", fd.cFileName);
}
}
}
else
{
@ -91,8 +107,25 @@ CWineTest::GetNextFile()
/* Search for the first file and check whether we got one */
m_hFind = FindFirstFileW(FindPath.c_str(), &fd);
if(m_hFind != INVALID_HANDLE_VALUE)
FoundFile = true;
/* If we returned a good handle */
if (m_hFind != INVALID_HANDLE_VALUE)
{
// printf("cFileName is '%S'.\n", fd.cFileName);
/* if it was NOT rosautotest.exe then proceed as normal */
if (wcsicmp(fd.cFileName, TestName) != 0)
{
FoundFile = true;
}
else
{
/* It was rosautotest.exe so get the next file (if any) */
if (FindNextFileW(m_hFind, &fd))
{
FoundFile = true;
}
// printf("cFileName is '%S'.\n", fd.cFileName);
}
}
}
if(FoundFile)

View file

@ -10,6 +10,8 @@
#include <ndk/setypes.h>
#include <ndk/exfuncs.h>
WCHAR TestName[MAX_PATH];
CConfiguration Configuration;
/**
@ -87,6 +89,15 @@ extern "C" int
wmain(int argc, wchar_t* argv[])
{
int ReturnValue = 1;
DWORD TestStartTime, TestEndTime;
GetModuleFileNameW(NULL, TestName, _countof(TestName));
// printf("Full TestName is '%S'\n", TestName);
WCHAR* Name = wcsrchr(TestName, '\\');
if (Name)
Name++;
memmove(TestName, Name, _countof(TestName) * sizeof(WCHAR));
// printf("Short TestName is '%S'.\n", TestName);
SetNtGlobalFlags();
@ -99,6 +110,7 @@ wmain(int argc, wchar_t* argv[])
Configuration.GetSystemInformation();
Configuration.GetConfigurationFromFile();
TestStartTime = GetTickCount();
ss << endl
<< endl
<< "[ROSAUTOTEST] System uptime " << setprecision(2) << fixed;
@ -139,6 +151,23 @@ wmain(int argc, wchar_t* argv[])
WineTest.Run();
}
/* Clear the stringstream */
ss.str("");
ss.clear();
/* Show the beginning time again */
ss << "[ROSAUTOTEST] System uptime at start was " << setprecision(2) << fixed;
ss << ((float)TestStartTime / 1000) << " seconds" << endl;
/* Show the time now so that we can see how long the tests took */
TestEndTime = GetTickCount();
ss << endl
<< "[ROSAUTOTEST] System uptime at end was " << setprecision(2) << fixed;
ss << ((float)TestEndTime / 1000) << " seconds" << endl;
ss << "[ROSAUTOTEST] Duration was " << (((float)TestEndTime - (float)TestStartTime) / 1000) / 60;
ss << " minutes" << endl;
StringOut(ss.str());
/* For sysreg2 */
DbgPrint("SYSREG_CHECKPOINT:THIRDBOOT_COMPLETE\n");

View file

@ -80,4 +80,6 @@ string StringOut(const string& String, bool forcePrint = true);
string UnicodeToAscii(PCWSTR UnicodeString);
string UnicodeToAscii(const wstring& UnicodeString);
extern WCHAR TestName[MAX_PATH];
#endif /* _ROSAUTOTEST_H_ */