mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-11-22 06:29:23 +01:00
test-runner: fix verbose output with --valgrind
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.
This commit is contained in:
parent
acbbedb9d3
commit
4085aceb4a
@ -194,8 +194,11 @@ class Process:
|
|||||||
self.io_position = self.stdout.tell()
|
self.io_position = self.stdout.tell()
|
||||||
|
|
||||||
if ctx:
|
if ctx:
|
||||||
# Verbose requested, add stdout/stderr to write FD list
|
# Verbose requested, add stdout/stderr to write FD list.
|
||||||
if self.name in ctx.args.verbose:
|
# 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
|
self.verbose = True
|
||||||
|
|
||||||
# Add output file to FD list
|
# Add output file to FD list
|
||||||
@ -693,14 +696,14 @@ class Namespace:
|
|||||||
pid = self.start_process(args, env=env)
|
pid = self.start_process(args, env=env)
|
||||||
return pid
|
return pid
|
||||||
|
|
||||||
def is_verbose(self, process):
|
def is_verbose(self, process, log=True):
|
||||||
process = os.path.basename(process)
|
process = os.path.basename(process)
|
||||||
|
|
||||||
if self.args is None:
|
if self.args is None:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
# every process is verbose when logging is enabled
|
# every process is verbose when logging is enabled
|
||||||
if self.args.log:
|
if log and self.args.log:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
if process in self.args.verbose:
|
if process in self.args.verbose:
|
||||||
|
Loading…
Reference in New Issue
Block a user