Bug 1475 - "test.py --list" should sort the output
"test.py --list" should sort the output
Status: RESOLVED FIXED
Product: ns-3
Classification: Unclassified
Component: test framework
ns-3-dev
All All
: P5 normal
Assigned To: Mitch Watrous
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-07-23 18:07 UTC by Peter Barnes
Modified: 2012-07-23 20:49 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 Peter Barnes 2012-07-23 18:07:58 UTC
$ ./test.py --list 
[waf build check omitted]

csma-system
global-routing
static-routing
error-model
mobility
ns3-wifi-interference
...

Output should be sorted:
$ ./test.py --list 
[waf build check omitted]

SequenceNumber
angles
animation-interface
attributes
average
basic-data-calculators
basic-energy-model
...

Here's a patch:
diff -r c1b33a377c2b test.py
--- a/test.py   Thu Jul 12 13:17:22 2012 -0700
+++ b/test.py   Mon Jul 23 15:05:11 2012 -0700
@@ -1113,7 +1113,8 @@
     if options.list:
         path_cmd = os.path.join("utils", test_runner_name + " --print-test-name-list")
         (rc, standard_out, standard_err, et) = run_job_synchronously(path_cmd, os.getcwd(), False, False)
-        print standard_out
+        list_items = standard_out.split('\n')
+        print "\n".join(sorted(list_items))
 
     if options.kinds or options.list:
         return
Comment 1 Mitch Watrous 2012-07-23 20:49:14 UTC
Thanks for the patch.

Bug closed.

ns-3-dev changeset:  d5c54a93c3f7