use of com.oracle.truffle.llvm.tests.pipe.CaptureNativeOutput in project graal by oracle.
the class PolyglotToolchainTest method testLDLibraryPath.
@Test
public void testLDLibraryPath() throws IOException {
try (CaptureOutput out = new CaptureNativeOutput()) {
testLibrary.getMember("print_ld_library_path").execute();
Assert.assertEquals(String.format("LD_LIBRARY_PATH=%s\n", getToolchain().getPaths("LD_LIBRARY_PATH").stream().map(TruffleFile::toString).collect(Collectors.joining(":"))), out.getStdOut());
}
}
use of com.oracle.truffle.llvm.tests.pipe.CaptureNativeOutput in project graal by oracle.
the class PolyglotToolchainTest method testCC.
@Test
public void testCC() throws IOException {
try (CaptureOutput out = new CaptureNativeOutput()) {
testLibrary.getMember("print_cc").execute();
Assert.assertEquals(String.format("CC=%s\n", getToolchain().getToolPath("CC").toString()), out.getStdOut());
}
}
use of com.oracle.truffle.llvm.tests.pipe.CaptureNativeOutput in project graal by oracle.
the class PolyglotToolchainTest method testIdentifier.
@Test
public void testIdentifier() throws IOException {
try (CaptureOutput out = new CaptureNativeOutput()) {
testLibrary.getMember("print_id").execute();
Assert.assertEquals(String.format("ID=%s\n", getToolchain().getIdentifier().toString()), out.getStdOut());
}
}
use of com.oracle.truffle.llvm.tests.pipe.CaptureNativeOutput in project graal by oracle.
the class CaptureOutputTest method testOutputCapturing2.
@Test
public void testOutputCapturing2() throws IOException {
String string = "Does it work again?";
String captured;
try (CaptureOutput out = new CaptureNativeOutput()) {
System.out.print(string);
captured = out.getStdOut();
}
System.out.println("MUST NOT BE IN CAPTURE");
assertEquals(string, captured);
}
use of com.oracle.truffle.llvm.tests.pipe.CaptureNativeOutput in project graal by oracle.
the class CaptureOutputTest method testErrCapturing2.
@Test
public void testErrCapturing2() throws IOException {
String string = "Does it work again?";
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);
}
Aggregations