commit 4682c22ecea19456431e522f0298da29e3be545f
parent c10bd14cde54e306716daed6074a4a1f0276146c
Author: James Prestwood <prestwoj@gmail.com>
Date: Thu, 18 Feb 2021 12:19:32 -0800
test-runner: add __str__ method to Process
Printing out processes was done manually but instead we can
make Process printing extendable by adding its own __str__
method. This now will print if the process is a multi-test
process as well.
Diffstat:
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/tools/test-runner b/tools/test-runner
@@ -310,6 +310,11 @@ class Process:
if waited > wait:
raise Exception("Timed out waiting for socket")
+ def __str__(self):
+ ret = str(self.args) + ' multi_test=%s' % str(self.multi_test)
+ ret += '\n'
+ return ret
+
class Interface:
def __init__(self, name, config):
self.name = name
@@ -678,7 +683,7 @@ class Namespace:
ret = 'Namespace: %s\n' % self.name
ret += 'Processes:\n'
for p in self.processes:
- ret += '\t%s\n' % str(p.args)
+ ret += '\t%s' % str(p)
ret += 'Radios:\n'
if len(self.radios) > 0: