author | Tom Henderson <tomh@tomh.org> |
Fri, 13 Jan 2012 16:07:23 -0800 | |
changeset 7687 | 9918e57b9f8d |
parent 7684 | 35d52a4a96e9 |
child 7705 | f1c54b0cc754 |
permissions | -rw-r--r-- |
3866
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
1 |
import os |
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
2 |
import os.path |
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
3 |
import sys |
7487
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6953
diff
changeset
|
4 |
import subprocess |
3866
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
5 |
import shlex |
4064
10222f483860
Upgrade to new WAF, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3933
diff
changeset
|
6 |
|
10222f483860
Upgrade to new WAF, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3933
diff
changeset
|
7 |
# WAF modules |
10222f483860
Upgrade to new WAF, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3933
diff
changeset
|
8 |
import Options |
10222f483860
Upgrade to new WAF, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3933
diff
changeset
|
9 |
import Utils |
10222f483860
Upgrade to new WAF, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3933
diff
changeset
|
10 |
import Logs |
10222f483860
Upgrade to new WAF, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3933
diff
changeset
|
11 |
import TaskGen |
10222f483860
Upgrade to new WAF, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3933
diff
changeset
|
12 |
import Build |
4332
a1c7bc503a0c
Detect valgrind memory leak reports; based on patch by Mathieu Lacage; closes bug #532
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4326
diff
changeset
|
13 |
import re |
7487
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6953
diff
changeset
|
14 |
from waflib.Errors import WafError |
3866
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
15 |
|
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
16 |
# these are set from the main wscript file |
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
17 |
APPNAME=None |
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
18 |
VERSION=None |
4326
179f86838e62
Upgrade to WAF 1.5.4
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4137
diff
changeset
|
19 |
bld=None |
4064
10222f483860
Upgrade to new WAF, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3933
diff
changeset
|
20 |
|
3866
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
21 |
|
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
22 |
|
4119
9ffcf2400aa5
Bug #323: waf --valgrind doesn't check for valgrind first
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4110
diff
changeset
|
23 |
def get_command_template(env, arguments=()): |
4332
a1c7bc503a0c
Detect valgrind memory leak reports; based on patch by Mathieu Lacage; closes bug #532
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4326
diff
changeset
|
24 |
cmd = Options.options.command_template or '%s' |
3866
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
25 |
for arg in arguments: |
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
26 |
cmd = cmd + " " + arg |
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
27 |
return cmd |
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
28 |
|
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
29 |
|
4108
92bae583f934
waf --run now takes either full path to a program or just the (flat) program name, for all C++ programs
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4064
diff
changeset
|
30 |
if hasattr(os.path, "relpath"): |
92bae583f934
waf --run now takes either full path to a program or just the (flat) program name, for all C++ programs
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4064
diff
changeset
|
31 |
relpath = os.path.relpath # since Python 2.6 |
92bae583f934
waf --run now takes either full path to a program or just the (flat) program name, for all C++ programs
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4064
diff
changeset
|
32 |
else: |
92bae583f934
waf --run now takes either full path to a program or just the (flat) program name, for all C++ programs
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4064
diff
changeset
|
33 |
def relpath(path, start=os.path.curdir): |
92bae583f934
waf --run now takes either full path to a program or just the (flat) program name, for all C++ programs
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4064
diff
changeset
|
34 |
"""Return a relative version of a path""" |
92bae583f934
waf --run now takes either full path to a program or just the (flat) program name, for all C++ programs
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4064
diff
changeset
|
35 |
|
92bae583f934
waf --run now takes either full path to a program or just the (flat) program name, for all C++ programs
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4064
diff
changeset
|
36 |
if not path: |
92bae583f934
waf --run now takes either full path to a program or just the (flat) program name, for all C++ programs
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4064
diff
changeset
|
37 |
raise ValueError("no path specified") |
92bae583f934
waf --run now takes either full path to a program or just the (flat) program name, for all C++ programs
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4064
diff
changeset
|
38 |
|
92bae583f934
waf --run now takes either full path to a program or just the (flat) program name, for all C++ programs
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4064
diff
changeset
|
39 |
start_list = os.path.abspath(start).split(os.path.sep) |
92bae583f934
waf --run now takes either full path to a program or just the (flat) program name, for all C++ programs
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4064
diff
changeset
|
40 |
path_list = os.path.abspath(path).split(os.path.sep) |
92bae583f934
waf --run now takes either full path to a program or just the (flat) program name, for all C++ programs
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4064
diff
changeset
|
41 |
|
92bae583f934
waf --run now takes either full path to a program or just the (flat) program name, for all C++ programs
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4064
diff
changeset
|
42 |
# Work out how much of the filepath is shared by start and path. |
92bae583f934
waf --run now takes either full path to a program or just the (flat) program name, for all C++ programs
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4064
diff
changeset
|
43 |
i = len(os.path.commonprefix([start_list, path_list])) |
92bae583f934
waf --run now takes either full path to a program or just the (flat) program name, for all C++ programs
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4064
diff
changeset
|
44 |
|
92bae583f934
waf --run now takes either full path to a program or just the (flat) program name, for all C++ programs
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4064
diff
changeset
|
45 |
rel_list = [os.path.pardir] * (len(start_list)-i) + path_list[i:] |
92bae583f934
waf --run now takes either full path to a program or just the (flat) program name, for all C++ programs
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4064
diff
changeset
|
46 |
if not rel_list: |
92bae583f934
waf --run now takes either full path to a program or just the (flat) program name, for all C++ programs
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4064
diff
changeset
|
47 |
return os.path.curdir |
92bae583f934
waf --run now takes either full path to a program or just the (flat) program name, for all C++ programs
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4064
diff
changeset
|
48 |
return os.path.join(*rel_list) |
92bae583f934
waf --run now takes either full path to a program or just the (flat) program name, for all C++ programs
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4064
diff
changeset
|
49 |
|
7487
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6953
diff
changeset
|
50 |
from waflib import Context |
3866
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
51 |
def find_program(program_name, env): |
7487
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6953
diff
changeset
|
52 |
launch_dir = os.path.abspath(Context.launch_dir) |
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6953
diff
changeset
|
53 |
#top_dir = os.path.abspath(Options.cwd_launch) |
3866
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
54 |
found_programs = [] |
4326
179f86838e62
Upgrade to WAF 1.5.4
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4137
diff
changeset
|
55 |
for obj in bld.all_task_gen: |
3866
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
56 |
if not getattr(obj, 'is_ns3_program', False): |
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
57 |
continue |
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
58 |
|
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
59 |
## filter out programs not in the subtree starting at the launch dir |
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
60 |
if not (obj.path.abspath().startswith(launch_dir) |
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
61 |
or obj.path.abspath(env).startswith(launch_dir)): |
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
62 |
continue |
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
63 |
|
7684
35d52a4a96e9
Make sure waf --run name works with program names, regardless of any prefix/sufix applied for installation purposes
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7538
diff
changeset
|
64 |
name1 = obj.name |
35d52a4a96e9
Make sure waf --run name works with program names, regardless of any prefix/sufix applied for installation purposes
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7538
diff
changeset
|
65 |
name2 = os.path.join(relpath(obj.path.abspath(), launch_dir), obj.name) |
4108
92bae583f934
waf --run now takes either full path to a program or just the (flat) program name, for all C++ programs
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4064
diff
changeset
|
66 |
names = [name1, name2] |
92bae583f934
waf --run now takes either full path to a program or just the (flat) program name, for all C++ programs
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4064
diff
changeset
|
67 |
found_programs.extend(names) |
92bae583f934
waf --run now takes either full path to a program or just the (flat) program name, for all C++ programs
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4064
diff
changeset
|
68 |
if program_name in names: |
3866
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
69 |
return obj |
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
70 |
raise ValueError("program '%s' not found; available programs are: %r" |
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
71 |
% (program_name, found_programs)) |
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
72 |
|
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
73 |
def get_proc_env(os_env=None): |
4326
179f86838e62
Upgrade to WAF 1.5.4
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4137
diff
changeset
|
74 |
env = bld.env |
3866
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
75 |
if sys.platform == 'linux2': |
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
76 |
pathvar = 'LD_LIBRARY_PATH' |
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
77 |
elif sys.platform == 'darwin': |
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
78 |
pathvar = 'DYLD_LIBRARY_PATH' |
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
79 |
elif sys.platform == 'win32': |
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
80 |
pathvar = 'PATH' |
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
81 |
elif sys.platform == 'cygwin': |
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
82 |
pathvar = 'PATH' |
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
83 |
elif sys.platform.startswith('freebsd'): |
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
84 |
pathvar = 'LD_LIBRARY_PATH' |
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
85 |
else: |
4064
10222f483860
Upgrade to new WAF, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3933
diff
changeset
|
86 |
Logs.warn(("Don't know how to configure " |
3866
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
87 |
"dynamic library path for the platform %r;" |
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
88 |
" assuming it's LD_LIBRARY_PATH.") % (sys.platform,)) |
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
89 |
pathvar = 'LD_LIBRARY_PATH' |
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
90 |
|
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
91 |
proc_env = dict(os.environ) |
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
92 |
if os_env is not None: |
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
93 |
proc_env.update(os_env) |
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
94 |
|
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
95 |
if pathvar is not None: |
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
96 |
if pathvar in proc_env: |
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
97 |
proc_env[pathvar] = os.pathsep.join(list(env['NS3_MODULE_PATH']) + [proc_env[pathvar]]) |
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
98 |
else: |
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
99 |
proc_env[pathvar] = os.pathsep.join(list(env['NS3_MODULE_PATH'])) |
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
100 |
|
7487
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6953
diff
changeset
|
101 |
pymoddir = bld.path.find_dir('bindings/python').get_bld().abspath() |
6953
aa8081396a16
Bug 1081 - wutils.py refers to the old directory for visualizer module
ishan <ishan.chhabra@gmail.com>
parents:
6886
diff
changeset
|
102 |
pyvizdir = bld.path.find_dir('src/visualizer').abspath() |
3866
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
103 |
if 'PYTHONPATH' in proc_env: |
6676
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6624
diff
changeset
|
104 |
proc_env['PYTHONPATH'] = os.pathsep.join([pymoddir, pyvizdir] + [proc_env['PYTHONPATH']]) |
3866
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
105 |
else: |
6676
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6624
diff
changeset
|
106 |
proc_env['PYTHONPATH'] = os.pathsep.join([pymoddir, pyvizdir]) |
3866
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
107 |
|
5975
c85cb9b073a0
comparing with http://code.nsnam.org/ns-3-dev
Craig Dowell <craigdo@ee.washington.edu>
parents:
5917
diff
changeset
|
108 |
if 'PATH' in proc_env: |
c85cb9b073a0
comparing with http://code.nsnam.org/ns-3-dev
Craig Dowell <craigdo@ee.washington.edu>
parents:
5917
diff
changeset
|
109 |
proc_env['PATH'] = os.pathsep.join(list(env['NS3_EXECUTABLE_PATH']) + [proc_env['PATH']]) |
c85cb9b073a0
comparing with http://code.nsnam.org/ns-3-dev
Craig Dowell <craigdo@ee.washington.edu>
parents:
5917
diff
changeset
|
110 |
else: |
c85cb9b073a0
comparing with http://code.nsnam.org/ns-3-dev
Craig Dowell <craigdo@ee.washington.edu>
parents:
5917
diff
changeset
|
111 |
proc_env['PATH'] = os.pathsep.join(list(env['NS3_EXECUTABLE_PATH'])) |
c85cb9b073a0
comparing with http://code.nsnam.org/ns-3-dev
Craig Dowell <craigdo@ee.washington.edu>
parents:
5917
diff
changeset
|
112 |
|
3866
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
113 |
return proc_env |
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
114 |
|
4388
fd90dd412e67
Force valgrind to not be used for Python tests
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4332
diff
changeset
|
115 |
def run_argv(argv, env, os_env=None, cwd=None, force_no_valgrind=False): |
3866
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
116 |
proc_env = get_proc_env(os_env) |
4388
fd90dd412e67
Force valgrind to not be used for Python tests
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4332
diff
changeset
|
117 |
if Options.options.valgrind and not force_no_valgrind: |
4332
a1c7bc503a0c
Detect valgrind memory leak reports; based on patch by Mathieu Lacage; closes bug #532
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4326
diff
changeset
|
118 |
if Options.options.command_template: |
7487
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6953
diff
changeset
|
119 |
raise WafError("Options --command-template and --valgrind are conflicting") |
4332
a1c7bc503a0c
Detect valgrind memory leak reports; based on patch by Mathieu Lacage; closes bug #532
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4326
diff
changeset
|
120 |
if not env['VALGRIND']: |
7487
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6953
diff
changeset
|
121 |
raise WafError("valgrind is not installed") |
5917
aa8364846523
Bug 792: Neither test.py nor waf --valgrind catch all kinds of memory leaks
Craig Dowell <craigdo@ee.washington.edu>
parents:
4584
diff
changeset
|
122 |
argv = [env['VALGRIND'], "--leak-check=full", "--show-reachable=yes", "--error-exitcode=1"] + argv |
4332
a1c7bc503a0c
Detect valgrind memory leak reports; based on patch by Mathieu Lacage; closes bug #532
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4326
diff
changeset
|
123 |
proc = subprocess.Popen(argv, env=proc_env, cwd=cwd, stderr=subprocess.PIPE) |
a1c7bc503a0c
Detect valgrind memory leak reports; based on patch by Mathieu Lacage; closes bug #532
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4326
diff
changeset
|
124 |
error = False |
a1c7bc503a0c
Detect valgrind memory leak reports; based on patch by Mathieu Lacage; closes bug #532
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4326
diff
changeset
|
125 |
for line in proc.stderr: |
a1c7bc503a0c
Detect valgrind memory leak reports; based on patch by Mathieu Lacage; closes bug #532
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4326
diff
changeset
|
126 |
sys.stderr.write(line) |
5917
aa8364846523
Bug 792: Neither test.py nor waf --valgrind catch all kinds of memory leaks
Craig Dowell <craigdo@ee.washington.edu>
parents:
4584
diff
changeset
|
127 |
if "== LEAK SUMMARY" in line: |
4332
a1c7bc503a0c
Detect valgrind memory leak reports; based on patch by Mathieu Lacage; closes bug #532
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4326
diff
changeset
|
128 |
error = True |
a1c7bc503a0c
Detect valgrind memory leak reports; based on patch by Mathieu Lacage; closes bug #532
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4326
diff
changeset
|
129 |
retval = proc.wait() |
a1c7bc503a0c
Detect valgrind memory leak reports; based on patch by Mathieu Lacage; closes bug #532
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4326
diff
changeset
|
130 |
if retval == 0 and error: |
a1c7bc503a0c
Detect valgrind memory leak reports; based on patch by Mathieu Lacage; closes bug #532
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4326
diff
changeset
|
131 |
retval = 1 |
a1c7bc503a0c
Detect valgrind memory leak reports; based on patch by Mathieu Lacage; closes bug #532
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4326
diff
changeset
|
132 |
else: |
4583
384117906219
Handle WindowsError exception in subprocess.Popen called from _run_argv
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4388
diff
changeset
|
133 |
try: |
384117906219
Handle WindowsError exception in subprocess.Popen called from _run_argv
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4388
diff
changeset
|
134 |
WindowsError |
384117906219
Handle WindowsError exception in subprocess.Popen called from _run_argv
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4388
diff
changeset
|
135 |
except NameError: |
384117906219
Handle WindowsError exception in subprocess.Popen called from _run_argv
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4388
diff
changeset
|
136 |
retval = subprocess.Popen(argv, env=proc_env, cwd=cwd).wait() |
384117906219
Handle WindowsError exception in subprocess.Popen called from _run_argv
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4388
diff
changeset
|
137 |
else: |
384117906219
Handle WindowsError exception in subprocess.Popen called from _run_argv
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4388
diff
changeset
|
138 |
try: |
384117906219
Handle WindowsError exception in subprocess.Popen called from _run_argv
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4388
diff
changeset
|
139 |
retval = subprocess.Popen(argv, env=proc_env, cwd=cwd).wait() |
384117906219
Handle WindowsError exception in subprocess.Popen called from _run_argv
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4388
diff
changeset
|
140 |
except WindowsError, ex: |
7487
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6953
diff
changeset
|
141 |
raise WafError("Command %s raised exception %s" % (argv, ex)) |
3866
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
142 |
if retval: |
6275
77f833c7ddae
Bug 894 - ./waf --run error message upon segfault
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
5975
diff
changeset
|
143 |
signame = None |
77f833c7ddae
Bug 894 - ./waf --run error message upon segfault
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
5975
diff
changeset
|
144 |
if retval < 0: # signal? |
77f833c7ddae
Bug 894 - ./waf --run error message upon segfault
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
5975
diff
changeset
|
145 |
import signal |
77f833c7ddae
Bug 894 - ./waf --run error message upon segfault
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
5975
diff
changeset
|
146 |
for name, val in vars(signal).iteritems(): |
77f833c7ddae
Bug 894 - ./waf --run error message upon segfault
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
5975
diff
changeset
|
147 |
if len(name) > 3 and name[:3] == 'SIG' and name[3] != '_': |
77f833c7ddae
Bug 894 - ./waf --run error message upon segfault
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
5975
diff
changeset
|
148 |
if val == -retval: |
77f833c7ddae
Bug 894 - ./waf --run error message upon segfault
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
5975
diff
changeset
|
149 |
signame = name |
77f833c7ddae
Bug 894 - ./waf --run error message upon segfault
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
5975
diff
changeset
|
150 |
break |
77f833c7ddae
Bug 894 - ./waf --run error message upon segfault
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
5975
diff
changeset
|
151 |
if signame: |
7487
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6953
diff
changeset
|
152 |
raise WafError("Command %s terminated with signal %s." |
6275
77f833c7ddae
Bug 894 - ./waf --run error message upon segfault
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
5975
diff
changeset
|
153 |
" Run it under a debugger to get more information " |
77f833c7ddae
Bug 894 - ./waf --run error message upon segfault
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
5975
diff
changeset
|
154 |
"(./waf --run <program> --command-template=\"gdb --args %%s <args>\")." % (argv, signame)) |
77f833c7ddae
Bug 894 - ./waf --run error message upon segfault
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
5975
diff
changeset
|
155 |
else: |
7487
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6953
diff
changeset
|
156 |
raise WafError("Command %s exited with code %i" % (argv, retval)) |
3866
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
157 |
return retval |
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
158 |
|
3933
3c149230e98a
Fix waf problem running programs with arguments.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3866
diff
changeset
|
159 |
def get_run_program(program_string, command_template=None): |
3866
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
160 |
""" |
3933
3c149230e98a
Fix waf problem running programs with arguments.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3866
diff
changeset
|
161 |
Return the program name and argv of the process that would be executed by |
3c149230e98a
Fix waf problem running programs with arguments.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3866
diff
changeset
|
162 |
run_program(program_string, command_template). |
3866
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
163 |
""" |
3933
3c149230e98a
Fix waf problem running programs with arguments.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3866
diff
changeset
|
164 |
#print "get_run_program_argv(program_string=%r, command_template=%r)" % (program_string, command_template) |
4326
179f86838e62
Upgrade to WAF 1.5.4
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4137
diff
changeset
|
165 |
env = bld.env |
3866
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
166 |
|
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
167 |
if command_template in (None, '%s'): |
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
168 |
argv = shlex.split(program_string) |
4584
7f4ee7f84b19
Fix win32/mingw bug running commands with command-template: needed to escape backslashes before calling shlex.split().
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4583
diff
changeset
|
169 |
#print "%r ==shlex.split==> %r" % (program_string, argv) |
3866
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
170 |
program_name = argv[0] |
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
171 |
|
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
172 |
try: |
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
173 |
program_obj = find_program(program_name, env) |
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
174 |
except ValueError, ex: |
7487
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6953
diff
changeset
|
175 |
raise WafError(str(ex)) |
3866
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
176 |
|
7487
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6953
diff
changeset
|
177 |
program_node = program_obj.path.find_or_declare(program_obj.target) |
4064
10222f483860
Upgrade to new WAF, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3933
diff
changeset
|
178 |
#try: |
10222f483860
Upgrade to new WAF, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3933
diff
changeset
|
179 |
# program_node = program_obj.path.find_build(ccroot.get_target_name(program_obj)) |
10222f483860
Upgrade to new WAF, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3933
diff
changeset
|
180 |
#except AttributeError: |
10222f483860
Upgrade to new WAF, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3933
diff
changeset
|
181 |
# raise Utils.WafError("%s does not appear to be a program" % (program_name,)) |
3866
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
182 |
|
7487
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6953
diff
changeset
|
183 |
execvec = [program_node.abspath()] + argv[1:] |
3866
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
184 |
|
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
185 |
else: |
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
186 |
|
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
187 |
program_name = program_string |
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
188 |
try: |
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
189 |
program_obj = find_program(program_name, env) |
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
190 |
except ValueError, ex: |
7487
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6953
diff
changeset
|
191 |
raise WafError(str(ex)) |
4064
10222f483860
Upgrade to new WAF, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3933
diff
changeset
|
192 |
|
7487
82cd20da9650
Upgrade to waf-1.6.7, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6953
diff
changeset
|
193 |
program_node = program_obj.path.find_or_declare(program_obj.target) |
4064
10222f483860
Upgrade to new WAF, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3933
diff
changeset
|
194 |
#try: |
10222f483860
Upgrade to new WAF, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3933
diff
changeset
|
195 |
# program_node = program_obj.path.find_build(ccroot.get_target_name(program_obj)) |
10222f483860
Upgrade to new WAF, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3933
diff
changeset
|
196 |
#except AttributeError: |
10222f483860
Upgrade to new WAF, work in progress
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3933
diff
changeset
|
197 |
# raise Utils.WafError("%s does not appear to be a program" % (program_name,)) |
3866
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
198 |
|
7535
2024597e0ad8
Bug 1266 - gdb cannot be loaded
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7510
diff
changeset
|
199 |
tmpl = command_template % (program_node.abspath(),) |
4584
7f4ee7f84b19
Fix win32/mingw bug running commands with command-template: needed to escape backslashes before calling shlex.split().
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4583
diff
changeset
|
200 |
execvec = shlex.split(tmpl.replace('\\', '\\\\')) |
7f4ee7f84b19
Fix win32/mingw bug running commands with command-template: needed to escape backslashes before calling shlex.split().
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4583
diff
changeset
|
201 |
#print "%r ==shlex.split==> %r" % (command_template % (program_node.abspath(env),), execvec) |
3933
3c149230e98a
Fix waf problem running programs with arguments.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3866
diff
changeset
|
202 |
return program_name, execvec |
3866
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
203 |
|
6676
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6624
diff
changeset
|
204 |
def run_program(program_string, env, command_template=None, cwd=None, visualize=False): |
3933
3c149230e98a
Fix waf problem running programs with arguments.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3866
diff
changeset
|
205 |
""" |
3c149230e98a
Fix waf problem running programs with arguments.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3866
diff
changeset
|
206 |
if command_template is not None, then program_string == program |
3c149230e98a
Fix waf problem running programs with arguments.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3866
diff
changeset
|
207 |
name and argv is given by command_template with %s replaced by the |
3c149230e98a
Fix waf problem running programs with arguments.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3866
diff
changeset
|
208 |
full path to the program. Else, program_string is interpreted as |
3c149230e98a
Fix waf problem running programs with arguments.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3866
diff
changeset
|
209 |
a shell command with first name being the program name. |
3c149230e98a
Fix waf problem running programs with arguments.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3866
diff
changeset
|
210 |
""" |
3c149230e98a
Fix waf problem running programs with arguments.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
3866
diff
changeset
|
211 |
dummy_program_name, execvec = get_run_program(program_string, command_template) |
4110
04170734fa8b
Don't abuse os.chdir so much (not thread safe)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4108
diff
changeset
|
212 |
if cwd is None: |
04170734fa8b
Don't abuse os.chdir so much (not thread safe)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4108
diff
changeset
|
213 |
if (Options.options.cwd_launch): |
04170734fa8b
Don't abuse os.chdir so much (not thread safe)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4108
diff
changeset
|
214 |
cwd = Options.options.cwd_launch |
04170734fa8b
Don't abuse os.chdir so much (not thread safe)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4108
diff
changeset
|
215 |
else: |
04170734fa8b
Don't abuse os.chdir so much (not thread safe)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4108
diff
changeset
|
216 |
cwd = Options.cwd_launch |
6676
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6624
diff
changeset
|
217 |
if visualize: |
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6624
diff
changeset
|
218 |
execvec.append("--SimulatorImplementationType=ns3::VisualSimulatorImpl") |
4332
a1c7bc503a0c
Detect valgrind memory leak reports; based on patch by Mathieu Lacage; closes bug #532
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4326
diff
changeset
|
219 |
return run_argv(execvec, env, cwd=cwd) |
3866
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
220 |
|
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
221 |
|
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
222 |
|
6676
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6624
diff
changeset
|
223 |
def run_python_program(program_string, env, visualize=False): |
4326
179f86838e62
Upgrade to WAF 1.5.4
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4137
diff
changeset
|
224 |
env = bld.env |
3866
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
225 |
execvec = shlex.split(program_string) |
4137
c1303bd63eb5
Fix waf --pyrun bug
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4119
diff
changeset
|
226 |
if (Options.options.cwd_launch): |
c1303bd63eb5
Fix waf --pyrun bug
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4119
diff
changeset
|
227 |
cwd = Options.options.cwd_launch |
c1303bd63eb5
Fix waf --pyrun bug
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4119
diff
changeset
|
228 |
else: |
c1303bd63eb5
Fix waf --pyrun bug
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
4119
diff
changeset
|
229 |
cwd = Options.cwd_launch |
6676
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6624
diff
changeset
|
230 |
if visualize: |
8a57344a8d09
Codereview Issue 2692041: Add pyviz module
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
6624
diff
changeset
|
231 |
execvec.append("--SimulatorImplementationType=ns3::VisualSimulatorImpl") |
7510
aabd5141cd16
Fix waf check
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7487
diff
changeset
|
232 |
return run_argv([env['PYTHON'][0]] + execvec, env, cwd=cwd) |
3866
9e946fee902c
Refactor wscript code to move regression testing code to a separate python module (bug 325)
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
diff
changeset
|
233 |
|
7538
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
234 |
|
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
235 |
|
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
236 |
def monkey_patch_Runner_start(): |
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
237 |
"""http://code.google.com/p/waf/issues/detail?id=1039""" |
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
238 |
from waflib import Task |
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
239 |
def start(self): |
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
240 |
""" |
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
241 |
Give tasks to :py:class:`waflib.Runner.TaskConsumer` instances until the build finishes or the ``stop`` flag is set. |
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
242 |
If only one job is used, then execute the tasks one by one, without consumers. |
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
243 |
""" |
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
244 |
|
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
245 |
self.total = self.bld.total() |
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
246 |
|
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
247 |
while not self.stop: |
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
248 |
|
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
249 |
self.refill_task_list() |
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
250 |
|
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
251 |
# consider the next task |
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
252 |
tsk = self.get_next_task() |
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
253 |
if not tsk: |
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
254 |
if self.count: |
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
255 |
# tasks may add new ones after they are run |
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
256 |
continue |
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
257 |
else: |
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
258 |
# no tasks to run, no tasks running, time to exit |
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
259 |
break |
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
260 |
|
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
261 |
if tsk.hasrun: |
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
262 |
# if the task is marked as "run", just skip it |
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
263 |
self.processed += 1 |
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
264 |
continue |
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
265 |
|
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
266 |
if self.stop: # stop immediately after a failure was detected |
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
267 |
break |
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
268 |
|
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
269 |
try: |
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
270 |
st = tsk.runnable_status() |
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
271 |
except Exception: |
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
272 |
self.processed += 1 |
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
273 |
if not self.stop and self.bld.keep: |
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
274 |
tsk.hasrun = Task.SKIPPED |
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
275 |
if self.bld.keep == 1: |
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
276 |
# if -k stop at the first exception, if -kk try to go as far as possible |
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
277 |
self.stop = True |
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
278 |
continue |
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
279 |
tsk.err_msg = Utils.ex_stack() |
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
280 |
tsk.hasrun = Task.EXCEPTION |
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
281 |
self.error_handler(tsk) |
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
282 |
continue |
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
283 |
|
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
284 |
if st == Task.ASK_LATER: |
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
285 |
self.postpone(tsk) |
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
286 |
# TODO optimize this |
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
287 |
# if self.outstanding: |
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
288 |
# for x in tsk.run_after: |
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
289 |
# if x in self.outstanding: |
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
290 |
# self.outstanding.remove(x) |
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
291 |
# self.outstanding.insert(0, x) |
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
292 |
elif st == Task.SKIP_ME: |
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
293 |
self.processed += 1 |
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
294 |
tsk.hasrun = Task.SKIPPED |
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
295 |
self.add_more_tasks(tsk) |
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
296 |
else: |
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
297 |
# run me: put the task in ready queue |
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
298 |
tsk.position = (self.processed, self.total) |
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
299 |
self.count += 1 |
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
300 |
tsk.master = self |
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
301 |
self.processed += 1 |
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
302 |
|
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
303 |
if self.numjobs == 1: |
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
304 |
tsk.process() |
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
305 |
else: |
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
306 |
self.add_task(tsk) |
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
307 |
|
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
308 |
# self.count represents the tasks that have been made available to the consumer threads |
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
309 |
# collect all the tasks after an error else the message may be incomplete |
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
310 |
while self.error and self.count: |
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
311 |
self.get_out() |
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
312 |
|
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
313 |
#print loop |
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
314 |
assert (self.count == 0 or self.stop) |
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
315 |
|
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
316 |
# free the task pool, if any |
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
317 |
self.free_task_pool() |
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
318 |
|
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
319 |
from waflib.Runner import Parallel |
e4f691d808b1
Patch the WAF task runner to fix performance, until the issue is fixed upstream.
Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
parents:
7535
diff
changeset
|
320 |
Parallel.start = start |