791 sets the shared library paths, then invokes the executable |
791 sets the shared library paths, then invokes the executable |
792 using the provided command line template, |
792 using the provided command line template, |
793 inserting the program name for the ``%s`` placeholder. |
793 inserting the program name for the ``%s`` placeholder. |
794 (I admit this is a bit awkward, but that's the way it is. Patches welcome!) |
794 (I admit this is a bit awkward, but that's the way it is. Patches welcome!) |
795 |
795 |
796 Another particularly useful example is to run the ``mytest`` test suite |
796 Another particularly useful example is to run a test suite by itself. |
797 by itself. Above, we used the ``./test.py`` script to run a whole slew of |
797 Let's assume that a ``mytest`` test suite exists (it doesn't). |
|
798 Above, we used the ``./test.py`` script to run a whole slew of |
798 tests in parallel, by repeatedly invoking the real testing program, |
799 tests in parallel, by repeatedly invoking the real testing program, |
799 ``test-runner``. To invoke ``test-runner`` directly for a single test:: |
800 ``test-runner``. To invoke ``test-runner`` directly for a single test:: |
800 |
801 |
801 $ ./waf --run test-runner --command-template="%s --suite=mytest --verbose" |
802 $ ./waf --run test-runner --command-template="%s --suite=mytest --verbose" |
802 |
803 |
803 This passes the arguments to the ``test-runner`` program. To print the |
804 This passes the arguments to the ``test-runner`` program. |
804 available ``test-runner`` options:: |
805 Since ``mytest`` does not exist, an error message will be generated. |
|
806 To print the available ``test-runner`` options:: |
805 |
807 |
806 $ ./waf --run test-runner --command-template="%s --help" |
808 $ ./waf --run test-runner --command-template="%s --help" |
807 |
809 |
808 Debugging |
810 Debugging |
809 +++++++++ |
811 +++++++++ |
810 |
812 |
811 To run |ns3| programs under the control of another utility, such as |
813 To run |ns3| programs under the control of another utility, such as |
812 a debugger (*e.g.* ``gdb``) or memory checker (*e.g.* ``valgrind``), |
814 a debugger (*e.g.* ``gdb``) or memory checker (*e.g.* ``valgrind``), |
813 you use a similar ``--command-template="..."`` form. |
815 you use a similar ``--command-template="..."`` form. |
814 |
816 |
815 For example, to run your |ns3| program ``mysim`` with the arguments |
817 For example, to run your |ns3| program ``hello-simulator`` with the arguments |
816 ``<args>`` under the ``gdb`` debugger:: |
818 ``<args>`` under the ``gdb`` debugger:: |
817 |
819 |
818 $ ./waf --run=hello-simulator --command-template="gdb %s --args <args>" |
820 $ ./waf --run=hello-simulator --command-template="gdb %s --args <args>" |
819 |
821 |
820 Notice that the |ns3| program name goes with the ``--run`` argument, |
822 Notice that the |ns3| program name goes with the ``--run`` argument, |