Bug 1360 - can't pass command line arguments to examples run from test suite
can't pass command line arguments to examples run from test suite
Status: RESOLVED DUPLICATE of bug 1415
Product: ns-3
Classification: Unclassified
Component: test framework
pre-release
All All
: P5 normal
Assigned To: Mitch Watrous
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-02-09 00:23 UTC by Tom Henderson
Modified: 2012-04-25 22:25 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tom Henderson 2012-02-09 00:23:16 UTC
from test.py

# 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 = [
    ("udp-echo", "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).

There is no way to specify to run a program with command-line arguments.  For example, many of the IPv6-enabled examples that are coming for ns-3.14 require the --useIpv6 switch.  So, perhaps need to change to something like:

#     (example_name, arguments, do_run, do_valgrind_run).
#
# See test.py for more information.
cpp_examples = [
    ("udp-echo", "", "True", "True"),
]
Comment 1 Tommaso Pecorella 2012-02-10 18:14:05 UTC
Strange. The topology-read module examples-to-run.py is:
cpp_examples = [
    ("Inet_small_toposample.txt", "True", "True"),
    ("RocketFuel_toposample_1239_weights.txt", "True", "True"),
]

and as far as I know it works.

Those aren't program names, are the arguments !

Maybe we should clarify the documentation ?

T.
Comment 2 Mitch Watrous 2012-04-25 21:58:18 UTC

*** This bug has been marked as a duplicate of bug 1415 ***
Comment 3 Mitch Watrous 2012-04-25 22:25:49 UTC
The command line arguments can be included with the example program name like this:

    cpp_examples = [
        ("multirate --totalTime=0.3s --rateManager=ns3::AarfcdWifiManager", "True", "True"), 
        ("multirate --totalTime=0.3s --rateManager=ns3::AmrrWifiManager", "True", "True"), 
        ("multirate --totalTime=0.3s --rateManager=ns3::CaraWifiManager", "True", "True"), 
        ("multirate --totalTime=0.3s --rateManager=ns3::IdealWifiManager", "True", "True"), 
        ("multirate --totalTime=0.3s --rateManager=ns3::MinstrelWifiManager", "True", "True"), 
        ("multirate --totalTime=0.3s --rateManager=ns3::OnoeWifiManager", "True", "True"), 
        ("multirate --totalTime=0.3s --rateManager=ns3::RraaWifiManager", "True", "True"), 
    ]

These examples were found in

    examples/wireless/examples-to-run.py