diff options
author | Benjamin Dauvergne <bdauvergne@entrouvert.com> | 2009-04-30 14:58:15 +0000 |
---|---|---|
committer | Benjamin Dauvergne <bdauvergne@entrouvert.com> | 2009-04-30 14:58:15 +0000 |
commit | e863eefdeb0fcd692958d33c860baa53bda2f202 (patch) | |
tree | 7e59bacfa9348dd3b8cd41f5a63f5ced6e7c05d2 /tests | |
parent | be2825415efe58b73943eba8b0629a54445a32d9 (diff) | |
download | lasso-e863eefdeb0fcd692958d33c860baa53bda2f202.tar.gz lasso-e863eefdeb0fcd692958d33c860baa53bda2f202.tar.xz lasso-e863eefdeb0fcd692958d33c860baa53bda2f202.zip |
Add a script to format suppression file
* tests/format-suppressions.py:
this is the script used to generate valgrind/lasso.supp and
valgrind/glib.supp.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/format-suppressions.py | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/tests/format-suppressions.py b/tests/format-suppressions.py new file mode 100644 index 00000000..cc9d2fbd --- /dev/null +++ b/tests/format-suppressions.py @@ -0,0 +1,43 @@ +import re + +valgrind_log = open('log','r').read() + +inblock = False +l = 0 +i = 0 +keep = dict() + +limit_re = r'type' + +for line in valgrind_log.splitlines(): + if line.startswith('{'): + inblock = True + block = [] + continue + if line.startswith('}'): + inblock = False + l = 0 + i += 1 + ok = False + name = "" + for x in block[2:]: + name = name + x + if re.search(limit_re, x): + ok = True + break + if ok: + keep[name] = block + continue + if inblock: + block.append(line) +i = 43 +for x in keep: + block = keep[x] + print "{" + print " suppression", i + for x in block[1:]: + print x + if re.search(limit_re, x): + break + print '}' + i += 1 |