diff options
| author | Florian Fischer <florian.fl.fischer@fau.de> | 2019-12-13 17:29:50 +0100 |
|---|---|---|
| committer | Florian Fischer <florian.fl.fischer@fau.de> | 2019-12-14 01:09:47 +0100 |
| commit | 5dae33d63e1f22c00ca3a1cee0e73d6d2ff18488 (patch) | |
| tree | 8bee771d16556051cd603f69c222e3407a19c17f /bench.py | |
| parent | 1f1361a3cae0bcaf82ee96d0736ed23b7763127c (diff) | |
| download | allocbench-5dae33d63e1f22c00ca3a1cee0e73d6d2ff18488.tar.gz allocbench-5dae33d63e1f22c00ca3a1cee0e73d6d2ff18488.zip | |
use sys.exit instead of exit and other small code improvements
Diffstat (limited to 'bench.py')
| -rwxr-xr-x | bench.py | 15 |
1 files changed, 7 insertions, 8 deletions
@@ -23,14 +23,13 @@ import atexit import datetime import importlib import os -import subprocess import sys import traceback from src.allocator import collect_allocators import src.facter import src.globalvars -from src.util import find_cmd +from src.util import find_cmd, run_cmd from src.util import print_status, print_warn, print_error from src.util import print_info, print_info2, print_debug from src.util import print_license_and_exit @@ -59,14 +58,14 @@ def check_dependencies(): # used python 3.6 features: f-strings if sys.version_info[0] < 3 or sys.version_info[1] < 6: print_error("At least python version 3.6 is required.") - exit(1) + sys.exit(1) # matplotlib is needed by Benchmark.plot_* try: importlib.import_module("matplotlib") except ModuleNotFoundError: print_error("matplotlib not found.") - exit(1) + sys.exit(1) # TODO mariadb @@ -117,7 +116,7 @@ def main(): if args.version: print(src.facter.allocbench_version()) - exit(0) + sys.exit(0) atexit.register(epilog) @@ -135,9 +134,9 @@ def main(): # Prepare allocbench print_status("Building allocbench ...") make_cmd = ["make"] - if src.globalvars.verbosity < 1: + if src.globalvars.verbosity < 2: make_cmd.append("-s") - subprocess.run(make_cmd) + run_cmd(make_cmd, output_verbosity=1) # allocators to benchmark src.globalvars.allocators = collect_allocators(args.allocators) @@ -147,7 +146,7 @@ def main(): if src.globalvars.allocators == {}: print_error("Abort because there are no allocators to benchmark") - exit(1) + sys.exit(1) # collect facts about benchmark environment src.facter.collect_facts() |
