Fix waf check
authorGustavo J. A. M. Carneiro <gjc@inescporto.pt>
Tue, 20 Sep 2011 11:23:59 +0100
changeset 7510 aabd5141cd16
parent 7509 2531d57f638e
child 7511 6d03bec01c5c
Fix waf check
wscript
wutils.py
--- a/wscript	Mon Sep 19 19:56:58 2011 +0100
+++ b/wscript	Tue Sep 20 11:23:59 2011 +0100
@@ -838,11 +838,22 @@
     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):
--- a/wutils.py	Mon Sep 19 19:56:58 2011 +0100
+++ b/wutils.py	Tue Sep 20 11:23:59 2011 +0100
@@ -229,5 +229,5 @@
         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)