]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/commands/TestScriptExecutor.java
Minor SCL enhancements and fixes for logging and test executing
[simantics/platform.git] / bundles / org.simantics.scl.compiler / src / org / simantics / scl / compiler / commands / TestScriptExecutor.java
index ab39d538a23a4f808440855956ea15a5b8e02d40..4afeef91c69b83f884aaacaa4b3baeb2e965d862 100644 (file)
@@ -12,11 +12,17 @@ public class TestScriptExecutor {
     private final CommandSession session;
     private final BufferedReader reader;
     private final SCLReportingHandler handler;
+    private boolean ignorePrints;
     
     public TestScriptExecutor(CommandSession session, BufferedReader reader, SCLReportingHandler handler) {
+        this(session, reader, handler, false);
+    }
+    
+    public TestScriptExecutor(CommandSession session, BufferedReader reader, SCLReportingHandler handler, boolean ignorePrints) {
         this.session = session;
         this.reader = reader;
         this.handler = handler == null ? SCLReportingHandler.DEFAULT : handler;
+        this.ignorePrints = ignorePrints;
     }
 
     public void execute() throws IOException {
@@ -67,7 +73,8 @@ public class TestScriptExecutor {
                     @Override
                     public void print(String text) {
                         handler.print(text);
-                        actualResponse.append(text).append('\n');
+                        if (!ignorePrints)
+                            actualResponse.append(text).append('\n');
                     }
                     
                     @Override