I have a program that tests each method in a Test#
subclass and outputs XML in JUnit's XML format.
For instance:
class ExampleTest : Test
{
Void testOne()
{
...
}
}
I want to execute the testOne
method and capture the standard output and standard error produced in it. This out
and err
output will be included in the XML report.
My first idea was to look at sys::Env
. The environment class sys::Env
has err
and out
but are readonly.
My second idea is that sys::Process
can be launched for each test method and redirect sys::Process#.err
and sys::Process#.out
in it, but I'm afraid it will be very slow.
There is other way to do it?