Search in sources :

Example 11 with CaptureOutput

use of com.oracle.truffle.llvm.tests.pipe.CaptureOutput in project graal by oracle.

the class CaptureOutputTest method testErrCapturing.

@Test
public void testErrCapturing() throws IOException {
    String string = "Testoutput";
    String captured;
    try (CaptureOutput out = new CaptureNativeOutput()) {
        System.err.print(string);
        captured = out.getStdErr();
    }
    System.err.println("MUST NOT BE IN CAPTURE");
    assertEquals(string, captured);
}
Also used : CaptureOutput(com.oracle.truffle.llvm.tests.pipe.CaptureOutput) CaptureNativeOutput(com.oracle.truffle.llvm.tests.pipe.CaptureNativeOutput) Test(org.junit.Test)

Aggregations

CaptureOutput (com.oracle.truffle.llvm.tests.pipe.CaptureOutput)11 CaptureNativeOutput (com.oracle.truffle.llvm.tests.pipe.CaptureNativeOutput)10 Test (org.junit.Test)10 TruffleFile (com.oracle.truffle.api.TruffleFile)2 File (java.io.File)2 LLVMLinkerException (com.oracle.truffle.llvm.runtime.except.LLVMLinkerException)1 Context (org.graalvm.polyglot.Context)1 Builder (org.graalvm.polyglot.Context.Builder)1 Value (org.graalvm.polyglot.Value)1