Skip to content

Commit

Permalink
upgraded scripts a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
mbeckersys committed Oct 22, 2018
1 parent 3c72926 commit 3363fd8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
5 changes: 3 additions & 2 deletions tests/lib/testbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,16 @@ 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.
func_check: function "pointer" for checks to be executed.
"""
fname = get_outfile(stdout)
if func_check(fname):
os.remove(fname)
if not keep:
os.remove(fname)
print "PASSED"
exit(0)
else:
Expand Down
9 changes: 8 additions & 1 deletion tools/valgrind-ws-plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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<w>,<h>')
parser.add_argument('-t', '--title', default=None,
help='title of plot')

Expand Down

0 comments on commit 3363fd8

Please sign in to comment.