Bug 124 - it would be nice if waf check could also run the tests under valgrind
it would be nice if waf check could also run the tests under valgrind
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: build system
pre-release
All All
: P3 normal
Assigned To: ns-bugs
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-01-03 02:33 UTC by Mathieu Lacage
Modified: 2008-07-01 13:32 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 Mathieu Lacage 2008-01-03 02:33:51 UTC
or maybe you could define a new target waf valgrindcheck
Comment 1 Gustavo J. A. M. Carneiro 2008-01-03 07:02:42 UTC
There is a not too complicated way to run unit tests under valgrind, kind of documented in [1].  Basically:

waf --run run-tests --command-template "valgrind %s"

Unfortunately waf does not allow wscripts to add new targets, only new options, like --valgrind.  So our full range of options is:

1. Do nothing, document the 'waf --run run-tests --command-template "valgrind %s"' option;

2. Add a waf --valgrindcheck option, which runs the unit tests under valgrind immediately;

3. Add a waf "configure --enable-valgrind" configure option which turns on valgrind for when 'waf check' is run in the future;

4. Automatically detect the presence of valgrind during waf configure and use it for waf check if it was found, unconditionally.

Personally I think 1 is just fine... :-)

[1] http://www.nsnam.org/wiki/index.php/User_FAQ#How_to_run_NS-3_programs_under_another_tool
Comment 2 Mathieu Lacage 2008-01-03 07:08:51 UTC
I would opt for 2.
Comment 3 Gustavo J. A. M. Carneiro 2008-01-03 09:15:02 UTC
Added --valgrind option (waf check --valgrind, or waf --run something --valgrind).