mirror of
https://github.com/reactos/reactos.git
synced 2024-08-20 02:13:29 +00:00
![Colin Finck](/assets/img/avatar_default.png)
rosautotest - Rewrite rosautotest in C++ Should increase maintainability and expandability, since most of the functionality is encapsulated in classes and there exist some abstract classes for further enhancements (i.e. new test types). Furthermore, due to the usage of STL strings, we don't need x lines anymore just for building a string out of several small parts. - The new codebase made it fairly easy to implement a Crash Recovery feature based on a journal. If you start rosautotest with the /r option under ReactOS, it will keep a journal about the tests to run and the tests already ran. In case of a crash, it can just continue with the next test in the list then. - Add some reasonable timeouts to avoid certain hangs in case a test crashes sysreg2 - Make the necessary changes to sysreg2 to restart the VM in case of such a crash in 3rd stage, but set a maximum number of allowed crashes as well. Christoph, please test and review that on the Buildslave :-) - Prepend all sysreg messages with [SYSREG] through a new function SysregPrintf, so the BuildBot aggregator script of testman can distinguish between debug output and sysreg messages. - Put all header includes into the central header file "sysreg.h" - Remove unnecessary libs from the Makefile testman - Change the testman Web Interface to show such crashes as CRASH in the Compare and Detail views. svn path=/trunk/; revision=40147
37 lines
1.2 KiB
C++
37 lines
1.2 KiB
C++
/*
|
|
* PROJECT: ReactOS Automatic Testing Utility
|
|
* LICENSE: GNU GPLv2 or any later version as published by the Free Software Foundation
|
|
* PURPOSE: Class able to create a new process and closing its handles on destruction (exception-safe)
|
|
* COPYRIGHT: Copyright 2009 Colin Finck <colin@reactos.org>
|
|
*/
|
|
|
|
#include "precomp.h"
|
|
|
|
/**
|
|
* Constructs a CProcess object and uses the CreateProcessW function to start the process immediately.
|
|
*
|
|
* @param CommandLine
|
|
* A std::wstring containing the command line to run
|
|
*
|
|
* @param StartupInfo
|
|
* Pointer to a STARTUPINFOW structure containing process startup information
|
|
*/
|
|
CProcess::CProcess(const wstring& CommandLine, LPSTARTUPINFOW StartupInfo)
|
|
{
|
|
auto_array_ptr<WCHAR> CommandLinePtr(new WCHAR[CommandLine.size() + 1]);
|
|
|
|
wcscpy(CommandLinePtr, CommandLine.c_str());
|
|
|
|
if(!CreateProcessW(NULL, CommandLinePtr, NULL, NULL, TRUE, NORMAL_PRIORITY_CLASS, NULL, NULL, StartupInfo, &m_ProcessInfo))
|
|
FATAL("CreateProcessW failed\n");
|
|
}
|
|
|
|
/**
|
|
* Destructs a CProcess object and closes all handles belonging to the process.
|
|
*/
|
|
CProcess::~CProcess()
|
|
{
|
|
CloseHandle(m_ProcessInfo.hThread);
|
|
CloseHandle(m_ProcessInfo.hProcess);
|
|
}
|