Bug 1206 - Test libraries are built but test suites are not being run in test.py
authorGustavo J. A. M. Carneiro <gjc@inescporto.pt>
Tue, 05 Jul 2011 11:05:53 +0100
changeset 7337 ac13a12e9dd4
parent 7331 827246e3bc4c
child 7338 880daec5884f
Bug 1206 - Test libraries are built but test suites are not being run in test.py
utils/wscript
wscript
--- a/utils/wscript	Sun Jul 03 12:01:29 2011 +0100
+++ b/utils/wscript	Tue Jul 05 11:05:53 2011 +0100
@@ -10,7 +10,7 @@
 
     # Set the libraries the testrunner depends on equal to the list of
     # enabled modules plus the list of enabled module test libraries.
-    test_runner.uselib_local = env['NS3_ENABLED_MODULES'] + env['NS3_ENABLED_MODULE_TEST_LIBRARIES']
+    test_runner.uselib_local = [mod+"--lib" for mod in (env['NS3_ENABLED_MODULES'] + env['NS3_ENABLED_MODULE_TEST_LIBRARIES'])]
     
     obj = bld.create_ns3_program('bench-simulator', ['core'])
     obj.source = 'bench-simulator.cc'
--- a/wscript	Sun Jul 03 12:01:29 2011 +0100
+++ b/wscript	Tue Jul 05 11:05:53 2011 +0100
@@ -610,7 +610,7 @@
 
 def _add_ns3_program_missing_deps(bld, program):
     deps_found = program.ns3_module_dependencies
-    program.uselib_local = [dep + "--lib" for dep in deps_found]
+    program.uselib_local = getattr(program, "uselib_local", []) + [dep + "--lib" for dep in deps_found]
     if program.env['ENABLE_STATIC_NS3'] and not program.env['ENABLE_SHARED_AND_STATIC_NS3']:
         if sys.platform == 'darwin':
             program.env.append_value('LINKFLAGS', '-Wl,-all_load')
@@ -690,10 +690,6 @@
                 if mod in bld.env['NS3_ENABLED_MODULES']:
                     bld.env.append_value('NS3_ENABLED_MODULE_TEST_LIBRARIES', testlib)
 
-    # Process this subfolder here after the lists of enabled modules
-    # and module test libraries have been set.
-    bld.add_subdirs('utils')
-
     add_examples_programs(bld)
     add_scratch_programs(bld)
 
@@ -789,12 +785,15 @@
             for lib in gen.libs:
                 lib.post()
 
+    # Process this subfolder here after the lists of enabled modules
+    # and module test libraries have been set.
+    bld.add_subdirs('utils')
+
     for gen in bld.all_task_gen:
         if not getattr(gen, "is_ns3_program", False) or not hasattr(gen, "ns3_module_dependencies"):
             continue
         _add_ns3_program_missing_deps(bld, gen)
 
-
     if Options.options.run:
         # Check that the requested program name is valid
         program_name, dummy_program_argv = wutils.get_run_program(Options.options.run, wutils.get_command_template(env))