Bug 1108 - test.py -e option needs repair

This commit is contained in:
Mitch Watrous
2011-04-26 12:53:50 -07:00
parent 437312f163
commit 23209eb41f
7 changed files with 119 additions and 96 deletions

View File

@@ -109,25 +109,31 @@ if you run ``test.py --help`` you should see a command summary like:
Options:
-h, --help show this help message and exit
-b BUILDPATH, --buildpath=BUILDPATH
specify the path where ns-3 was built (defaults to the
build directory for the current variant)
-c KIND, --constrain=KIND
constrain the test-runner by kind of test
-e EXAMPLE, --example=EXAMPLE
specify a single example to run
specify a single example to run (with relative path)
-g, --grind run the test suites and examples using valgrind
-k, --kinds print the kinds of tests available
-l, --list print the list of known tests
-m, --multiple report multiple failures from test suites and test
cases
-n, --nowaf do not run waf before starting testing
-p PYEXAMPLE, --pyexample=PYEXAMPLE
specify a single python example to run (with relative
path)
-r, --retain retain all temporary files (which are normally
deleted)
-s TEST-SUITE, --suite=TEST-SUITE
specify a single test suite to run
-t TEXT-FILE, --text=TEXT-FILE
write detailed test results into TEXT-FILE.txt
-v, --verbose print progress and informational messages
-w HTML-FILE, --web=HTML-FILE, --html=HTML-FILE
write detailed test results into HTML-FILE.html
-r, --retain retain all temporary files (which are normally
deleted)
-t TEXT-FILE, --text=TEXT-FILE
write detailed test results into TEXT-FILE.txt
-x XML-FILE, --xml=XML-FILE
write detailed test results into XML-FILE.xml
@@ -271,18 +277,44 @@ will result in a list of the test suite being displayed, similar to::
Any of these listed suites can be selected to be run by itself using the
``--suite`` option as shown above.
Similarly to test suites, one can run a single example program using the ``--example``
option.
Similarly to test suites, one can run a single C++ example program
using the ``--example`` option. Note that the relative path for the
example must be included and that the executables built for C++
examples do not have extensions. Entering
::
./test.py --example=udp-echo
./test.py --example=examples/udp/udp-echo
results in that single example being run.
::
PASS: Example udp-echo
PASS: Example examples/udp/udp-echo
You can specify the directory where ns-3 was built using the
``--buildpath`` option as follows.
::
./test.py --buildpath=/home/craigdo/repos/ns-3-allinone-test/ns-3-dev/build/debug --example=examples/wireless/wifi-simple-adhoc
One can run a single Python example program using the ``--pyexample``
option. Note that the relative path for the example must be included
and that Python examples do need their extensions. Entering
::
./test.py --pyexample=examples/tutorial/first.py
results in that single example being run.
::
PASS: Example examples/tutorial/first.py
Because Python examples are not built, you do not need to specify the
directory where ns-3 was built to run them.
Normally when example programs are executed, they write a large amount of trace
file data. This is normally saved to the base directory of the distribution

View File

@@ -1,2 +1,3 @@
callback_classes = [
['void', 'ns3::Ptr<ns3::Packet>', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'],
]

View File

@@ -44,8 +44,6 @@ def register_types(module):
module.add_class('LbtsMessage')
## mpi-interface.h (module 'mpi'): ns3::MpiInterface [class]
module.add_class('MpiInterface')
## mpi-net-device.h (module 'mpi'): ns3::MpiNetDevice [class]
module.add_class('MpiNetDevice', allow_subclassing=True)
## object-base.h (module 'core'): ns3::ObjectBase [class]
module.add_class('ObjectBase', allow_subclassing=True, import_from_module='ns.core')
## object.h (module 'core'): ns3::ObjectDeleter [struct]
@@ -144,6 +142,8 @@ def register_types(module):
module.add_class('EmptyAttributeValue', import_from_module='ns.core', parent=root_module['ns3::AttributeValue'])
## event-impl.h (module 'core'): ns3::EventImpl [class]
module.add_class('EventImpl', import_from_module='ns.core', parent=root_module['ns3::SimpleRefCount< ns3::EventImpl, ns3::empty, ns3::DefaultDeleter<ns3::EventImpl> >'])
## mpi-receiver.h (module 'mpi'): ns3::MpiReceiver [class]
module.add_class('MpiReceiver', parent=root_module['ns3::Object'])
## nix-vector.h (module 'network'): ns3::NixVector [class]
module.add_class('NixVector', import_from_module='ns.network', parent=root_module['ns3::SimpleRefCount< ns3::NixVector, ns3::empty, ns3::DefaultDeleter<ns3::NixVector> >'])
## object-factory.h (module 'core'): ns3::ObjectFactoryChecker [class]
@@ -184,7 +184,6 @@ def register_methods(root_module):
register_Ns3EventId_methods(root_module, root_module['ns3::EventId'])
register_Ns3LbtsMessage_methods(root_module, root_module['ns3::LbtsMessage'])
register_Ns3MpiInterface_methods(root_module, root_module['ns3::MpiInterface'])
register_Ns3MpiNetDevice_methods(root_module, root_module['ns3::MpiNetDevice'])
register_Ns3ObjectBase_methods(root_module, root_module['ns3::ObjectBase'])
register_Ns3ObjectDeleter_methods(root_module, root_module['ns3::ObjectDeleter'])
register_Ns3ObjectFactory_methods(root_module, root_module['ns3::ObjectFactory'])
@@ -230,6 +229,7 @@ def register_methods(root_module):
register_Ns3DistributedSimulatorImpl_methods(root_module, root_module['ns3::DistributedSimulatorImpl'])
register_Ns3EmptyAttributeValue_methods(root_module, root_module['ns3::EmptyAttributeValue'])
register_Ns3EventImpl_methods(root_module, root_module['ns3::EventImpl'])
register_Ns3MpiReceiver_methods(root_module, root_module['ns3::MpiReceiver'])
register_Ns3NixVector_methods(root_module, root_module['ns3::NixVector'])
register_Ns3ObjectFactoryChecker_methods(root_module, root_module['ns3::ObjectFactoryChecker'])
register_Ns3ObjectFactoryValue_methods(root_module, root_module['ns3::ObjectFactoryValue'])
@@ -773,22 +773,6 @@ def register_Ns3MpiInterface_methods(root_module, cls):
is_static=True)
return
def register_Ns3MpiNetDevice_methods(root_module, cls):
## mpi-net-device.h (module 'mpi'): ns3::MpiNetDevice::MpiNetDevice() [constructor]
cls.add_constructor([])
## mpi-net-device.h (module 'mpi'): ns3::MpiNetDevice::MpiNetDevice(ns3::MpiNetDevice const & arg0) [copy constructor]
cls.add_constructor([param('ns3::MpiNetDevice const &', 'arg0')])
## mpi-net-device.h (module 'mpi'): void ns3::MpiNetDevice::MpiReceive(ns3::Ptr<ns3::Packet> p) [member function]
cls.add_method('MpiReceive',
'void',
[param('ns3::Ptr< ns3::Packet >', 'p')])
## mpi-net-device.h (module 'mpi'): void ns3::MpiNetDevice::DoMpiReceive(ns3::Ptr<ns3::Packet> p) [member function]
cls.add_method('DoMpiReceive',
'void',
[param('ns3::Ptr< ns3::Packet >', 'p')],
is_pure_virtual=True, visibility='protected', is_virtual=True)
return
def register_Ns3ObjectBase_methods(root_module, cls):
## object-base.h (module 'core'): ns3::ObjectBase::ObjectBase() [constructor]
cls.add_constructor([])
@@ -2401,6 +2385,26 @@ def register_Ns3EventImpl_methods(root_module, cls):
is_pure_virtual=True, visibility='protected', is_virtual=True)
return
def register_Ns3MpiReceiver_methods(root_module, cls):
## mpi-receiver.h (module 'mpi'): ns3::MpiReceiver::MpiReceiver() [constructor]
cls.add_constructor([])
## mpi-receiver.h (module 'mpi'): ns3::MpiReceiver::MpiReceiver(ns3::MpiReceiver const & arg0) [copy constructor]
cls.add_constructor([param('ns3::MpiReceiver const &', 'arg0')])
## mpi-receiver.h (module 'mpi'): static ns3::TypeId ns3::MpiReceiver::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## mpi-receiver.h (module 'mpi'): void ns3::MpiReceiver::Receive(ns3::Ptr<ns3::Packet> p) [member function]
cls.add_method('Receive',
'void',
[param('ns3::Ptr< ns3::Packet >', 'p')])
## mpi-receiver.h (module 'mpi'): void ns3::MpiReceiver::SetReceiveCallback(ns3::Callback<void, ns3::Ptr<ns3::Packet>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> callback) [member function]
cls.add_method('SetReceiveCallback',
'void',
[param('ns3::Callback< void, ns3::Ptr< ns3::Packet >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')])
return
def register_Ns3NixVector_methods(root_module, cls):
cls.add_output_stream_operator()
## nix-vector.h (module 'network'): ns3::NixVector::NixVector() [constructor]

View File

@@ -44,8 +44,6 @@ def register_types(module):
module.add_class('LbtsMessage')
## mpi-interface.h (module 'mpi'): ns3::MpiInterface [class]
module.add_class('MpiInterface')
## mpi-net-device.h (module 'mpi'): ns3::MpiNetDevice [class]
module.add_class('MpiNetDevice', allow_subclassing=True)
## object-base.h (module 'core'): ns3::ObjectBase [class]
module.add_class('ObjectBase', allow_subclassing=True, import_from_module='ns.core')
## object.h (module 'core'): ns3::ObjectDeleter [struct]
@@ -144,6 +142,8 @@ def register_types(module):
module.add_class('EmptyAttributeValue', import_from_module='ns.core', parent=root_module['ns3::AttributeValue'])
## event-impl.h (module 'core'): ns3::EventImpl [class]
module.add_class('EventImpl', import_from_module='ns.core', parent=root_module['ns3::SimpleRefCount< ns3::EventImpl, ns3::empty, ns3::DefaultDeleter<ns3::EventImpl> >'])
## mpi-receiver.h (module 'mpi'): ns3::MpiReceiver [class]
module.add_class('MpiReceiver', parent=root_module['ns3::Object'])
## nix-vector.h (module 'network'): ns3::NixVector [class]
module.add_class('NixVector', import_from_module='ns.network', parent=root_module['ns3::SimpleRefCount< ns3::NixVector, ns3::empty, ns3::DefaultDeleter<ns3::NixVector> >'])
## object-factory.h (module 'core'): ns3::ObjectFactoryChecker [class]
@@ -184,7 +184,6 @@ def register_methods(root_module):
register_Ns3EventId_methods(root_module, root_module['ns3::EventId'])
register_Ns3LbtsMessage_methods(root_module, root_module['ns3::LbtsMessage'])
register_Ns3MpiInterface_methods(root_module, root_module['ns3::MpiInterface'])
register_Ns3MpiNetDevice_methods(root_module, root_module['ns3::MpiNetDevice'])
register_Ns3ObjectBase_methods(root_module, root_module['ns3::ObjectBase'])
register_Ns3ObjectDeleter_methods(root_module, root_module['ns3::ObjectDeleter'])
register_Ns3ObjectFactory_methods(root_module, root_module['ns3::ObjectFactory'])
@@ -230,6 +229,7 @@ def register_methods(root_module):
register_Ns3DistributedSimulatorImpl_methods(root_module, root_module['ns3::DistributedSimulatorImpl'])
register_Ns3EmptyAttributeValue_methods(root_module, root_module['ns3::EmptyAttributeValue'])
register_Ns3EventImpl_methods(root_module, root_module['ns3::EventImpl'])
register_Ns3MpiReceiver_methods(root_module, root_module['ns3::MpiReceiver'])
register_Ns3NixVector_methods(root_module, root_module['ns3::NixVector'])
register_Ns3ObjectFactoryChecker_methods(root_module, root_module['ns3::ObjectFactoryChecker'])
register_Ns3ObjectFactoryValue_methods(root_module, root_module['ns3::ObjectFactoryValue'])
@@ -773,22 +773,6 @@ def register_Ns3MpiInterface_methods(root_module, cls):
is_static=True)
return
def register_Ns3MpiNetDevice_methods(root_module, cls):
## mpi-net-device.h (module 'mpi'): ns3::MpiNetDevice::MpiNetDevice() [constructor]
cls.add_constructor([])
## mpi-net-device.h (module 'mpi'): ns3::MpiNetDevice::MpiNetDevice(ns3::MpiNetDevice const & arg0) [copy constructor]
cls.add_constructor([param('ns3::MpiNetDevice const &', 'arg0')])
## mpi-net-device.h (module 'mpi'): void ns3::MpiNetDevice::MpiReceive(ns3::Ptr<ns3::Packet> p) [member function]
cls.add_method('MpiReceive',
'void',
[param('ns3::Ptr< ns3::Packet >', 'p')])
## mpi-net-device.h (module 'mpi'): void ns3::MpiNetDevice::DoMpiReceive(ns3::Ptr<ns3::Packet> p) [member function]
cls.add_method('DoMpiReceive',
'void',
[param('ns3::Ptr< ns3::Packet >', 'p')],
is_pure_virtual=True, visibility='protected', is_virtual=True)
return
def register_Ns3ObjectBase_methods(root_module, cls):
## object-base.h (module 'core'): ns3::ObjectBase::ObjectBase() [constructor]
cls.add_constructor([])
@@ -2401,6 +2385,26 @@ def register_Ns3EventImpl_methods(root_module, cls):
is_pure_virtual=True, visibility='protected', is_virtual=True)
return
def register_Ns3MpiReceiver_methods(root_module, cls):
## mpi-receiver.h (module 'mpi'): ns3::MpiReceiver::MpiReceiver() [constructor]
cls.add_constructor([])
## mpi-receiver.h (module 'mpi'): ns3::MpiReceiver::MpiReceiver(ns3::MpiReceiver const & arg0) [copy constructor]
cls.add_constructor([param('ns3::MpiReceiver const &', 'arg0')])
## mpi-receiver.h (module 'mpi'): static ns3::TypeId ns3::MpiReceiver::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## mpi-receiver.h (module 'mpi'): void ns3::MpiReceiver::Receive(ns3::Ptr<ns3::Packet> p) [member function]
cls.add_method('Receive',
'void',
[param('ns3::Ptr< ns3::Packet >', 'p')])
## mpi-receiver.h (module 'mpi'): void ns3::MpiReceiver::SetReceiveCallback(ns3::Callback<void, ns3::Ptr<ns3::Packet>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> callback) [member function]
cls.add_method('SetReceiveCallback',
'void',
[param('ns3::Callback< void, ns3::Ptr< ns3::Packet >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')])
return
def register_Ns3NixVector_methods(root_module, cls):
cls.add_output_stream_operator()
## nix-vector.h (module 'network'): ns3::NixVector::NixVector() [constructor]

View File

@@ -66,8 +66,6 @@ def register_types(module):
module.add_class('Mac48Address', import_from_module='ns.network')
## mac48-address.h (module 'network'): ns3::Mac48Address [class]
root_module['ns3::Mac48Address'].implicitly_converts_to(root_module['ns3::Address'])
## mpi-net-device.h (module 'mpi'): ns3::MpiNetDevice [class]
module.add_class('MpiNetDevice', allow_subclassing=True, import_from_module='ns.mpi')
## net-device-container.h (module 'network'): ns3::NetDeviceContainer [class]
module.add_class('NetDeviceContainer', import_from_module='ns.network')
## node-container.h (module 'network'): ns3::NodeContainer [class]
@@ -221,7 +219,7 @@ def register_types(module):
## point-to-point-channel.h (module 'point-to-point'): ns3::PointToPointChannel [class]
module.add_class('PointToPointChannel', parent=root_module['ns3::Channel'])
## point-to-point-net-device.h (module 'point-to-point'): ns3::PointToPointNetDevice [class]
module.add_class('PointToPointNetDevice', parent=[root_module['ns3::NetDevice'], root_module['ns3::MpiNetDevice']])
module.add_class('PointToPointNetDevice', parent=root_module['ns3::NetDevice'])
## point-to-point-remote-channel.h (module 'point-to-point'): ns3::PointToPointRemoteChannel [class]
module.add_class('PointToPointRemoteChannel', parent=root_module['ns3::PointToPointChannel'])
## nstime.h (module 'core'): ns3::TimeChecker [class]
@@ -267,7 +265,6 @@ def register_methods(root_module):
register_Ns3Ipv6Address_methods(root_module, root_module['ns3::Ipv6Address'])
register_Ns3Ipv6Prefix_methods(root_module, root_module['ns3::Ipv6Prefix'])
register_Ns3Mac48Address_methods(root_module, root_module['ns3::Mac48Address'])
register_Ns3MpiNetDevice_methods(root_module, root_module['ns3::MpiNetDevice'])
register_Ns3NetDeviceContainer_methods(root_module, root_module['ns3::NetDeviceContainer'])
register_Ns3NodeContainer_methods(root_module, root_module['ns3::NodeContainer'])
register_Ns3ObjectBase_methods(root_module, root_module['ns3::ObjectBase'])
@@ -1471,22 +1468,6 @@ def register_Ns3Mac48Address_methods(root_module, cls):
is_static=True)
return
def register_Ns3MpiNetDevice_methods(root_module, cls):
## mpi-net-device.h (module 'mpi'): ns3::MpiNetDevice::MpiNetDevice() [constructor]
cls.add_constructor([])
## mpi-net-device.h (module 'mpi'): ns3::MpiNetDevice::MpiNetDevice(ns3::MpiNetDevice const & arg0) [copy constructor]
cls.add_constructor([param('ns3::MpiNetDevice const &', 'arg0')])
## mpi-net-device.h (module 'mpi'): void ns3::MpiNetDevice::MpiReceive(ns3::Ptr<ns3::Packet> p) [member function]
cls.add_method('MpiReceive',
'void',
[param('ns3::Ptr< ns3::Packet >', 'p')])
## mpi-net-device.h (module 'mpi'): void ns3::MpiNetDevice::DoMpiReceive(ns3::Ptr<ns3::Packet> p) [member function]
cls.add_method('DoMpiReceive',
'void',
[param('ns3::Ptr< ns3::Packet >', 'p')],
is_pure_virtual=True, visibility='protected', is_virtual=True)
return
def register_Ns3NetDeviceContainer_methods(root_module, cls):
## net-device-container.h (module 'network'): ns3::NetDeviceContainer::NetDeviceContainer(ns3::NetDeviceContainer const & arg0) [copy constructor]
cls.add_constructor([param('ns3::NetDeviceContainer const &', 'arg0')])
@@ -4284,7 +4265,7 @@ def register_Ns3PointToPointNetDevice_methods(root_module, cls):
cls.add_method('DoMpiReceive',
'void',
[param('ns3::Ptr< ns3::Packet >', 'p')],
visibility='protected', is_virtual=True)
visibility='protected')
## point-to-point-net-device.h (module 'point-to-point'): void ns3::PointToPointNetDevice::DoDispose() [member function]
cls.add_method('DoDispose',
'void',

View File

@@ -66,8 +66,6 @@ def register_types(module):
module.add_class('Mac48Address', import_from_module='ns.network')
## mac48-address.h (module 'network'): ns3::Mac48Address [class]
root_module['ns3::Mac48Address'].implicitly_converts_to(root_module['ns3::Address'])
## mpi-net-device.h (module 'mpi'): ns3::MpiNetDevice [class]
module.add_class('MpiNetDevice', allow_subclassing=True, import_from_module='ns.mpi')
## net-device-container.h (module 'network'): ns3::NetDeviceContainer [class]
module.add_class('NetDeviceContainer', import_from_module='ns.network')
## node-container.h (module 'network'): ns3::NodeContainer [class]
@@ -221,7 +219,7 @@ def register_types(module):
## point-to-point-channel.h (module 'point-to-point'): ns3::PointToPointChannel [class]
module.add_class('PointToPointChannel', parent=root_module['ns3::Channel'])
## point-to-point-net-device.h (module 'point-to-point'): ns3::PointToPointNetDevice [class]
module.add_class('PointToPointNetDevice', parent=[root_module['ns3::NetDevice'], root_module['ns3::MpiNetDevice']])
module.add_class('PointToPointNetDevice', parent=root_module['ns3::NetDevice'])
## point-to-point-remote-channel.h (module 'point-to-point'): ns3::PointToPointRemoteChannel [class]
module.add_class('PointToPointRemoteChannel', parent=root_module['ns3::PointToPointChannel'])
## nstime.h (module 'core'): ns3::TimeChecker [class]
@@ -267,7 +265,6 @@ def register_methods(root_module):
register_Ns3Ipv6Address_methods(root_module, root_module['ns3::Ipv6Address'])
register_Ns3Ipv6Prefix_methods(root_module, root_module['ns3::Ipv6Prefix'])
register_Ns3Mac48Address_methods(root_module, root_module['ns3::Mac48Address'])
register_Ns3MpiNetDevice_methods(root_module, root_module['ns3::MpiNetDevice'])
register_Ns3NetDeviceContainer_methods(root_module, root_module['ns3::NetDeviceContainer'])
register_Ns3NodeContainer_methods(root_module, root_module['ns3::NodeContainer'])
register_Ns3ObjectBase_methods(root_module, root_module['ns3::ObjectBase'])
@@ -1471,22 +1468,6 @@ def register_Ns3Mac48Address_methods(root_module, cls):
is_static=True)
return
def register_Ns3MpiNetDevice_methods(root_module, cls):
## mpi-net-device.h (module 'mpi'): ns3::MpiNetDevice::MpiNetDevice() [constructor]
cls.add_constructor([])
## mpi-net-device.h (module 'mpi'): ns3::MpiNetDevice::MpiNetDevice(ns3::MpiNetDevice const & arg0) [copy constructor]
cls.add_constructor([param('ns3::MpiNetDevice const &', 'arg0')])
## mpi-net-device.h (module 'mpi'): void ns3::MpiNetDevice::MpiReceive(ns3::Ptr<ns3::Packet> p) [member function]
cls.add_method('MpiReceive',
'void',
[param('ns3::Ptr< ns3::Packet >', 'p')])
## mpi-net-device.h (module 'mpi'): void ns3::MpiNetDevice::DoMpiReceive(ns3::Ptr<ns3::Packet> p) [member function]
cls.add_method('DoMpiReceive',
'void',
[param('ns3::Ptr< ns3::Packet >', 'p')],
is_pure_virtual=True, visibility='protected', is_virtual=True)
return
def register_Ns3NetDeviceContainer_methods(root_module, cls):
## net-device-container.h (module 'network'): ns3::NetDeviceContainer::NetDeviceContainer(ns3::NetDeviceContainer const & arg0) [copy constructor]
cls.add_constructor([param('ns3::NetDeviceContainer const &', 'arg0')])
@@ -4284,7 +4265,7 @@ def register_Ns3PointToPointNetDevice_methods(root_module, cls):
cls.add_method('DoMpiReceive',
'void',
[param('ns3::Ptr< ns3::Packet >', 'p')],
visibility='protected', is_virtual=True)
visibility='protected')
## point-to-point-net-device.h (module 'point-to-point'): void ns3::PointToPointNetDevice::DoDispose() [member function]
cls.add_method('DoDispose',
'void',

32
test.py
View File

@@ -676,12 +676,15 @@ def make_paths():
#
VALGRIND_SUPPRESSIONS_FILE = "testpy.supp"
def run_job_synchronously(shell_command, directory, valgrind, is_python):
def run_job_synchronously(shell_command, directory, valgrind, is_python, build_path=""):
(base, build) = os.path.split (NS3_BUILDDIR)
suppressions_path = os.path.join (base, VALGRIND_SUPPRESSIONS_FILE)
if is_python:
path_cmd = "python " + os.path.join (base, shell_command)
else:
if len(build_path):
path_cmd = os.path.join (build_path, shell_command)
else:
path_cmd = os.path.join (NS3_BUILDDIR, NS3_ACTIVE_VARIANT, shell_command)
@@ -737,6 +740,7 @@ class Job:
self.tmp_file_name = ""
self.returncode = False
self.elapsed_time = 0
self.build_path = ""
#
# A job is either a standard job or a special job indicating that a worker
@@ -779,6 +783,14 @@ class Job:
def set_shell_command(self, shell_command):
self.shell_command = shell_command
#
# This is the build path where ns-3 was built. For example,
#
# "/home/craigdo/repos/ns-3-allinone-test/ns-3-dev/build/debug"
#
def set_build_path(self, build_path):
self.build_path = build_path
#
# This is the dispaly name of the job, typically the test suite or example
# name. For example,
@@ -892,7 +904,7 @@ class worker_thread(threading.Thread):
# "examples/mixed-wireless.py"
#
(job.returncode, standard_out, standard_err, et) = run_job_synchronously(job.shell_command,
job.cwd, options.valgrind, job.is_pyexample)
job.cwd, options.valgrind, job.is_pyexample, job.build_path)
else:
#
# If we're a test suite, we need to provide a little more info
@@ -1269,6 +1281,7 @@ def run_tests():
job.set_basedir(os.getcwd())
job.set_tempdir(testpy_output_dir)
job.set_shell_command(test)
job.set_build_path("")
if options.valgrind and not eval(do_valgrind_run):
job.set_is_skip (True)
@@ -1293,7 +1306,8 @@ def run_tests():
job.set_cwd(testpy_output_dir)
job.set_basedir(os.getcwd())
job.set_tempdir(testpy_output_dir)
job.set_shell_command("examples/%s" % options.example)
job.set_shell_command(options.example)
job.set_build_path(options.buildpath)
if options.verbose:
print "Queue %s" % options.example
@@ -1336,6 +1350,7 @@ def run_tests():
job.set_basedir(os.getcwd())
job.set_tempdir(testpy_output_dir)
job.set_shell_command(test)
job.set_build_path("")
#
# Python programs and valgrind do not work and play
@@ -1374,7 +1389,8 @@ def run_tests():
job.set_cwd(testpy_output_dir)
job.set_basedir(os.getcwd())
job.set_tempdir(testpy_output_dir)
job.set_shell_command("examples/%s" % options.pyexample)
job.set_shell_command(options.pyexample)
job.set_build_path("")
if options.verbose:
print "Queue %s" % options.pyexample
@@ -1595,13 +1611,17 @@ def run_tests():
def main(argv):
parser = optparse.OptionParser()
parser.add_option("-b", "--buildpath", action="store", type="string", dest="buildpath", default="",
metavar="BUILDPATH",
help="specify the path where ns-3 was built (defaults to the build directory for the current variant)")
parser.add_option("-c", "--constrain", action="store", type="string", dest="constrain", default="",
metavar="KIND",
help="constrain the test-runner by kind of test")
parser.add_option("-e", "--example", action="store", type="string", dest="example", default="",
metavar="EXAMPLE",
help="specify a single example to run")
help="specify a single example to run (with relative path)")
parser.add_option("-g", "--grind", action="store_true", dest="valgrind", default=False,
help="run the test suites and examples using valgrind")
@@ -1620,7 +1640,7 @@ def main(argv):
parser.add_option("-p", "--pyexample", action="store", type="string", dest="pyexample", default="",
metavar="PYEXAMPLE",
help="specify a single python example to run")
help="specify a single python example to run (with relative path)")
parser.add_option("-r", "--retain", action="store_true", dest="retain", default=False,
help="retain all temporary files (which are normally deleted)")