STAMP-project / test-runner

test driver to run JUnit tests isolated in a new JVM
GNU General Public License v3.0
16 stars 15 forks source link

Refactor: redirection of IO in EntryPoint #136

Open danglotb opened 2 years ago

danglotb commented 2 years ago

It looks like there is a clash between the management of the redirection of the IO

https://github.com/STAMP-project/test-runner/blob/adb1c99d209a76ecbd1aca2e28a168dac2429800/src/main/java/eu/stamp_project/testrunner/EntryPoint.java#L750-L769

The condition EntryPoint.verbose && EntryPoint.outPrintStream != null is checked twice and has two different bodies.

pb.redirectOutput(Redirect.PIPE);
pb.redirectError(Redirect.PIPE);

vs

inheritIO(process.getInputStream(), EntryPoint.outPrintStream); 
inheritIO(process.getErrorStream(), EntryPoint.outPrintStream);