Fixed bug in --config and --auto switches

pull/900/head
Przemek Wirkus 2015-02-10 21:50:56 +00:00
parent 8910d95ae6
commit 2882c4e961
1 changed files with 11 additions and 4 deletions

View File

@ -138,19 +138,26 @@ if __name__ == '__main__':
MUTs = None
if opts.auto_detect:
print "Detecting connected mbed-enabled devices.."
print "MBEDLS: Detecting connected mbed-enabled devices... "
if get_module_avail('mbed_lstools'):
mbeds = mbed_lstools.create()
muts_list = mbeds.list_mbeds()
for mut in muts_list:
print "MBEDLS: Detected %s, port: %s, mounted: %s"% (mut['platform_name'],
mut['serial_port'],
mut['mount_point'])
# Set up parameters for test specification filter function (we need to set toolchains per target here)
use_default_toolchain = 'default' in opts.toolchains_filter.split(',') if opts.toolchains_filter is not None else True
use_supported_toolchains = 'all' in opts.toolchains_filter.split(',') if opts.toolchains_filter is not None else True
use_supported_toolchains = 'all' in opts.toolchains_filter.split(',') if opts.toolchains_filter is not None else False
toolchain_filter = opts.toolchains_filter
# Test specification with information about each target and associated toolchain
test_spec = get_autodetected_TEST_SPEC(muts_list,
use_default_toolchain=use_default_toolchain,
use_supported_toolchains=use_supported_toolchains,
toolchain_filter=toolchain_filter)
# MUTs configuration auto-detection
MUTs = get_autodetected_MUTS(muts_list)
else:
# Open file with test specification
@ -171,11 +178,11 @@ if __name__ == '__main__':
exit(-1)
if opts.verbose_test_configuration_only:
print "MUTs configuration in %s:"% opts.muts_spec_filename
print "MUTs configuration in %s:"% ('auto-detected' if opts.auto_detect else opts.muts_spec_filename)
if MUTs:
print print_muts_configuration_from_json(MUTs, platform_filter=opts.general_filter_regex)
print
print "Test specification in %s:"% opts.test_spec_filename
print "Test specification in %s:"% ('auto-detected' if opts.auto_detect else opts.test_spec_filename)
if test_spec:
print print_test_configuration_from_json(test_spec)
exit(0)