test_targets: capture output of failed tests

This commit is contained in:
Andrew Dennison 2023-10-20 12:09:08 +11:00
parent 3ca6bd3340
commit 019b143854
1 changed files with 11 additions and 2 deletions

View File

@ -67,7 +67,10 @@ python3 -m litex_boards.targets.simple litex_boards.platforms.{} \
--no-compile \
--uart-name="stub" \
""".format(name)
subprocess.check_call(cmd, shell=True)
try:
subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True)
except subprocess.CalledProcessError as exc:
raise self.failureException(exc.output) from None
# Build default configuration for all targets.
def test_targets(self):
@ -90,4 +93,10 @@ python3 -m litex_boards.targets.{} \
--build \
--no-compile \
""".format(name)
subprocess.check_call(cmd, shell=True)
try:
subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT, universal_newlines=True)
except subprocess.CalledProcessError as exc:
raise self.failureException(exc.output) from None
if __name__ == '__main__':
unittest.main()