mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 23:05:36 +08:00
52 lines
1.0 KiB
C++
52 lines
1.0 KiB
C++
#ifndef BLACKMISCTEST_Tool_H
|
|
#define BLACKMISCTEST_Tool_H
|
|
|
|
#include "blackcore/coreruntime.h"
|
|
#include <QCoreApplication>
|
|
#include <QProcess>
|
|
#include <QDBusConnection>
|
|
|
|
namespace BlackMiscTest
|
|
{
|
|
|
|
/*!
|
|
* \brief Supporting functions for running the tests
|
|
*/
|
|
class Tool
|
|
{
|
|
private:
|
|
/*!
|
|
* \brief Constructor
|
|
*/
|
|
Tool() {}
|
|
|
|
public:
|
|
/*!
|
|
* \brief Get process id
|
|
* \return
|
|
*/
|
|
static qint64 getPid()
|
|
{
|
|
return QCoreApplication::applicationPid();
|
|
}
|
|
|
|
/*!
|
|
* \brief Start a new process
|
|
* \param executable
|
|
* \param arguments
|
|
* \param parent
|
|
* \return
|
|
*/
|
|
static QProcess *startNewProcess(const QString &executable, const QStringList &arguments = QStringList(), QObject *parent = 0);
|
|
|
|
/*!
|
|
* \brief Server loop
|
|
* \param core
|
|
*/
|
|
static void serverLoop(const BlackCore::CCoreRuntime *core);
|
|
};
|
|
|
|
} // namespace
|
|
|
|
#endif // guard
|