merge ns-3-lena-dev and ns-3-dev
authorNicola Baldo <nbaldo@cttc.es>
Wed, 18 Jan 2012 18:13:25 +0100
changeset 8569 2cc1c7afb3c0
parent 8568 fc43230a29f5 (current diff)
parent 7689 8d3e8dbc5305 (diff)
child 8570 83fdc8044a06
child 8571 1cb2ad403831
merge ns-3-lena-dev and ns-3-dev
src/core/wscript
src/test/ns3tcp/waf
src/test/ns3tcp/wscript
src/test/ns3wifi/waf
src/test/ns3wifi/wscript
src/wscript
--- a/src/config-store/wscript	Wed Jan 18 17:04:01 2012 +0100
+++ b/src/config-store/wscript	Wed Jan 18 18:13:25 2012 +0100
@@ -1,5 +1,7 @@
 ## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
 
+import wutils
+
 def configure(conf):
     have_gtk = conf.pkg_check_modules('GTK_CONFIG_STORE', 'gtk+-2.0 >= 2.12', mandatory=False)
     conf.env['ENABLE_GTK_CONFIG_STORE'] = have_gtk
@@ -18,7 +20,7 @@
 
 
 def build(bld):
-    bld.install_files('${PREFIX}/include/ns3', '../../ns3/config-store-config.h')
+    bld.install_files('${INCLUDEDIR}/%s%s/ns3' % (wutils.APPNAME, wutils.VERSION), '../../ns3/config-store-config.h')
 
     module = bld.create_ns3_module('config-store', ['core', 'network'])
     module.source = [
--- a/src/core/model/test.h	Wed Jan 18 17:04:01 2012 +0100
+++ b/src/core/model/test.h	Wed Jan 18 18:13:25 2012 +0100
@@ -497,12 +497,12 @@
   } while (false)
 
 /**
- * \brief Test that an actual and expected (limit) value are equal and report
- * and abort if not.
+ * \brief Test that an actual and expected (limit) value are not equal and 
+ * report and abort if not.
  *
  * Check to see if the expected (limit) value is not equal to the actual value
- * found in a test case.  If the two values are equal nothing happens, but if 
- * the comparison fails, an error is reported in a consistent way and the 
+ * found in a test case.  If the two values are not equal nothing happens, but 
+ * if the comparison fails, an error is reported in a consistent way and the 
  * execution of the current test case is aborted.
  *
  * The message is interpreted as a stream, for example:
@@ -515,7 +515,7 @@
  * is legal.
  * 
  * \param actual Expression for the actual value found during the test.
- * \param limit Expression for the expected value of the test.
+ * \param limit Expression for the value that actual is tested against.
  * \param msg Message that is output if the test does not pass.
  *
  * \warning Do not use this macro if you are comparing floating point numbers
@@ -547,8 +547,8 @@
   } while (false)
 
 /**
- * \brief Test that an actual and expected (limit) value are equal and report
- * and abort if not.
+ * \brief Test that an actual and expected (limit) value are not equal and 
+ * report and abort if not.
  *
  * Check to see if the expected (limit) value is not equal to the actual value
  * found in a test case.  If the two values are equal nothing happens, but if 
@@ -602,25 +602,25 @@
   } while (false)
 
 /**
- * \brief Test that an actual and expected (limit) value are equal and report
- * if not.
+ * \brief Test that an actual and expected (limit) value are not equal and 
+ * report if not.
  *
- * Check to see if the expected (limit) value is equal to the actual value 
- * found in a test case.  If the two values are equal nothing happens, but if 
- * the comparison fails, an error is reported in a consistent way.  EXPECT* 
+ * Check to see if the expected (limit) value is not equal to the actual value 
+ * found in a test case.  If the two values are not equal nothing happens, but 
+ * if the comparison fails, an error is reported in a consistent way.  EXPECT* 
  * macros do not return if an error is detected.
  *
  * The message is interpreted as a stream, for example:
  *
  * \code
- * NS_TEST_EXPECT_MSG_EQUAL (result, true, 
+ * NS_TEST_EXPECT_MSG_NE (result, false, 
  *      "cannot open file " << filename << " in test");
  * \endcode
  *
  * is legal.
  * 
  * \param actual Expression for the actual value found during the test.
- * \param limit Expression for the expected value of the test.
+ * \param limit Expression for the value that actual is tested against.
  * \param msg Message that is output if the test does not pass.
  *
  * \warning Do not use this macro if you are comparing floating point numbers
--- a/src/core/wscript	Wed Jan 18 17:04:01 2012 +0100
+++ b/src/core/wscript	Wed Jan 18 18:13:25 2012 +0100
@@ -3,6 +3,8 @@
 
 import Options
 
+import wutils
+
 def options(opt):
     opt.add_option('--int64x64-as-double',
                    help=('Whether to use a double floating point'
@@ -94,7 +96,7 @@
     conf.write_config_header('ns3/core-config.h', top=True)
 
 def build(bld):
-    bld.install_files('${PREFIX}/include/ns3', '../../ns3/core-config.h')
+    bld.install_files('${INCLUDEDIR}/%s%s/ns3' % (wutils.APPNAME, wutils.VERSION), '../../ns3/core-config.h')
 
     core = bld.create_ns3_module('core')
     core.source = [
--- a/src/internet/model/ipv6-l3-protocol.cc	Wed Jan 18 17:04:01 2012 +0100
+++ b/src/internet/model/ipv6-l3-protocol.cc	Wed Jan 18 18:13:25 2012 +0100
@@ -957,6 +957,8 @@
       p->CopyData (buf, sizeof(buf));
       nextHeader = buf[0];
       nextHeaderPosition = buf[1];
+      NS_ASSERT_MSG (nextHeader != Ipv6Header::IPV6_EXT_HOP_BY_HOP, "Double Ipv6Header::IPV6_EXT_HOP_BY_HOP in packet, aborting");
+      NS_ASSERT_MSG (nextHeaderPosition != 0, "Zero-size IPv6 Option Header, aborting");
     }
 
   /* process all the extensions found and the layer 4 protocol */
@@ -966,7 +968,11 @@
 
       if (ipv6Extension)
         {
-          nextHeaderPosition += ipv6Extension->Process (p, nextHeaderPosition, ip, dst, &nextHeader, isDropped);
+          uint8_t nextHeaderStep = 0;
+          nextHeaderStep = ipv6Extension->Process (p, nextHeaderPosition, ip, dst, &nextHeader, isDropped);
+          nextHeaderPosition += nextHeaderStep;
+
+          NS_ASSERT_MSG (nextHeaderStep != 0, "Zero-size IPv6 Option Header, aborting");
 
           if (isDropped)
             {
--- a/src/netanim/wscript	Wed Jan 18 17:04:01 2012 +0100
+++ b/src/netanim/wscript	Wed Jan 18 18:13:25 2012 +0100
@@ -1,7 +1,9 @@
 ## -*-Mode : python; py-indent-offset : 4; indent-tabs-mode : nil; coding : utf-8; -*-
 
+import wutils
+
 def build (bld) :
-        bld.install_files('${PREFIX}/include/ns3', '../../ns3/netanim-config.h')
+        bld.install_files('${INCLUDEDIR}/%s%s/ns3' % (wutils.APPNAME, wutils.VERSION), '../../ns3/netanim-config.h')
 	module = bld.create_ns3_module ('netanim', ['internet', 'mobility', 'wimax', 'wifi', 'csma'])
 	module.includes = '.'
 	module.source = [
--- a/src/test/ns3tcp/ns3tcp-cwnd-test-suite.cc	Wed Jan 18 17:04:01 2012 +0100
+++ b/src/test/ns3tcp/ns3tcp-cwnd-test-suite.cc	Wed Jan 18 18:13:25 2012 +0100
@@ -568,7 +568,7 @@
   : TestSuite ("ns3-tcp-cwnd", SYSTEM)
 {
   AddTestCase (new Ns3TcpCwndTestCase1);
-  AddTestCase (new Ns3TcpCwndTestCase2);
+//  AddTestCase (new Ns3TcpCwndTestCase2);
 }
 
 Ns3TcpCwndTestSuite ns3TcpCwndTestSuite;
--- a/src/test/ns3tcp/ns3tcp-loss-test-suite.cc	Wed Jan 18 17:04:01 2012 +0100
+++ b/src/test/ns3tcp/ns3tcp-loss-test-suite.cc	Wed Jan 18 18:13:25 2012 +0100
@@ -446,6 +446,7 @@
 {
   SetDataDir (NS_TEST_SOURCEDIR);
   Packet::EnablePrinting ();  // Enable packet metadata for all test cases
+#if 0
   AddTestCase (new Ns3TcpLossTestCase ("Tahoe", 0));
   AddTestCase (new Ns3TcpLossTestCase ("Tahoe", 1));
   AddTestCase (new Ns3TcpLossTestCase ("Tahoe", 2));
@@ -463,6 +464,7 @@
   AddTestCase (new Ns3TcpLossTestCase ("NewReno", 2));
   AddTestCase (new Ns3TcpLossTestCase ("NewReno", 3));
   AddTestCase (new Ns3TcpLossTestCase ("NewReno", 4));
+#endif
 }
 
 static Ns3TcpLossTestSuite ns3TcpLossTestSuite;
--- a/src/test/ns3tcp/ns3tcp-state-test-suite.cc	Wed Jan 18 17:04:01 2012 +0100
+++ b/src/test/ns3tcp/ns3tcp-state-test-suite.cc	Wed Jan 18 18:13:25 2012 +0100
@@ -450,13 +450,13 @@
 {
   Packet::EnablePrinting ();  // Enable packet metadata for all test cases
   AddTestCase (new Ns3TcpStateTestCase (0));
-  AddTestCase (new Ns3TcpStateTestCase (1));
+//  AddTestCase (new Ns3TcpStateTestCase (1));
   AddTestCase (new Ns3TcpStateTestCase (2));
   AddTestCase (new Ns3TcpStateTestCase (3));
   AddTestCase (new Ns3TcpStateTestCase (4));
   AddTestCase (new Ns3TcpStateTestCase (5));
   AddTestCase (new Ns3TcpStateTestCase (6));
-  AddTestCase (new Ns3TcpStateTestCase (7));
+//  AddTestCase (new Ns3TcpStateTestCase (7));
   AddTestCase (new Ns3TcpStateTestCase (8));
 }
 
--- a/src/test/ns3tcp/waf	Wed Jan 18 17:04:01 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-exec "`dirname "$0"`"/../../../waf "$@"
--- a/src/test/ns3tcp/wscript	Wed Jan 18 17:04:01 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
-
-import sys
-
-def configure(conf):
-    # Add the ns3tcp module to the list of enabled modules that
-    # should not be built if this is a static build on Darwin.  They
-    # don't work there for the ns3tcp module, and this is probably
-    # because the ns3tcp module has no source files.
-    if conf.env['ENABLE_STATIC_NS3'] and sys.platform == 'darwin':
-        conf.env['MODULES_NOT_BUILT'].append('ns3tcp')
-
-def build(bld):
-    # Don't do anything for this module if it should not be built.
-    if 'ns3tcp' in bld.env['MODULES_NOT_BUILT']:
-        return
-
-    ns3tcp = bld.create_ns3_module('ns3tcp', ['internet', 'point-to-point', 'csma', 'applications'])
-    headers = bld.new_task_gen(features=['ns3header'])
-    headers.module = 'ns3tcp'
-    headers.source = [
-        'ns3tcp.h',
-        ]
-
-    ns3tcp_test = bld.create_ns3_module_test_library('ns3tcp')
-    ns3tcp_test.source = [
-        'ns3tcp-socket-writer.cc',
-        'ns3tcp-socket-test-suite.cc',
-        'ns3tcp-loss-test-suite.cc',
-        'ns3tcp-state-test-suite.cc',
-        'ns3tcp-no-delay-test-suite.cc',
-        ]
-
-    if bld.env['NSC_ENABLED']:
-        ns3tcp_test.source.append ('ns3tcp-interop-test-suite.cc')
-        ns3tcp_test.source.append ('ns3tcp-cwnd-test-suite.cc')
-        ns3tcp_test.source.append ('nsctcp-loss-test-suite.cc')
--- a/src/test/ns3wifi/waf	Wed Jan 18 17:04:01 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-exec "`dirname "$0"`"/../../../waf "$@"
--- a/src/test/ns3wifi/wscript	Wed Jan 18 17:04:01 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
-
-import sys
-
-def configure(conf):
-    # Add the ns3wifi module to the list of enabled modules that
-    # should not be built if this is a static build on Darwin.  They
-    # don't work there for the ns3wifi module, and this is probably
-    # because the ns3wifi module has no source files.
-    if conf.env['ENABLE_STATIC_NS3'] and sys.platform == 'darwin':
-        conf.env['MODULES_NOT_BUILT'].append('ns3wifi')
-
-def build(bld):
-    # Don't do anything for this module if it should not be built.
-    if 'ns3wifi' in bld.env['MODULES_NOT_BUILT']:
-        return
-
-    ns3wifi = bld.create_ns3_module('ns3wifi', ['internet', 'mobility', 'propagation', 'wifi', 'applications'])
-    headers = bld.new_task_gen(features=['ns3header'])
-    headers.module = 'ns3wifi'
-    headers.source = [
-        'ns3wifi.h',
-        ]
-
-    ns3wifi_test = bld.create_ns3_module_test_library('ns3wifi')
-    ns3wifi_test.source = [
-        'wifi-interference-test-suite.cc',
-        'wifi-msdu-aggregator-test-suite.cc',
-        ]
-
--- a/src/test/wscript	Wed Jan 18 17:04:01 2012 +0100
+++ b/src/test/wscript	Wed Jan 18 18:13:25 2012 +0100
@@ -3,10 +3,6 @@
 import sys
 
 def configure(conf):
-    conf.sub_config('perf')
-    conf.sub_config('ns3tcp')
-    conf.sub_config('ns3wifi')
-
     # Add the test module to the list of enabled modules that should
     # not be built if this is a static build on Darwin.  They don't
     # work there for the test module, and this is probably because the
@@ -19,7 +15,7 @@
     if 'test' in bld.env['MODULES_NOT_BUILT']:
         return
 
-    test = bld.create_ns3_module('test', ['internet', 'mobility', 'applications', 'csma', 'bridge', 'config-store', 'tools', 'point-to-point', 'csma-layout', 'flow-monitor'])
+    test = bld.create_ns3_module('test', ['internet', 'mobility', 'applications', 'csma', 'bridge', 'config-store', 'tools', 'point-to-point', 'csma-layout', 'flow-monitor', 'wifi'])
     headers = bld.new_task_gen(features=['ns3header'])
     headers.module = 'test'
 
@@ -30,5 +26,15 @@
         'static-routing-test-suite.cc',
         'error-model-test-suite.cc',
         'mobility-test-suite.cc',
+        'ns3wifi/wifi-interference-test-suite.cc',
+        'ns3wifi/wifi-msdu-aggregator-test-suite.cc',
+        'ns3tcp/ns3tcp-cwnd-test-suite.cc',
+        'ns3tcp/ns3tcp-interop-test-suite.cc',
+        'ns3tcp/ns3tcp-loss-test-suite.cc',
+        'ns3tcp/ns3tcp-no-delay-test-suite.cc',
+        'ns3tcp/ns3tcp-socket-test-suite.cc',
+        'ns3tcp/ns3tcp-state-test-suite.cc',
+        'ns3tcp/nsctcp-loss-test-suite.cc',
+        'ns3tcp/ns3tcp-socket-writer.cc',
         ]
 
--- a/src/wscript	Wed Jan 18 17:04:01 2012 +0100
+++ b/src/wscript	Wed Jan 18 18:13:25 2012 +0100
@@ -79,7 +79,8 @@
         module = bld.new_task_gen(features=['cxx', 'cxxstlib', 'ns3module'])
     else:
         module = bld.new_task_gen(features=['cxx', 'cxxshlib', 'ns3module'])
-    module.target = '%s/ns3-%s' % (bld.srcnode.relpath_gen(module.path), name)
+    module.target = '%s/ns%s-%s-%s' % (bld.srcnode.relpath_gen(module.path), wutils.VERSION,
+                                       name, bld.env['BUILD_PROFILE'])
     linkflags = []
     cxxflags = []
     ccflags = []
@@ -123,8 +124,8 @@
 
     module.env.append_value("INCLUDES", '#')
 
-    pcfilegen = bld(features='ns3pcfile')
-    pcfilegen.module = module
+    module.pcfilegen = bld(features='ns3pcfile')
+    module.pcfilegen.module = module
     
     return module
 
@@ -276,6 +277,13 @@
     pymod.env['DEFINES'] = defines
     pymod.includes = '# bindings'
     pymod.install_path = '${PYTHONARCHDIR}/ns'
+
+    # Workaround to a WAF bug, remove this when ns-3 upgrades to WAF > 1.6.10
+    # https://www.nsnam.org/bugzilla/show_bug.cgi?id=1335
+    # http://code.google.com/p/waf/issues/detail?id=1098
+    if Utils.unversioned_sys_platform() == 'darwin':
+        pymod.mac_bundle = True
+
     return pymod
 
 
@@ -365,9 +373,9 @@
     def _generate_pcfile(self, name, use, env, outfilename):
         outfile = open(outfilename, 'wt')
         prefix = env.PREFIX
-        includedir = env.INCLUDEDIR
+        includedir = Utils.subst_vars('${INCLUDEDIR}/%s%s' % (wutils.APPNAME, wutils.VERSION), env)
         libdir = env.LIBDIR
-        libs = self._self_libs(env, name, '${libdir}')
+        libs = self._self_libs(env, "%s%s-%s-%s" % (wutils.APPNAME, wutils.VERSION, name[4:], env['BUILD_PROFILE']), '${libdir}')
         for dep in use:
             libs += self._lib(env, dep)
         for dep in env.LIBS:
@@ -378,7 +386,8 @@
             cflags = cflags + self._cflags(dep) + self._cxxflags(dep) + \
                 self._defines(dep) + self._includes(dep)
             if dep.startswith('ns3-'):
-                requires.append("lib"+dep)
+                dep_name = dep[4:]
+                requires.append("libns%s-%s-%s" % (wutils.VERSION, dep_name, env['BUILD_PROFILE']))
         print >> outfile, """\
 prefix=%s
 libdir=%s
@@ -386,12 +395,12 @@
 
 Name: lib%s
 Description: ns-3 module %s
-Version: devel
+Version: %s
 Libs: %s
 Cflags: %s
 Requires: %s\
 """ % (prefix, libdir, includedir,
-       name, name, ' '.join(libs), ' '.join(cflags), ' '.join(requires))
+       name, name, wutils.VERSION, ' '.join(libs), ' '.join(cflags), ' '.join(requires))
         outfile.close()
 
     def run(self):
@@ -404,7 +413,7 @@
 @TaskGen.feature('ns3pcfile')
 @TaskGen.after_method('process_rule')
 def apply(self):
-    output_filename = 'lib%s.pc' % self.module.name
+    output_filename = 'lib%s.pc' % os.path.basename(self.module.target)
     output_node = self.path.find_or_declare(output_filename)
     assert output_node is not None, str(self)
     task = self.create_task('ns3pcfile')
@@ -429,7 +438,7 @@
         task = self.create_task('ns3header')
         task.mode = getattr(self, 'mode', 'install')
         if task.mode == 'install':
-            self.bld.install_files('${PREFIX}/include/ns3', [src_node])
+            self.bld.install_files('${INCLUDEDIR}/%s%s/ns3' % (wutils.APPNAME, wutils.VERSION), [src_node])
             task.set_inputs([src_node])
             task.set_outputs([dst_node])
         else:
@@ -623,7 +632,7 @@
     task.mode = getattr(self, "mode", "install")
     if task.mode == 'install':
         assert module_obj is not None, self.module
-        self.bld.install_files('${PREFIX}/include/ns3', 
+        self.bld.install_files('${INCLUDEDIR}/%s%s/ns3' % (wutils.APPNAME, wutils.VERSION),
                                ns3_dir_node.find_or_declare("%s-module.h" % self.module))
         task.set_inputs(all_headers_inputs)
         task.set_outputs(all_headers_outputs)
--- a/test.py	Wed Jan 18 17:04:01 2012 +0100
+++ b/test.py	Wed Jan 18 18:13:25 2012 +0100
@@ -53,6 +53,10 @@
     "ENABLE_PYTHON_BINDINGS",
     "ENABLE_CLICK",
     "ENABLE_OPENFLOW",
+    "APPNAME",
+    "BUILD_PROFILE",
+    "VERSION",
+    "PYTHON",
 ]
 
 NSC_ENABLED = False
@@ -63,6 +67,16 @@
 ENABLE_CLICK = False
 ENABLE_OPENFLOW = False
 EXAMPLE_DIRECTORIES = []
+APPNAME = ""
+BUILD_PROFILE = ""
+VERSION = ""
+PYTHON = ""
+
+#
+# This will be given a prefix and a suffix when the waf config file is
+# read.
+#
+test_runner_name = "test-runner"
 
 #
 # If the user has constrained us to run certain kinds of tests, we can tell waf
@@ -124,6 +138,9 @@
         #
         cpp_examples = get_list_from_file(examples_to_run_path, "cpp_examples")
         for example_name, do_run, do_valgrind_run in cpp_examples:
+            # Add the proper prefix and suffix to the example name to
+            # match what is done in the wscript file.
+            example_name = "%s%s-%s-%s" % (APPNAME, VERSION, example_name, BUILD_PROFILE)
             example_path = os.path.join(cpp_executable_dir, example_name)
             # Add all of the C++ examples that were built, i.e. found
             # in the directory, to the list of C++ examples to run.
@@ -598,7 +615,7 @@
 # You should see in the verbose output something that looks like:
 #
 #   Synchronously execute valgrind --suppressions=/home/craigdo/repos/ns-3-allinone-dev/ns-3-dev/testpy.supp
-#   --leak-check=full --error-exitcode=2 /home/craigdo/repos/ns-3-allinone-dev/ns-3-dev/build/debug/utils/test-runner 
+#   --leak-check=full --error-exitcode=2 /home/craigdo/repos/ns-3-allinone-dev/ns-3-dev/build/debug/utils/ns3-dev-test-runner-debug 
 #   --suite=devices-mesh-dot11s-regression --basedir=/home/craigdo/repos/ns-3-allinone-dev/ns-3-dev 
 #   --tempdir=testpy-output/2010-01-12-22-47-50-CUT 
 #   --out=testpy-output/2010-01-12-22-47-50-CUT/devices-mesh-dot11s-regression.xml
@@ -607,7 +624,7 @@
 # reproduce your error:
 #
 #   valgrind --suppressions=/home/craigdo/repos/ns-3-allinone-dev/ns-3-dev/testpy.supp
-#   --leak-check=full --error-exitcode=2 /home/craigdo/repos/ns-3-allinone-dev/ns-3-dev/build/debug/utils/test-runner 
+#   --leak-check=full --error-exitcode=2 /home/craigdo/repos/ns-3-allinone-dev/ns-3-dev/build/debug/utils/ns3-dev-test-runner-debug 
 #   --suite=devices-mesh-dot11s-regression --basedir=/home/craigdo/repos/ns-3-allinone-dev/ns-3-dev 
 #   --tempdir=testpy-output 
 #
@@ -619,7 +636,7 @@
 # option to valgrind.  Use something like:
 #
 #   valgrind --gen-suppressions=yes --suppressions=/home/craigdo/repos/ns-3-allinone-dev/ns-3-dev/testpy.supp
-#   --leak-check=full --error-exitcode=2 /home/craigdo/repos/ns-3-allinone-dev/ns-3-dev/build/debug/utils/test-runner 
+#   --leak-check=full --error-exitcode=2 /home/craigdo/repos/ns-3-allinone-dev/ns-3-dev/build/debug/utils/ns3-dev-test-runner-debug 
 #   --suite=devices-mesh-dot11s-regression --basedir=/home/craigdo/repos/ns-3-allinone-dev/ns-3-dev 
 #   --tempdir=testpy-output 
 #
@@ -666,7 +683,7 @@
     suppressions_path = os.path.join (base, VALGRIND_SUPPRESSIONS_FILE)
 
     if is_python:
-        path_cmd = "python " + os.path.join (base, shell_command)
+        path_cmd = PYTHON[0] + " " + os.path.join (base, shell_command)
     else:
         if len(build_path):
             path_cmd = os.path.join (build_path, shell_command)
@@ -763,7 +780,7 @@
     #
     # This is the shell command that will be executed in the job.  For example,
     #
-    #  "utils/test-runner --test-name=some-test-suite"
+    #  "utils/ns3-dev-test-runner-debug --test-name=some-test-suite"
     #
     def set_shell_command(self, shell_command):
         self.shell_command = shell_command
@@ -917,11 +934,25 @@
                 self.output_queue.put(job)
 
 #
-# This is the main function that does the work of interacting with the test-runner
-# itself.
+# This is the main function that does the work of interacting with the
+# test-runner itself.
 #
 def run_tests():
     #
+    # Pull some interesting configuration information out of waf, primarily
+    # so we can know where executables can be found, but also to tell us what
+    # pieces of the system have been built.  This will tell us what examples 
+    # are runnable.
+    #
+    read_waf_config()
+
+    #
+    # Add the proper prefix and suffix to the test-runner name to
+    # match what is done in the wscript file.
+    #
+    test_runner_name = "%s%s-%s-%s" % (APPNAME, VERSION, "test-runner", BUILD_PROFILE)
+
+    #
     # Run waf to make sure that everything is built, configured and ready to go
     # unless we are explicitly told not to.  We want to be careful about causing
     # our users pain while waiting for extraneous stuff to compile and link, so
@@ -973,12 +1004,8 @@
             return proc.returncode
 
     #
-    # Pull some interesting configuration information out of waf, primarily
-    # so we can know where executables can be found, but also to tell us what
-    # pieces of the system have been built.  This will tell us what examples 
-    # are runnable.
+    # Dynamically set up paths.
     #
-    read_waf_config()
     make_paths()
 
     # Get the information from the build status file.
@@ -1043,12 +1070,12 @@
     # handle them without doing all of the hard work.
     #
     if options.kinds:
-        path_cmd = os.path.join("utils", "test-runner --print-test-type-list")
+        path_cmd = os.path.join("utils", test_runner_name + " --print-test-type-list")
         (rc, standard_out, standard_err, et) = run_job_synchronously(path_cmd, os.getcwd(), False, False)
         print standard_out
 
     if options.list:
-        path_cmd = os.path.join("utils", "test-runner --print-test-name-list")
+        path_cmd = os.path.join("utils", test_runner_name + " --print-test-name-list")
         (rc, standard_out, standard_err, et) = run_job_synchronously(path_cmd, os.getcwd(), False, False)
         print standard_out
 
@@ -1119,7 +1146,7 @@
     #
     if len(options.suite):
         # See if this is a valid test suite.
-        path_cmd = os.path.join("utils", "test-runner --print-test-name-list")
+        path_cmd = os.path.join("utils", test_runner_name + " --print-test-name-list")
         (rc, suites, standard_err, et) = run_job_synchronously(path_cmd, os.getcwd(), False, False)
         if options.suite in suites:
             suites = options.suite + "\n"
@@ -1129,10 +1156,10 @@
 
     elif len(options.example) == 0 and len(options.pyexample) == 0:
         if len(options.constrain):
-            path_cmd = os.path.join("utils", "test-runner --print-test-name-list --test-type=%s" % options.constrain)
+            path_cmd = os.path.join("utils", test_runner_name + " --print-test-name-list --test-type=%s" % options.constrain)
             (rc, suites, standard_err, et) = run_job_synchronously(path_cmd, os.getcwd(), False, False)
         else:
-            path_cmd = os.path.join("utils", "test-runner --print-test-name-list")
+            path_cmd = os.path.join("utils", test_runner_name + " --print-test-name-list")
             (rc, suites, standard_err, et) = run_job_synchronously(path_cmd, os.getcwd(), False, False)
     else:
         suites = ""
@@ -1214,7 +1241,7 @@
             else:
                 multiple = " --stop-on-failure"
 
-            path_cmd = os.path.join("utils", "test-runner --test-name=%s%s" % (test, multiple))
+            path_cmd = os.path.join("utils", test_runner_name + " --test-name=%s%s" % (test, multiple))
             job.set_shell_command(path_cmd)
 
             if options.valgrind and test in core_valgrind_skip_tests:
@@ -1289,7 +1316,7 @@
                             job.set_basedir(os.getcwd())
                             job.set_tempdir(testpy_output_dir)
                             job.set_shell_command(test)
-                            job.set_build_path("")
+                            job.set_build_path(options.buildpath)
 
                             if options.valgrind and not eval(do_valgrind_run):
                                 job.set_is_skip (True)
@@ -1302,8 +1329,13 @@
                             total_tests = total_tests + 1
 
     elif len(options.example):
+        # Add the proper prefix and suffix to the example name to
+        # match what is done in the wscript file.
+        (example_path_without_name, example_name) = os.path.split(options.example)
+        example_name = "%s%s-%s-%s" % (APPNAME, VERSION, example_name, BUILD_PROFILE)
+        example_path = os.path.join(example_path_without_name, example_name)
+
         # Don't try to run this example if it isn't runnable.
-        example_name = os.path.basename(options.example)
         if example_name not in ns3_runnable_programs:
             print "Example %s is not runnable." % example_name
         else:
@@ -1314,16 +1346,16 @@
             job = Job()
             job.set_is_example(True)
             job.set_is_pyexample(False)
-            job.set_display_name(options.example)
+            job.set_display_name(example_name)
             job.set_tmp_file_name("")
             job.set_cwd(testpy_output_dir)
             job.set_basedir(os.getcwd())
             job.set_tempdir(testpy_output_dir)
-            job.set_shell_command(options.example)
+            job.set_shell_command(example_path)
             job.set_build_path(options.buildpath)
 
             if options.verbose:
-                print "Queue %s" % options.example
+                print "Queue %s" % example_name
 
             input_queue.put(job)
             jobs = jobs + 1
--- a/wscript	Wed Jan 18 17:04:01 2012 +0100
+++ b/wscript	Wed Jan 18 18:13:25 2012 +0100
@@ -68,10 +68,8 @@
 wutils.VERSION = VERSION
 wutils.APPNAME = APPNAME
 
-# note: here we disable the VNUM for OSX since it causes problems (bug #1251)
+# we don't use VNUM anymore (see bug #1327 for details)
 wutils.VNUM = None
-if sys.platform != 'darwin' and re.match(r"^\d+\.\d+(\.\d+)?$", VERSION) is not None:
-    wutils.VNUM = VERSION
 
 # these variables are mandatory ('/' are converted automatically)
 top = '.'
@@ -320,6 +318,9 @@
         env.append_value('DEFINES', 'NS3_LOG_ENABLE')
 
     env['PLATFORM'] = sys.platform
+    env['BUILD_PROFILE'] = Options.options.build_profile
+    env['APPNAME'] = wutils.APPNAME
+    env['VERSION'] = wutils.VERSION
 
     if conf.env['CXX_NAME'] in ['gcc', 'icc']:
         if Options.options.build_profile == 'release': 
@@ -570,7 +571,7 @@
     program.is_ns3_program = True
     program.module_deps = list()
     program.name = name
-    program.target = name
+    program.target = "%s%s-%s-%s" % (wutils.APPNAME, wutils.VERSION, name, bld.env.BUILD_PROFILE)
 
     if bld.env['ENABLE_SUDO']:
         program.create_task("SuidBuild")
@@ -584,7 +585,7 @@
 
     program.is_ns3_program = True
     program.name = name
-    program.target = program.name
+    program.target = "%s%s-%s-%s" % (wutils.APPNAME, wutils.VERSION, name, bld.env.BUILD_PROFILE)
     # Each of the modules this program depends on has its own library.
     program.ns3_module_dependencies = ['ns3-'+dep for dep in dependencies]
     program.includes = "# #/.."
@@ -628,6 +629,7 @@
             obj.find_sources_in_dirs('.')
             obj.target = filename
             obj.name = obj.target
+            obj.install_path = None
         elif filename.endswith(".cc"):
             name = filename[:-len(".cc")]
             obj = bld.create_ns3_program(name, all_modules)
@@ -635,6 +637,7 @@
             obj.source = filename
             obj.target = name
             obj.name = obj.target
+            obj.install_path = None
 
 
 def _get_all_task_gen(self):
@@ -748,7 +751,9 @@
                 # Add this program to the list if all of its
                 # dependencies will be built.
                 if program_built:
-                    bld.env.append_value('NS3_RUNNABLE_PROGRAMS', obj.name)
+                    object_name = "%s%s-%s-%s" % (wutils.APPNAME, wutils.VERSION, 
+                                                  obj.name, bld.env.BUILD_PROFILE)
+                    bld.env.append_value('NS3_RUNNABLE_PROGRAMS', object_name)
 
             # disable the modules themselves
             if hasattr(obj, "is_ns3_module") and obj.name not in modules:
--- a/wutils.py	Wed Jan 18 17:04:01 2012 +0100
+++ b/wutils.py	Wed Jan 18 18:13:25 2012 +0100
@@ -61,8 +61,8 @@
                 or obj.path.abspath(env).startswith(launch_dir)):
             continue
         
-        name1 = obj.target
-        name2 = os.path.join(relpath(obj.path.abspath(), launch_dir), obj.target)
+        name1 = obj.name
+        name2 = os.path.join(relpath(obj.path.abspath(), launch_dir), obj.name)
         names = [name1, name2]
         found_programs.extend(names)
         if program_name in names: