mirror of
https://github.com/Telecominfraproject/wlan-cloud-lib-poco.git
synced 2025-12-20 12:27:01 +00:00
Merge remote-tracking branch 'pocoproject@github/develop' into PocoCppUnit
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
#include "Poco/Process.h"
|
||||
#include "Poco/Pipe.h"
|
||||
#include "Poco/PipeStream.h"
|
||||
#include "Poco/Thread.h"
|
||||
#include <csignal>
|
||||
|
||||
|
||||
@@ -176,6 +177,27 @@ void ProcessTest::testIsRunning()
|
||||
}
|
||||
|
||||
|
||||
void ProcessTest::testIsRunningAllowsForTermination()
|
||||
{
|
||||
#if !defined(_WIN32_WCE)
|
||||
std::string name("TestApp");
|
||||
std::string cmd;
|
||||
|
||||
#if defined(POCO_OS_FAMILY_UNIX)
|
||||
cmd = "./";
|
||||
cmd += name;
|
||||
#else
|
||||
cmd = name;
|
||||
#endif
|
||||
|
||||
std::vector<std::string> args;
|
||||
ProcessHandle ph = Process::launch(cmd, args, 0, 0, 0);
|
||||
while (Process::isRunning(ph))
|
||||
Poco::Thread::sleep(100);
|
||||
#endif // !defined(_WIN32_WCE)
|
||||
}
|
||||
|
||||
|
||||
void ProcessTest::testSignalExitCode()
|
||||
{
|
||||
#if defined(POCO_OS_FAMILY_UNIX)
|
||||
@@ -213,6 +235,7 @@ CppUnit::Test* ProcessTest::suite()
|
||||
CppUnit_addTest(pSuite, ProcessTest, testLaunchRedirectOut);
|
||||
CppUnit_addTest(pSuite, ProcessTest, testLaunchEnv);
|
||||
CppUnit_addTest(pSuite, ProcessTest, testIsRunning);
|
||||
CppUnit_addTest(pSuite, ProcessTest, testIsRunningAllowsForTermination);
|
||||
CppUnit_addTest(pSuite, ProcessTest, testSignalExitCode);
|
||||
|
||||
return pSuite;
|
||||
|
||||
Reference in New Issue
Block a user