mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 23:05:36 +08:00
56 lines
1018 B
C++
56 lines
1018 B
C++
#ifndef BLACKMISCTEST_TESTSERVICETOOL_H
|
|
#define BLACKMISCTEST_TESTSERVICETOOL_H
|
|
|
|
#include <QCoreApplication>
|
|
#include <QProcess>
|
|
#ifdef Q_OS_WIN
|
|
// for qdatetime, see here http://qt-project.org/forums/viewthread/22133
|
|
#ifndef NOMINMAX
|
|
#define NOMINMAX
|
|
#endif
|
|
#include <windows.h> // for Sleep
|
|
#endif
|
|
|
|
namespace BlackMiscTest
|
|
{
|
|
|
|
/*!
|
|
* \brief Supporting functions for running the tests
|
|
*/
|
|
class TestserviceTool
|
|
{
|
|
private:
|
|
/*!
|
|
* \brief Constructor
|
|
*/
|
|
TestserviceTool() {}
|
|
|
|
public:
|
|
/*!
|
|
* \brief Get process id
|
|
* \return
|
|
*/
|
|
static qint64 getPid() {
|
|
return QCoreApplication::applicationPid();
|
|
}
|
|
|
|
/*!
|
|
* \brief Start a new process
|
|
* \param executable
|
|
* \param parent
|
|
* \return
|
|
*/
|
|
static QProcess *startNewProcess(const QString &executable, QObject *parent);
|
|
|
|
/*!
|
|
* \brief Own sleep to avoid inlude of QTest
|
|
* \param ms
|
|
*/
|
|
static void sleep(qint32 ms);
|
|
|
|
};
|
|
|
|
} // namespace
|
|
|
|
#endif // BLACKMISCTEST_TESTSERVICETOOL_H
|