Added new flag -L to list all tests available. Also removed trailing spaces

pull/237/head
Przemek Wirkus 2014-03-27 11:17:53 +00:00
parent 3d49a491d4
commit 493ad639e2
1 changed files with 27 additions and 20 deletions

View File

@ -75,6 +75,8 @@ if __name__ == '__main__':
default=None, help="The mbed serial port")
parser.add_option("-b", "--baud", type="int", dest="baud",
default=None, help="The mbed serial baud rate")
parser.add_option("-L", "--list-tests", action="store_true", dest="list_tests",
default=False, help="List available tests in order and exit")
# Ideally, all the tests with a single "main" thread can be run with, or
# without the rtos
@ -87,6 +89,11 @@ if __name__ == '__main__':
(options, args) = parser.parse_args()
# Print available tests in order and exit
if options.list_tests is True:
print '\n'.join(map(str, sorted(TEST_MAP.values())))
sys.exit()
# force program to "0" if a source dir is specified
if options.source_dir is not None:
p = 0