diff options
author | Kevin Cheng <kevin.cheng@arm.com> | 2021-03-03 11:21:43 -0800 |
---|---|---|
committer | Kevin Cheng <kevin.cheng@arm.com> | 2021-04-27 16:01:59 -0700 |
commit | 550ccc52de231621c0bf0c05ae2a398eec37ff51 (patch) | |
tree | d4a5bd8d24560135784208c0fe35615b1d043249 /verif/tosa_test_runner.py | |
parent | cf6224e6e8ba4fc2984de3e542538c38e27c9f57 (diff) | |
download | reference_model-550ccc52de231621c0bf0c05ae2a398eec37ff51.tar.gz |
Replace serialization/ and verif/ with MLPlatform's serialization_lib submodule
- Remove Usage and Format
- Run black on verif/*.py scripts
Signed-off-by: Kevin Cheng <kevin.cheng@arm.com>
Change-Id: Ie81515891eb0039540f614894f4b6b0e0e78ba74
Diffstat (limited to 'verif/tosa_test_runner.py')
-rw-r--r-- | verif/tosa_test_runner.py | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/verif/tosa_test_runner.py b/verif/tosa_test_runner.py index 6549192..82d447e 100644 --- a/verif/tosa_test_runner.py +++ b/verif/tosa_test_runner.py @@ -19,29 +19,34 @@ import shlex import subprocess from enum import IntEnum, unique + def run_sh_command(args, full_cmd, capture_output=False): - '''Utility function to run an external command. Optionally return captured stdout/stderr''' + """Utility function to run an external command. Optionally return captured stdout/stderr""" # Quote the command line for printing - full_cmd_esc = [ shlex.quote(x) for x in full_cmd ] + full_cmd_esc = [shlex.quote(x) for x in full_cmd] if args.verbose: - print('### Running {}'.format(' '.join(full_cmd_esc))) + print("### Running {}".format(" ".join(full_cmd_esc))) if capture_output: rc = subprocess.run(full_cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) if rc.returncode != 0: - print(rc.stdout.decode('utf-8')) - print(rc.stderr.decode('utf-8')) - raise Exception('Error running command: {}.\n{}'.format(' '.join(full_cmd_esc), rc.stderr.decode('utf-8'))) + print(rc.stdout.decode("utf-8")) + print(rc.stderr.decode("utf-8")) + raise Exception( + "Error running command: {}.\n{}".format( + " ".join(full_cmd_esc), rc.stderr.decode("utf-8") + ) + ) return (rc.stdout, rc.stderr) else: rc = subprocess.run(full_cmd) if rc.returncode != 0: - raise Exception('Error running command: {}'.format(' '.join(full_cmd_esc))) + raise Exception("Error running command: {}".format(" ".join(full_cmd_esc))) -class TosaTestRunner: +class TosaTestRunner: def __init__(self, args, runnerArgs, testDir): self.args = args @@ -49,7 +54,7 @@ class TosaTestRunner: self.testDir = testDir # Load the json test file - with open(os.path.join(testDir, 'desc.json'), 'r') as fd: + with open(os.path.join(testDir, "desc.json"), "r") as fd: self.testDesc = json.load(fd) def runModel(self): |