Commit 14df530b authored by apvrille's avatar apvrille

Update on diplo noc test

parent 70ae6dd3
......@@ -189,22 +189,8 @@ public class DiplodocusNoCTest extends AbstractUITest {
proc = Runtime.getRuntime().exec(params);
proc_in = new BufferedReader(new InputStreamReader(proc.getInputStream()));
proc_err = new BufferedReader(new InputStreamReader(proc.getErrorStream()));
new Thread() {
@Override public void run() {
String line;
try {
while ((line = proc_err.readLine()) != null) {
System.out.println("NOC executing err: " + line);
}
} catch (Exception e) {
System.out.println("NOC FAILED: executing: " + "make -C " + SIM_DIR);
return;
}
}
}.start();
monitorError(proc);
while ((str = proc_in.readLine()) != null) {
System.out.println("NOC executing: " + str);
......@@ -227,6 +213,8 @@ public class DiplodocusNoCTest extends AbstractUITest {
proc = Runtime.getRuntime().exec(params);
proc_in = new BufferedReader(new InputStreamReader(proc.getInputStream()));
monitorError(proc);
while ((str = proc_in.readLine()) != null) {
// TraceManager.addDev( "Sending " + str + " from " + port + " to client..." );
System.out.println("NOC executing: " + str);
......
......@@ -153,6 +153,8 @@ public class DiplodocusSimulatorTest extends AbstractUITest {
proc = Runtime.getRuntime().exec("make -C " + SIM_DIR + "");
proc_in = new BufferedReader( new InputStreamReader( proc.getInputStream() ) );
monitorError(proc);
while ( ( str = proc_in.readLine() ) != null ) {
// TraceManager.addDev( "Sending " + str + " from " + port + " to client..." );
System.out.println("executing: " + str);
......@@ -178,6 +180,8 @@ public class DiplodocusSimulatorTest extends AbstractUITest {
//proc = Runtime.getRuntime().exec("./" + SIM_DIR + "run.x -explo -gname testgraph_" + s);
proc_in = new BufferedReader( new InputStreamReader( proc.getInputStream() ) );
monitorError(proc);
while ( ( str = proc_in.readLine() ) != null ) {
// TraceManager.addDev( "Sending " + str + " from " + port + " to client..." );
System.out.println("executing: " + str);
......
package ui;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.*;
import java.util.Arrays;
import java.util.Collection;
import java.util.logging.Logger;
......@@ -79,4 +76,22 @@ public abstract class AbstractUITest extends AbstractTest {
return null;
}
protected void monitorError(Process proc) {
BufferedReader proc_err = new BufferedReader(new InputStreamReader(proc.getErrorStream()));
new Thread() {
@Override public void run() {
String line;
try {
while ((line = proc_err.readLine()) != null) {
System.out.println("NOC executing err: " + line);
}
} catch (Exception e) {
//System.out.println("FAILED reading errors");
return;
}
}
}.start();
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment