test: make OSBuild.compile return the result

Load the result data as json and return it to the caller.
This commit is contained in:
Christian Kellner 2020-08-12 18:48:55 +02:00
parent c298d31ba0
commit 19f9fb02bf

View file

@ -279,6 +279,8 @@ class OSBuild(contextlib.AbstractContextManager):
The produced artifact (if any) is stored in the directory passed via
the output_dir parameter. If it's set to None, a temporary directory
is used and thus the caller cannot access the built artifact.
Returns the build result as dictionary.
"""
if output_dir is None:
@ -319,6 +321,8 @@ class OSBuild(contextlib.AbstractContextManager):
self._print_result(p.returncode, data_stdout, data_stderr)
self._unittest.assertEqual(p.returncode, 0)
return json.loads(data_stdout)
def compile_file(self, file_stdin, output_dir=None, checkpoints=None):
"""Compile an Artifact