Remove test.py's hard-coded paths for modules an extra subdirectory lower
authorMitch Watrous <watrous@u.washington.edu>
Wed, 15 Dec 2010 16:18:52 -0800
changeset 6677 2a6c093dd274
parent 6676 28044593e8ac
child 6678 6faf465c19e3
Remove test.py's hard-coded paths for modules an extra subdirectory lower
modules/contrib/flow-monitor/test/examples-to-run.py
modules/devices/bridge/test/examples-to-run.py
modules/devices/virtual-net-device/test/examples-to-run.py
modules/routing/olsr/test/examples-to-run.py
modules/simulator/test/examples-to-run.py
modules/simulator/tests/examples-to-run.py
test.py
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/contrib/flow-monitor/test/examples-to-run.py	Wed Dec 15 16:18:52 2010 -0800
@@ -0,0 +1,20 @@
+#! /usr/bin/env python
+## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
+
+# A list of C++ examples to run in order to ensure that they remain
+# buildable and runnable over time.  Each tuple in the list contains
+#
+#     (example_name, do_run, do_valgrind_run).
+#
+# See test.py for more information.
+cpp_examples = []
+
+# A list of Python examples to run in order to ensure that they remain
+# runnable over time.  Each tuple in the list contains
+#
+#     (example_name, do_run).
+#
+# See test.py for more information.
+python_examples = [
+    ("wifi-olsr-flowmon.py", "True"),
+]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/devices/bridge/test/examples-to-run.py	Wed Dec 15 16:18:52 2010 -0800
@@ -0,0 +1,23 @@
+#! /usr/bin/env python
+## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
+
+# A list of C++ examples to run in order to ensure that they remain
+# buildable and runnable over time.  Each tuple in the list contains
+#
+#     (example_name, do_run, do_valgrind_run).
+#
+# See test.py for more information.
+cpp_examples = [
+    ("csma-bridge", "True", "True"),
+    ("csma-bridge-one-hop", "True", "True"),
+]
+
+# A list of Python examples to run in order to ensure that they remain
+# runnable over time.  Each tuple in the list contains
+#
+#     (example_name, do_run).
+#
+# See test.py for more information.
+python_examples = [
+    ("csma-bridge.py", "True"),
+]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/devices/virtual-net-device/test/examples-to-run.py	Wed Dec 15 16:18:52 2010 -0800
@@ -0,0 +1,20 @@
+#! /usr/bin/env python
+## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
+
+# A list of C++ examples to run in order to ensure that they remain
+# buildable and runnable over time.  Each tuple in the list contains
+#
+#     (example_name, do_run, do_valgrind_run).
+#
+# See test.py for more information.
+cpp_examples = [
+    ("virtual-net-device", "True", "True"),
+]
+
+# A list of Python examples to run in order to ensure that they remain
+# runnable over time.  Each tuple in the list contains
+#
+#     (example_name, do_run).
+#
+# See test.py for more information.
+python_examples = []
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/routing/olsr/test/examples-to-run.py	Wed Dec 15 16:18:52 2010 -0800
@@ -0,0 +1,20 @@
+#! /usr/bin/env python
+## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
+
+# A list of C++ examples to run in order to ensure that they remain
+# buildable and runnable over time.  Each tuple in the list contains
+#
+#     (example_name, do_run, do_valgrind_run).
+#
+# See test.py for more information.
+cpp_examples = [
+    ("simple-point-to-point-olsr", "True", "True"),
+]
+
+# A list of Python examples to run in order to ensure that they remain
+# runnable over time.  Each tuple in the list contains
+#
+#     (example_name, do_run).
+#
+# See test.py for more information.
+python_examples = []
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/simulator/test/examples-to-run.py	Wed Dec 15 16:18:52 2010 -0800
@@ -0,0 +1,18 @@
+#! /usr/bin/env python
+## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
+
+# A list of C++ examples to run in order to ensure that they remain
+# buildable and runnable over time.  Each tuple in the list contains
+#
+#     (example_name, do_run, do_valgrind_run).
+#
+# See test.py for more information.
+cpp_examples = []
+
+# A list of Python examples to run in order to ensure that they remain
+# runnable over time.  Each tuple in the list contains
+#
+#     (example_name, do_run).
+#
+# See test.py for more information.
+python_examples = []
--- a/modules/simulator/tests/examples-to-run.py	Wed Dec 15 10:54:08 2010 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,18 +0,0 @@
-#! /usr/bin/env python
-## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
-
-# A list of C++ examples to run in order to ensure that they remain
-# buildable and runnable over time.  Each tuple in the list contains
-#
-#     (example_name, do_run, do_valgrind_run).
-#
-# See test.py for more information.
-cpp_examples = []
-
-# A list of Python examples to run in order to ensure that they remain
-# runnable over time.  Each tuple in the list contains
-#
-#     (example_name, do_run).
-#
-# See test.py for more information.
-python_examples = []
--- a/test.py	Wed Dec 15 10:54:08 2010 -0800
+++ b/test.py	Wed Dec 15 16:18:52 2010 -0800
@@ -94,8 +94,6 @@
 # hardcoded.
 #
 example_tests = [
-    ("modules/devices/bridge/examples/csma-bridge", "True", "True"),
-    ("modules/devices/bridge/examples/csma-bridge-one-hop", "True", "True"),
     ("examples/csma/csma-broadcast", "True", "True"),
     ("examples/csma/csma-multicast", "True", "True"),
     ("examples/csma/csma-one-subnet", "True", "True"),
@@ -129,7 +127,6 @@
     ("examples/routing/nms-p2p-nix", "False", "True"), # Takes too long to run
     ("examples/routing/simple-alternate-routing", "True", "True"),
     ("examples/routing/simple-global-routing", "True", "True"),
-    ("modules/routing/olsr/examples/simple-point-to-point-olsr", "True", "True"),
     ("examples/routing/simple-routing-ping6", "True", "True"),
     ("examples/routing/static-routing-slash32", "True", "True"),
     ("examples/routing/aodv", "True", "True"),
@@ -150,8 +147,6 @@
     ("examples/topology-read/topology-read --input=../../examples/topology-read/Inet_small_toposample.txt", "True", "True"),
     ("examples/topology-read/topology-read --format=Rocketfuel --input=../../examples/topology-read/RocketFuel_toposample_1239_weights.txt", "True", "True"),
 
-    ("modules/devices/virtual-net-device/examples/virtual-net-device", "True", "True"),
-
 
     ("examples/udp/udp-echo", "True", "True"),
 
@@ -187,10 +182,6 @@
 # hardcoded.
 #
 python_tests = [
-    ("modules/devices/bridge/examples/csma-bridge.py", "True"),
-
-    ("modules/contrib/flow-monitor/examples/wifi-olsr-flowmon.py", "True"),
-
     ("examples/routing/simple-routing-ping6.py", "True"),
 
     ("examples/tap/tap-csma-virtual-machine.py", "False"), # requires enable-sudo
@@ -1115,10 +1106,29 @@
         # Remove the "ns3-" from the module name.
         module = module[len("ns3-"):]
 
+        # XXX This code that adds extra subdirectories to some of the
+        # modules' paths should be removed from this file once these
+        # modules have been moved to the same level as all of the
+        # other modules.
+        #
+        # Some modules are one subdirectory lower in the directory
+        # structure than others.
+        #
+        # Add the extract subdirectory to this module's path if it
+        # needs it.
+        moduleOneSubdirLower = {
+            "flow-monitor": "contrib",
+            "bridge": "devices", 
+            "virtual-net-device": "devices",
+            "olsr": "routing"
+            }
+        if module in moduleOneSubdirLower:
+            module = os.path.join(moduleOneSubdirLower[module], module)
+
         # Set the directories and paths for this example. 
         module_directory     = os.path.join("modules", module)
         example_directory    = os.path.join(module_directory, "examples")
-        examples_to_run_path = os.path.join(module_directory, "tests", "examples-to-run.py")
+        examples_to_run_path = os.path.join(module_directory, "test", "examples-to-run.py")
         cpp_executable_dir   = os.path.join(NS3_BUILDDIR, NS3_ACTIVE_VARIANT, example_directory)
         python_script_dir    = os.path.join(example_directory)