From 6c0d5166e8d42e53c618d580a5ffd459b22797e5 Mon Sep 17 00:00:00 2001 From: Mitch Watrous Date: Fri, 15 Apr 2011 13:03:02 -0700 Subject: [PATCH] Make examples that were in samples directory run --- src/{network => core}/examples/main-test-sync.cc | 0 src/core/examples/wscript | 6 +++++- src/core/test/examples-to-run.py | 10 +++++++++- src/core/wscript | 3 +++ src/internet/test/examples-to-run.py | 1 + src/internet/wscript | 3 +++ src/mobility/test/examples-to-run.py | 3 +++ src/mobility/wscript | 3 +++ src/network/examples/wscript | 8 ++------ src/network/test/examples-to-run.py | 2 ++ src/network/wscript | 3 +++ src/propagation/test/examples-to-run.py | 1 + src/propagation/wscript | 3 +++ test.py | 2 ++ 14 files changed, 40 insertions(+), 8 deletions(-) rename src/{network => core}/examples/main-test-sync.cc (100%) diff --git a/src/network/examples/main-test-sync.cc b/src/core/examples/main-test-sync.cc similarity index 100% rename from src/network/examples/main-test-sync.cc rename to src/core/examples/main-test-sync.cc diff --git a/src/core/examples/wscript b/src/core/examples/wscript index 6de106202..da239037e 100644 --- a/src/core/examples/wscript +++ b/src/core/examples/wscript @@ -4,7 +4,7 @@ def build(bld): if not bld.env['ENABLE_EXAMPLES']: return; - obj = bld.create_ns3_program('main-attribute-value', ['core', 'node', 'devices/point-to-point']) + obj = bld.create_ns3_program('main-attribute-value', ['network', 'point-to-point']) obj.source = 'main-attribute-value.cc' obj = bld.create_ns3_program('main-callback', ['core']) @@ -23,3 +23,7 @@ def build(bld): ['core']) obj.source = 'sample-random-variable.cc' + if bld.env['ENABLE_THREADING'] and bld.env["ENABLE_REAL_TIME"]: + obj = bld.create_ns3_program('main-test-sync', ['network']) + obj.source = 'main-test-sync.cc' + diff --git a/src/core/test/examples-to-run.py b/src/core/test/examples-to-run.py index cb0a204e8..23cf2c0f7 100644 --- a/src/core/test/examples-to-run.py +++ b/src/core/test/examples-to-run.py @@ -8,6 +8,12 @@ # # See test.py for more information. cpp_examples = [ + ("main-attribute-value", "True", "True"), + ("main-callback", "True", "True"), + ("sample-simulator", "True", "True"), + ("main-ptr", "True", "True"), + ("main-random-variable", "True", "True"), + ("sample-random-variable", "True", "True"), ] # A list of Python examples to run in order to ensure that they remain @@ -16,4 +22,6 @@ cpp_examples = [ # (example_name, do_run). # # See test.py for more information. -python_examples = [] +python_examples = [ + ("sample-simulator.py", "True"), +] diff --git a/src/core/wscript b/src/core/wscript index e288f20cc..a70506729 100644 --- a/src/core/wscript +++ b/src/core/wscript @@ -292,6 +292,9 @@ def build(bld): core_test.uselib = core_test.uselib + ' GSL GSLCBLAS M' core_test.source.extend(['test/rng-test-suite.cc']) + if (bld.env['ENABLE_EXAMPLES']): + bld.add_subdirs('examples') + pymod = bld.ns3_python_bindings() if pymod is not None: pymod.source += ['bindings/module_helpers.cc'] diff --git a/src/internet/test/examples-to-run.py b/src/internet/test/examples-to-run.py index cb0a204e8..9fafb8ba9 100644 --- a/src/internet/test/examples-to-run.py +++ b/src/internet/test/examples-to-run.py @@ -8,6 +8,7 @@ # # See test.py for more information. cpp_examples = [ + ("main-simple", "True", "True"), ] # A list of Python examples to run in order to ensure that they remain diff --git a/src/internet/wscript b/src/internet/wscript index 7432d8b12..7649c59b5 100644 --- a/src/internet/wscript +++ b/src/internet/wscript @@ -283,5 +283,8 @@ def build(bld): obj.uselib = 'DL' internet_test.uselib = 'DL' + if (bld.env['ENABLE_EXAMPLES']): + bld.add_subdirs('examples') + bld.ns3_python_bindings() diff --git a/src/mobility/test/examples-to-run.py b/src/mobility/test/examples-to-run.py index cb0a204e8..d7c34d0c4 100644 --- a/src/mobility/test/examples-to-run.py +++ b/src/mobility/test/examples-to-run.py @@ -8,6 +8,9 @@ # # See test.py for more information. cpp_examples = [ + ("main-grid-topology", "True", "True"), + ("main-random-topology", "True", "True"), + ("main-random-walk", "True", "True"), ] # A list of Python examples to run in order to ensure that they remain diff --git a/src/mobility/wscript b/src/mobility/wscript index b065ae20c..da6f3fbd1 100644 --- a/src/mobility/wscript +++ b/src/mobility/wscript @@ -53,4 +53,7 @@ def build(bld): 'helper/ns2-mobility-helper.h', ] + if (bld.env['ENABLE_EXAMPLES']): + bld.add_subdirs('examples') + bld.ns3_python_bindings() diff --git a/src/network/examples/wscript b/src/network/examples/wscript index 4839ee55c..6bd430683 100644 --- a/src/network/examples/wscript +++ b/src/network/examples/wscript @@ -4,13 +4,9 @@ def build(bld): if not bld.env['ENABLE_EXAMPLES']: return; - obj = bld.create_ns3_program('main-packet-header', ['common', 'core']) + obj = bld.create_ns3_program('main-packet-header', ['network']) obj.source = 'main-packet-header.cc' - obj = bld.create_ns3_program('main-packet-tag', ['common', 'core']) + obj = bld.create_ns3_program('main-packet-tag', ['network']) obj.source = 'main-packet-tag.cc' - if bld.env['ENABLE_THREADING'] and bld.env["ENABLE_REAL_TIME"]: - obj = bld.create_ns3_program('main-test-sync') - obj.source = 'main-test-sync.cc' - diff --git a/src/network/test/examples-to-run.py b/src/network/test/examples-to-run.py index cb0a204e8..a9647ae79 100644 --- a/src/network/test/examples-to-run.py +++ b/src/network/test/examples-to-run.py @@ -8,6 +8,8 @@ # # See test.py for more information. cpp_examples = [ + ("main-packet-header", "True", "True"), + ("main-packet-tag", "True", "True"), ] # A list of Python examples to run in order to ensure that they remain diff --git a/src/network/wscript b/src/network/wscript index a70120c6e..fa1ea3fa0 100644 --- a/src/network/wscript +++ b/src/network/wscript @@ -126,4 +126,7 @@ def build(bld): 'helper/trace-helper.h', ] + if (bld.env['ENABLE_EXAMPLES']): + bld.add_subdirs('examples') + bld.ns3_python_bindings() diff --git a/src/propagation/test/examples-to-run.py b/src/propagation/test/examples-to-run.py index cb0a204e8..cdd23245d 100644 --- a/src/propagation/test/examples-to-run.py +++ b/src/propagation/test/examples-to-run.py @@ -8,6 +8,7 @@ # # See test.py for more information. cpp_examples = [ + ("main-propagation-loss", "True", "True"), ] # A list of Python examples to run in order to ensure that they remain diff --git a/src/propagation/wscript b/src/propagation/wscript index d3d4918b9..df7d068e4 100644 --- a/src/propagation/wscript +++ b/src/propagation/wscript @@ -24,4 +24,7 @@ def build(bld): 'model/cost231-propagation-loss-model.h', ] + if (bld.env['ENABLE_EXAMPLES']): + bld.add_subdirs('examples') + bld.ns3_python_bindings() diff --git a/test.py b/test.py index 3b300bda4..8c038b246 100755 --- a/test.py +++ b/test.py @@ -47,6 +47,7 @@ interesting_config_items = [ "NS3_MODULE_PATH", "NSC_ENABLED", "ENABLE_REAL_TIME", + "ENABLE_THREADING", "ENABLE_EXAMPLES", "EXAMPLE_DIRECTORIES", "ENABLE_PYTHON_BINDINGS", @@ -56,6 +57,7 @@ interesting_config_items = [ NSC_ENABLED = False ENABLE_REAL_TIME = False +ENABLE_THREADING = False ENABLE_EXAMPLES = True ENABLE_CLICK = False ENABLE_OPENFLOW = False