View | Details | Raw Unified | Return to bug 532
Collapse All | Expand All

(-)acc6c801f785 (+23 lines)
Added Link Here 
1
#!/usr/bin/env python
2
3
import os
4
import re
5
import sys
6
7
command = sys.argv[1]
8
error = 0
9
reg = re.compile ('definitely lost: ([^ ]+) bytes')
10
f = os.popen ("valgrind --leak-check=full --error-exitcode=1 --log-fd=1 " + command, "r")
11
for line in f.readlines ():
12
    sys.stdout.write(line)
13
    result = reg.search (line)
14
    if result is None:
15
        continue
16
    if result.group(1) != "0":
17
        error = 1
18
19
20
status = f.close ()
21
if status != None:
22
    error = os.WEXITSTATUS(status)
23
sys.exit(error)
(-)a/wutils.py (-1 / +1 lines)
 Lines 32-38    Link Here 
32
            raise Utils.WafError("Options --command-template and --valgrind are conflicting")
32
            raise Utils.WafError("Options --command-template and --valgrind are conflicting")
33
        if not env['VALGRIND']:
33
        if not env['VALGRIND']:
34
            raise Utils.WafError("valgrind is not installed")
34
            raise Utils.WafError("valgrind is not installed")
35
        cmd = env['VALGRIND'] + " --leak-check=full --error-exitcode=1 %s"
35
        cmd = "./valgrind-wrapper.py %s"
36
    else:
36
    else:
37
        cmd = Options.options.command_template or '%s'
37
        cmd = Options.options.command_template or '%s'
38
    for arg in arguments:
38
    for arg in arguments:

Return to bug 532