Browse Source

[tests] add --valgrind-leak option

personal/stbuehler/wip
Stefan Bühler 9 years ago
parent
commit
8e41187ff6
  1. 13
      tests/base.py
  2. 4
      tests/runtests.py

13
tests/base.py

@ -398,11 +398,18 @@ if request.is_handled {{
Env.lighttpdconf = self.PrepareFile("conf/lighttpd.conf", self.config)
valgrindconfig = ""
if Env.valgrind:
if Env.valgrind_leak:
suppressions = ''
if Env.valgrind_leak != "":
suppressions = ', "--suppressions=' + Env.valgrind_leak + '"'
valgrindconfig = """
env ( "G_SLICE=always-malloc", "G_DEBUG=gc-friendly,fatal-criticals" );
env ( "G_SLICE=always-malloc", "G_DEBUG=gc-friendly,fatal-criticals,resident-modules" );
wrapper ("{valgrind}", "--leak-check=full", "--show-reachable=yes", "--leak-resolution=high" {suppressions} );
""".format(valgrind = Env.valgrind, suppressions = suppressions)
elif Env.valgrind:
valgrindconfig = """
env ( "G_SLICE=always-malloc", "G_DEBUG=gc-friendly,fatal-criticals,resident-modules" );
wrapper ("{valgrind}" );
# wrapper ("{valgrind}", "--leak-check=full", "--show-reachable=yes", "--leak-resolution=high" );
""".format(valgrind = Env.valgrind)
Env.angelconf = self.PrepareFile("conf/angel.conf", """

4
tests/runtests.py

@ -55,6 +55,7 @@ parser.add_option("--no-angel", help = "Spawn lighttpd worker directly", action
parser.add_option("--debug", help = "Show service logs on console", action = "store_true", default = False)
parser.add_option("--wait", help = "Wait for services to exit on first signal", action = "store_true", default = False)
parser.add_option("--valgrind", help = "Run worker with valgrind from angel", action = "store_true", default = False)
parser.add_option("--valgrind-leak", help = "Run valgrind with memory leak check; takes an empty string or a valgrind suppression file", action="store", default = False)
(options, args) = parser.parse_args()
@ -79,7 +80,8 @@ Env.no_angel = options.no_angel
Env.debug = options.debug
Env.wait = options.wait
Env.valgrind = options.valgrind
if Env.valgrind:
Env.valgrind_leak = options.valgrind_leak
if Env.valgrind or Env.valgrind_leak:
Env.valgrind = which('valgrind')
Env.color = sys.stdin.isatty()

Loading…
Cancel
Save