From 4fea31db4496e75b62691120164a5de01fee93f8 Mon Sep 17 00:00:00 2001 From: Mitch Watrous Date: Sun, 20 Mar 2011 16:32:46 -0700 Subject: [PATCH 1/2] Fix dependencies list for test module --- src/test/wscript | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/wscript b/src/test/wscript index 6c36db3bf..f48d5c9f8 100644 --- a/src/test/wscript +++ b/src/test/wscript @@ -4,7 +4,7 @@ def configure(conf): conf.sub_config('perf') def build(bld): - test = bld.create_ns3_module('test', ['core']) + test = bld.create_ns3_module('test', ['internet', 'mobility', 'applications', 'csma', 'bridge', 'contrib', 'point-to-point']) test.source = [ 'csma-system-test-suite.cc', 'global-routing-test-suite.cc', From 4ec8e661c0afac9f7bffcc50fefb308f16e3d850 Mon Sep 17 00:00:00 2001 From: Mitch Watrous Date: Mon, 21 Mar 2011 11:26:56 -0700 Subject: [PATCH 2/2] Test implicitly dependent modules --- src/wscript | 7 ++----- wscript | 42 +++++++++++++++++++++++++++--------------- 2 files changed, 29 insertions(+), 20 deletions(-) diff --git a/src/wscript b/src/wscript index 5c8579770..1de9490fa 100644 --- a/src/wscript +++ b/src/wscript @@ -143,11 +143,8 @@ def create_ns3_module_test_library(bld, name): library.is_ns3_module_test_library = True library.module_name = 'ns3-' + name - # Add this test library and module to the lists if the module is - # enabled. - if library.module_name in bld.env['NS3_ENABLED_MODULES']: - bld.env.append_value('NS3_ENABLED_MODULES_WITH_TEST_LIBRARIES', library.module_name) - bld.env.append_value('NS3_ENABLED_MODULE_TEST_LIBRARIES', library.name) + # Add this module and test library to the list. + bld.env.append_value('NS3_MODULES_WITH_TEST_LIBRARIES', (library.module_name, library.name)) # Set the include path from the build directory to modules. relative_path_from_build_to_here = bld.path.relpath_gen(bld.bldnode) diff --git a/wscript b/wscript index 652f87abf..60f748cc8 100644 --- a/wscript +++ b/wscript @@ -537,7 +537,7 @@ def add_scratch_programs(bld): def build(bld): - bld.env['NS3_ENABLED_MODULES_WITH_TEST_LIBRARIES'] = [] + bld.env['NS3_MODULES_WITH_TEST_LIBRARIES'] = [] bld.env['NS3_ENABLED_MODULE_TEST_LIBRARIES'] = [] wutils.bld = bld @@ -559,22 +559,11 @@ def build(bld): # process subfolders from here bld.add_subdirs('src') bld.add_subdirs('samples') - bld.add_subdirs('utils') - add_examples_programs(bld) - add_scratch_programs(bld) - - ## if --enabled-modules option was given, we disable building the - ## modules that were not enabled, and programs that depend on - ## disabled modules. env = bld.env - if Options.options.enable_modules: - Logs.warn("the option --enable-modules is being applied to this build only;" - " to make it permanent it needs to be given to waf configure.") - env['NS3_ENABLED_MODULES'] = ['ns3-'+mod for mod in - Options.options.enable_modules.split(',')] - + # If modules have been enabled, then set lists of enabled modules + # and enabled module test libraries. if env['NS3_ENABLED_MODULES']: modules = env['NS3_ENABLED_MODULES'] @@ -598,7 +587,30 @@ def build(bld): env['NS3_ENABLED_MODULES'] = modules print "Modules to build:", modules - print "Modules to test:", env['NS3_ENABLED_MODULES_WITH_TEST_LIBRARIES'] + # Set the list of the enabled module test libraries. + for (mod, testlib) in bld.env['NS3_MODULES_WITH_TEST_LIBRARIES']: + 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) + + ## if --enabled-modules option was given, we disable building the + ## modules that were not enabled, and programs that depend on + ## disabled modules. + + if Options.options.enable_modules: + Logs.warn("the option --enable-modules is being applied to this build only;" + " to make it permanent it needs to be given to waf configure.") + env['NS3_ENABLED_MODULES'] = ['ns3-'+mod for mod in + Options.options.enable_modules.split(',')] + + if env['NS3_ENABLED_MODULES']: + modules = env['NS3_ENABLED_MODULES'] def exclude_taskgen(bld, taskgen): # ok, so WAF does not provide an API to prevent an