|
Bugzilla – Full Text Bug Listing |
| Summary: | NS_LOG environment variable not working with test.py | ||
|---|---|---|---|
| Product: | ns-3 | Reporter: | Nicola Baldo <nicola> |
| Component: | test framework | Assignee: | Mitch Watrous <watrous> |
| Status: | RESOLVED FIXED | ||
| Severity: | enhancement | CC: | jpelkey, ns-bugs, tomh, watrous |
| Priority: | P3 | ||
| Version: | ns-3-dev | ||
| Hardware: | All | ||
| OS: | All | ||
| Attachments: | document how to debug tests by enabling logging | ||
|
Description
Nicola Baldo
2011-05-02 07:25:01 UTC
Here is what test.py says and does:
# If lots of logging is enabled, we can crash Python when it tries to
# save all of the text. We just don't allow logging to be turned on when
# test.py runs. If you want to see logging output from your tests, you
# have to run them using the test-runner directly.
#
os.environ["NS_LOG"] = ""
Try running the test using the test-runner like this:
./waf --run "test-runner --basedir=`pwd` --suite=my-test-suite"
and see if logging works .
If you want to see what happened when your test ran, send the output to an XML file like this:
./waf --run "test-runner --basedir=`pwd` --suite=my-test-suite --out=my-test-suite-result.xml"
Does this let you do the logging you need?
(In reply to comment #1) > Here is what test.py says and does: > > # If lots of logging is enabled, we can crash Python when it tries to > # save all of the text. We just don't allow logging to be turned on when > # test.py runs. If you want to see logging output from your tests, you > # have to run them using the test-runner directly. > # > os.environ["NS_LOG"] = "" > > Try running the test using the test-runner like this: > > ./waf --run "test-runner --basedir=`pwd` --suite=my-test-suite" > > and see if logging works . > > If you want to see what happened when your test ran, send the output to an XML > file like this: > > ./waf --run "test-runner --basedir=`pwd` --suite=my-test-suite > --out=my-test-suite-result.xml" > > Does this let you do the logging you need? This is exactly right. We used to have logging possible during tests, but it led to other bugs. See https://www.nsnam.org/bugzilla/0 I understand, but this behavior is not documented at all. My experience is that for people that are writing a test for the first time it is a pain to find out how to debug it. Hence I think we should document this feature. Created attachment 1186 [details]
document how to debug tests by enabling logging
here is a proposed patch to the documentation that adds some minimum of information regarding this issue.
Patch applied. Thanks. Bug closed. ns-3-dev changeset: 99762b541ef9 |