summaryrefslogtreecommitdiff
path: root/chapter25/src/test/java/com/seaofnodes
diff options
context:
space:
mode:
Diffstat (limited to 'chapter25/src/test/java/com/seaofnodes')
-rw-r--r--chapter25/src/test/java/com/seaofnodes/simple/Chapter25Test.java14
1 files changed, 2 insertions, 12 deletions
diff --git a/chapter25/src/test/java/com/seaofnodes/simple/Chapter25Test.java b/chapter25/src/test/java/com/seaofnodes/simple/Chapter25Test.java
index b06f90d8..32861bc9 100644
--- a/chapter25/src/test/java/com/seaofnodes/simple/Chapter25Test.java
+++ b/chapter25/src/test/java/com/seaofnodes/simple/Chapter25Test.java
@@ -18,7 +18,6 @@ import java.io.PrintStream;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
-import java.util.concurrent.TimeUnit;
import org.junit.Ignore;
import org.junit.Test;
@@ -373,23 +372,14 @@ public class Chapter25Test {
String obj = "build/objs/"+base+".o";
String exe = "build/objs/"+base+(TestC.OS.startsWith("Windows") ? ".exe" : "");
- String syms = run(new String[]{"nm",obj});
+ String syms = TestC.exec("nm",obj);
assertTrue(syms, syms.contains(" U sys.io.p_noInline"));
TestC.linkExe(obj,null,null,new Ary<>(new String[]{SYS_FILE.toString()}),exe);
- String rez = run(new String[]{exe});
+ String rez = TestC.exec(exe);
assertEquals(expected,rez);
}
- private static String run(String[] cmd) throws Exception {
- Process p = new ProcessBuilder(cmd).redirectErrorStream(true).start();
- boolean normal = p.waitFor(5, TimeUnit.SECONDS);
- String out = new String(p.getInputStream().readAllBytes());
- assertTrue(out, normal);
- assertEquals(out,0,p.exitValue());
- return out;
- }
-
@Test
public void testRedirectedRead() throws IOException {
String src = """