31 return activeProcess !=
nullptr && activeProcess->isRunning();
36 return activeProcess !=
nullptr ? activeProcess->read (dest, numBytes) : 0;
41 return activeProcess ==
nullptr || activeProcess->killProcess();
46 return activeProcess !=
nullptr ? activeProcess->getExitCode() : 0;
92 :
UnitTest (
"ChildProcess", UnitTestCategories::threads)
95 void runTest()
override
97 beginTest (
"Child Processes");
99 #if JUCE_WINDOWS || JUCE_MAC || JUCE_LINUX
103 expect (p.start (
"tasklist"));
105 expect (p.start (
"ls /"));
108 auto output = p.readAllProcessOutput();
109 expect (output.isNotEmpty());
114static ChildProcessTests childProcessUnitTests;
uint32 getExitCode() const
String readAllProcessOutput()
int readProcessOutput(void *destBuffer, int numBytesToRead)
bool waitForProcessToFinish(int timeoutMs) const
bool write(const void *, size_t) override
static void JUCE_CALLTYPE sleep(int milliseconds)
static uint32 getMillisecondCounter() noexcept