From 8b97f05bdfadc26325ec0f69c26b13676875f0d5 Mon Sep 17 00:00:00 2001 From: Dan <46821332+nsadeveloper789@users.noreply.github.com> Date: Mon, 29 Jul 2024 10:53:35 -0400 Subject: [PATCH] GP-0: Squelch lldb output in batch testing mode. The progress reports about Manually indexing DWARF and the ANSI control sequences are polluting and blowing up the testing log file. Only display lldb output in the case of a failed test. --- .../lldb/rmi/AbstractLldbTraceRmiTest.java | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/Ghidra/Test/DebuggerIntegrationTest/src/test.slow/java/agent/lldb/rmi/AbstractLldbTraceRmiTest.java b/Ghidra/Test/DebuggerIntegrationTest/src/test.slow/java/agent/lldb/rmi/AbstractLldbTraceRmiTest.java index 926248844f..35b5f8287d 100644 --- a/Ghidra/Test/DebuggerIntegrationTest/src/test.slow/java/agent/lldb/rmi/AbstractLldbTraceRmiTest.java +++ b/Ghidra/Test/DebuggerIntegrationTest/src/test.slow/java/agent/lldb/rmi/AbstractLldbTraceRmiTest.java @@ -4,9 +4,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -33,7 +33,6 @@ import org.apache.commons.io.output.TeeOutputStream; import org.apache.commons.lang3.exception.ExceptionUtils; import org.hamcrest.Matchers; import org.junit.Before; -import org.junit.BeforeClass; import ghidra.app.plugin.core.debug.gui.AbstractGhidraHeadedDebuggerTest; import ghidra.app.plugin.core.debug.service.tracermi.TraceRmiPlugin; @@ -55,8 +54,7 @@ import ghidra.trace.model.breakpoint.TraceBreakpointKind; import ghidra.trace.model.breakpoint.TraceBreakpointKind.TraceBreakpointKindSet; import ghidra.trace.model.target.TraceObject; import ghidra.trace.model.target.TraceObjectValue; -import ghidra.util.Msg; -import ghidra.util.NumericUtilities; +import ghidra.util.*; public abstract class AbstractLldbTraceRmiTest extends AbstractGhidraHeadedDebuggerTest { @@ -192,8 +190,14 @@ public abstract class AbstractLldbTraceRmiTest extends AbstractGhidraHeadedDebug setPythonPath(env); env.put("TERM", "xterm-256color"); ByteArrayOutputStream capture = new ByteArrayOutputStream(); - OutputStream tee = new TeeOutputStream(System.out, capture); - Thread pumper = new StreamPumper(pty.getParent().getInputStream(), tee); + OutputStream out; + if (SystemUtilities.isInTestingBatchMode()) { + out = capture; + } + else { + out = new TeeOutputStream(System.out, capture); + } + Thread pumper = new StreamPumper(pty.getParent().getInputStream(), out); pumper.start(); PtySession lldbSession = pty.getChild().session(new String[] { lldbPath.toString() }, env);