All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] test-runner: fix verbose output with --valgrind
@ 2021-04-29 16:07 James Prestwood
  2021-04-29 17:57 ` Denis Kenzior
  0 siblings, 1 reply; 2+ messages in thread
From: James Prestwood @ 2021-04-29 16:07 UTC (permalink / raw)
  To: iwd

[-- Attachment #1: Type: text/plain, Size: 1663 bytes --]

Since using --valgrind actually runs IWD using the valgrind
process the --verbose flag would only work if 'valgrind' was
also specified. This was taken into account with is_verbose
but the actual logic enabling stdout did not use that helper.
This was due, in part, to logging since is_verbose will always
return true if --log is used. To fix this a new flag was added
to is_verbose which omits the --log check to handle this
specific case.
---
 tools/test-runner | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/tools/test-runner b/tools/test-runner
index 799953de..b890b3e7 100755
--- a/tools/test-runner
+++ b/tools/test-runner
@@ -194,8 +194,11 @@ class Process:
 		self.io_position = self.stdout.tell()
 
 		if ctx:
-			# Verbose requested, add stdout/stderr to write FD list
-			if self.name in ctx.args.verbose:
+			# Verbose requested, add stdout/stderr to write FD list.
+			# This will end up always returning true if logging is
+			# on which isn't desired so pass log=False as to only
+			# allow stdout to processes listed in --verbose.
+			if ctx.is_verbose(self.name, log=False):
 				self.verbose = True
 
 			# Add output file to FD list
@@ -693,14 +696,14 @@ class Namespace:
 		pid = self.start_process(args, env=env)
 		return pid
 
-	def is_verbose(self, process):
+	def is_verbose(self, process, log=True):
 		process = os.path.basename(process)
 
 		if self.args is None:
 			return False
 
 		# every process is verbose when logging is enabled
-		if self.args.log:
+		if log and self.args.log:
 			return True
 
 		if process in self.args.verbose:
-- 
2.26.2

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] test-runner: fix verbose output with --valgrind
  2021-04-29 16:07 [PATCH] test-runner: fix verbose output with --valgrind James Prestwood
@ 2021-04-29 17:57 ` Denis Kenzior
  0 siblings, 0 replies; 2+ messages in thread
From: Denis Kenzior @ 2021-04-29 17:57 UTC (permalink / raw)
  To: iwd

[-- Attachment #1: Type: text/plain, Size: 667 bytes --]

Hi James,

On 4/29/21 11:07 AM, James Prestwood wrote:
> Since using --valgrind actually runs IWD using the valgrind
> process the --verbose flag would only work if 'valgrind' was
> also specified. This was taken into account with is_verbose
> but the actual logic enabling stdout did not use that helper.
> This was due, in part, to logging since is_verbose will always
> return true if --log is used. To fix this a new flag was added
> to is_verbose which omits the --log check to handle this
> specific case.
> ---
>   tools/test-runner | 11 +++++++----
>   1 file changed, 7 insertions(+), 4 deletions(-)
> 

Applied, thanks.

Regards,
-Denis

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-04-29 17:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-29 16:07 [PATCH] test-runner: fix verbose output with --valgrind James Prestwood
2021-04-29 17:57 ` Denis Kenzior

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.