Modified make.py so now parameter -n can handle comma separated lists of test names.

pull/753/head
Przemek Wirkus 2014-12-01 15:07:17 +00:00
parent e21bcaf790
commit 2120e52a81
1 changed files with 78 additions and 85 deletions

View File

@ -155,21 +155,19 @@ if __name__ == '__main__':
if n is not None and p is not None: if n is not None and p is not None:
args_error(parser, "[ERROR] specify either '-n' or '-p', not both") args_error(parser, "[ERROR] specify either '-n' or '-p', not both")
if n: if n:
if not n in TEST_MAP.keys(): nlist = n.split(',')
# Check if there is an alias for this in private_settings.py for test_id in nlist:
if getattr(ps, "test_alias", None) is not None: if test_id not in TEST_MAP.keys():
alias = ps.test_alias.get(n, "") args_error(parser, "[ERROR] Program with name '%s' not found"% test_id)
if not alias in TEST_MAP.keys():
args_error(parser, "[ERROR] Program with name '%s' not found" % n) p = [TEST_MAP[n].n for n in nlist]
else: elif p is not None:
n = alias plist = p.split(',')
else: if not plist or (plist < 0) or (plist > (len(TESTS)-1)):
args_error(parser, "[ERROR] Program with name '%s' not found" % n)
p = TEST_MAP[n].n
if p is None or (p < 0) or (p > (len(TESTS)-1)):
message = "[ERROR] You have to specify one of the following tests:\n" message = "[ERROR] You have to specify one of the following tests:\n"
message += '\n'.join(map(str, sorted(TEST_MAP.values()))) message += '\n'.join(map(str, sorted(TEST_MAP.values())))
args_error(parser, message) args_error(parser, message)
p = plist
# Target # Target
if options.mcu is None : if options.mcu is None :
@ -182,19 +180,14 @@ if __name__ == '__main__':
toolchain = options.tool toolchain = options.tool
# Test # Test
test = Test(p) for test_no in p:
if options.automated is not None: test = Test(test_no)
test.automated = options.automated if options.automated is not None: test.automated = options.automated
if options.dependencies is not None: if options.dependencies is not None: test.dependencies = options.dependencies
test.dependencies = options.dependencies if options.host_test is not None: test.host_test = options.host_test;
if options.host_test is not None: if options.peripherals is not None: test.peripherals = options.peripherals;
test.host_test = options.host_test; if options.duration is not None: test.duration = options.duration;
if options.peripherals is not None: if options.extra is not None: test.extra_files = options.extra
test.peripherals = options.peripherals;
if options.duration is not None:
test.duration = options.duration;
if options.extra is not None:
test.extra_files = options.extra
if not test.is_supported(mcu, toolchain): if not test.is_supported(mcu, toolchain):
print 'The selected test is not supported on target %s with toolchain %s' % (mcu, toolchain) print 'The selected test is not supported on target %s with toolchain %s' % (mcu, toolchain)