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;
91 void runTest()
override
93 beginTest (
"Child Processes");
95 #if JUCE_WINDOWS || JUCE_MAC || JUCE_LINUX
99 expect (p.start (
"tasklist"));
101 expect (p.start (
"ls /"));
110static ChildProcessTests childProcessUnitTests;
Holds a resizable array of primitive or copy-by-value objects.
Array()=default
Creates an empty array.
uint32 getExitCode() const
If the process has finished, this returns its exit code.
String readAllProcessOutput()
Blocks until the process has finished, and then returns its complete output as a string.
int readProcessOutput(void *destBuffer, int numBytesToRead)
Attempts to read some output from the child process.
~ChildProcess()
Destructor.
bool isRunning() const
Returns true if the child process is alive.
bool waitForProcessToFinish(int timeoutMs) const
Blocks until the process is no longer running.
bool kill()
Attempts to kill the child process.
ChildProcess()
Creates a process object.
Writes data to an internal memory buffer, which grows as required.
String toString() const
Attempts to detect the encoding of the data and convert it to a string.
bool write(const void *, size_t) override
Writes a block of data to the stream.
static void JUCE_CALLTYPE sleep(int milliseconds)
Suspends the execution of the current thread until the specified timeout period has elapsed (note tha...
static uint32 getMillisecondCounter() noexcept
Returns the number of millisecs since a fixed event (usually system startup).
This is a base class for classes that perform a unit test.