From 3363fd8a594d6f7d2447f9da7eeeea27e2b4ed41 Mon Sep 17 00:00:00 2001 From: Martin Becker Date: Mon, 22 Oct 2018 19:36:58 +0200 Subject: [PATCH] upgraded scripts a bit --- tests/lib/testbase.py | 5 +++-- tools/valgrind-ws-plot.py | 9 ++++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/tests/lib/testbase.py b/tests/lib/testbase.py index 381d0fa..33208e9 100644 --- a/tests/lib/testbase.py +++ b/tests/lib/testbase.py @@ -31,7 +31,7 @@ def get_outfile(stdout): return fname -def analyze(stdout, func_check): +def analyze(stdout, func_check, keep=False): """ Call test-specific check and exit with common formatting. @@ -39,7 +39,8 @@ def analyze(stdout, func_check): """ fname = get_outfile(stdout) if func_check(fname): - os.remove(fname) + if not keep: + os.remove(fname) print "PASSED" exit(0) else: diff --git a/tools/valgrind-ws-plot.py b/tools/valgrind-ws-plot.py index 3566fcb..e6f9928 100755 --- a/tools/valgrind-ws-plot.py +++ b/tools/valgrind-ws-plot.py @@ -28,7 +28,12 @@ def plot_all(stats, info, args): wssd = [d['wssd'] for d in stats] peaks = {d['t']: d['info'] for d in stats if d['info'] is not None} - fig = plt.figure(figsize=(10, 5)) + if args.figsize is not None: + parts = args.figsize.split(",") + figsize = (float(parts[0]), float(parts[1])) + else: + figsize = (10, 5) + fig = plt.figure(figsize=figsize) ax = fig.add_subplot('111') mid = ind[0] + (ind[-1] - ind[0]) / 2 @@ -188,6 +193,8 @@ def main(argv): help='choose scaling for y axis') parser.add_argument('-o', '--outfile', default=None, help='filename to save plot') + parser.add_argument('-s', '--figsize', default=None, + help='plot dimensions, e.g., -s,') parser.add_argument('-t', '--title', default=None, help='title of plot')