How to get detailed test cases run results and use Log to print runtime messages such as NS_TEST_ASSERT_MSG_EQ

75 views
Skip to first unread message

John Young

unread,
Oct 19, 2016, 9:30:58 AM10/19/16
to ns-3-users
I found a test case that I added failed. However, I do not know why. How can I get more details about it? There are NS_TEST_ASSERT_MSG_EQ statements. Though I enable Log component in the DoRun() function, the message does not appear as I expected.

pdbarnes

unread,
Oct 19, 2016, 11:00:46 AM10/19/16
to ns-3-users
If you use the test.py script the output of failed tests will be saved in a subdirectory of testpy-output. For a single failing test I usually find it easier to run the test engine directly:

$ ./waf --run "test-runner --suite=..."

All this is explained in the Testing chapter in the manual:
https://www.nsnam.org/docs/manual/html/test-framework.html

Peter

Tom Henderson

unread,
Oct 19, 2016, 11:13:54 AM10/19/16
to ns-3-...@googlegroups.com
Logging is disabled when running test suites through the test.py program.

To enable logging, use the 'test-runner' program directly. You can
specify which suite to run using the '--suite' argument. Example:

NS_LOG="WifiNetDevice" ./waf --run 'test-runner --suite=devices-wifi'

- Tom

John Young

unread,
Oct 20, 2016, 2:27:58 AM10/20/16
to ns-3-users
Ok, thanks.

在 2016年10月19日星期三 UTC+8下午11:00:46,pdbarnes写道:

John Young

unread,
Oct 20, 2016, 2:28:17 AM10/20/16
to ns-3-users
Thanks.

在 2016年10月19日星期三 UTC+8下午11:13:54,Tom Henderson写道:
Reply all
Reply to author
Forward
0 new messages