ext: Force testlib to only create one Log object
authorHoa Nguyen <hoanguyen@ucdavis.edu>
Sat, 29 Aug 2020 09:35:11 +0000 (02:35 -0700)
committerHoa Nguyen <hoanguyen@ucdavis.edu>
Tue, 8 Sep 2020 18:28:17 +0000 (18:28 +0000)
Log object should remain being a singleton throughout the program.
The current code creates multiple Log objects, which at least
causes the issues of missing outputs in stdout.

E.g., "Logging call to command", which logs which command is
being called in a subprocess, is missing from stdout.

Change-Id: I96c5dd79c4f14e0a013c15d42d202397488d56b6
Signed-off-by: Hoa Nguyen <hoanguyen@ucdavis.edu>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/33715
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>

ext/testlib/runner.py

index 7425e795df07cafb93d5c8560b9fd61198e3441a..a59aca3a49e6733a75960a1087f880d60e63d331 100644 (file)
@@ -77,7 +77,8 @@ class TestParameters(object):
     def __init__(self, test, suite):
         self.test = test
         self.suite = suite
-        self.log = log.Log(test)
+        self.log = log.test_log
+        self.log.test = test
 
     @helper.cacheresult
     def _fixtures(self):