From: Tim Newsome Date: Thu, 13 Jul 2017 03:26:21 +0000 (-0700) Subject: Print out logs in more failure cases. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=cf95e52b21a842cb77d39d25a2c1796c6a5be2a2;p=riscv-tests.git Print out logs in more failure cases. --- diff --git a/debug/testlib.py b/debug/testlib.py index c44a763..ce2ec2e 100644 --- a/debug/testlib.py +++ b/debug/testlib.py @@ -540,8 +540,15 @@ class BaseTest(object): def classSetup(self): self.compile() self.target_process = self.target.create() - self.server = self.target.server() - self.logs.append(self.server.logname) + if self.target_process: + self.logs.append(self.target_process.logname) + try: + self.server = self.target.server() + self.logs.append(self.server.logname) + except Exception: + for log in self.logs: + print_log(log) + raise def classTeardown(self): del self.server @@ -564,9 +571,8 @@ class BaseTest(object): self.start = time.time() - self.classSetup() - try: + self.classSetup() self.setup() result = self.test() # pylint: disable=no-member except TestNotApplicable: