diff --git a/tools/run-tests b/tools/run-tests index 487ede42..bd145751 100755 --- a/tools/run-tests +++ b/tools/run-tests @@ -724,7 +724,10 @@ def start_test(ctx, subtests, rqueue): sys.__stdout__.flush() - Process.write_separators("\n====== %s:%s ======\n\n" % (file, func)) + name = os.path.basename(os.getcwd()) + + Process.write_separators(name, "\n====== %s:%s:%s ======\n\n" % + (name, file, func)) if not skip: # Run test (setUp/tearDown run automatically) diff --git a/tools/utils.py b/tools/utils.py index c2478ff2..be4c8638 100644 --- a/tools/utils.py +++ b/tools/utils.py @@ -131,12 +131,33 @@ class Process(subprocess.Popen): sys.__stdout__.flush() @classmethod - def write_separators(cls, sep): + def write_separators(cls, test, sep): + # + # There are either log running processes (cls.processes) or + # processes that have terminated already but a log file exists + # on disk. We still want the separators to show for both cases + # so after writing separators for running processes, also + # write them in any additional log files. + # + nowrite = [] + for proc in cls.processes.values(): if proc.killed: continue cls._write_io(proc, sep, stdout=False) + nowrite.append(proc.args[0]) + + if cls.testargs.log: + logfiles = os.listdir('%s/%s' % (cls.testargs.log, test)) + + extra = list(set(logfiles) - set(nowrite)) + + for log in extra: + logfile = '%s/%s/%s' % (cls.testargs.log, test, log) + with open(logfile, 'a') as f: + f.write(sep) + f.close() def process_io(self, source, condition): if condition & GLib.IO_HUP: