diff --git a/wscript b/wscript index e94d3eba8..f67fe6f1f 100644 --- a/wscript +++ b/wscript @@ -838,11 +838,22 @@ def shutdown(ctx): check_shell(bld) -check_context = Build.BuildContext -def check(bld): + +from waflib import Context, Build +class CheckContext(Context.Context): """run the equivalent of the old ns-3 unit tests using test.py""" - env = wutils.bld.env - wutils.run_python_program("test.py -n -c core", env) + cmd = 'check' + + def execute(self): + + # first we execute the build + bld = Context.create_context("build") + bld.options = Options.options # provided for convenience + bld.cmd = "build" + bld.execute() + + wutils.bld = bld + wutils.run_python_program("test.py -n -c core", bld.env) class print_introspected_doxygen_task(Task.TaskBase): diff --git a/wutils.py b/wutils.py index b4210e7d7..31a17d478 100644 --- a/wutils.py +++ b/wutils.py @@ -229,5 +229,5 @@ def run_python_program(program_string, env, visualize=False): cwd = Options.cwd_launch if visualize: execvec.append("--SimulatorImplementationType=ns3::VisualSimulatorImpl") - return run_argv([env['PYTHON']] + execvec, env, cwd=cwd) + return run_argv([env['PYTHON'][0]] + execvec, env, cwd=cwd)