本文整理汇总了Python中workspace_tools.tests.TEST_MAP.keys方法的典型用法代码示例。如果您正苦于以下问题:Python TEST_MAP.keys方法的具体用法?Python TEST_MAP.keys怎么用?Python TEST_MAP.keys使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类workspace_tools.tests.TEST_MAP
的用法示例。
在下文中一共展示了TEST_MAP.keys方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: set
# 需要导入模块: from workspace_tools.tests import TEST_MAP [as 别名]
# 或者: from workspace_tools.tests.TEST_MAP import keys [as 别名]
build_report = {}
build_properties = {}
platforms = None
if options.platforms != "":
platforms = set(options.platforms.split(","))
if options.build_tests:
# Get all paths
directories = options.build_tests.split(',')
for i in range(len(directories)):
directories[i] = normpath(join(TEST_DIR, directories[i]))
test_names = []
for test_id in TEST_MAP.keys():
# Prevents tests with multiple source dirs from being checked
if isinstance( TEST_MAP[test_id].source_dir, basestring):
test_path = normpath(TEST_MAP[test_id].source_dir)
for directory in directories:
if directory in test_path:
test_names.append(test_id)
mut_counter = 1
mut = {}
test_spec = {
"targets": {}
}
for target_name, toolchain_list in OFFICIAL_MBED_LIBRARY_BUILD:
toolchains = None
示例2: sorted
# 需要导入模块: from workspace_tools.tests import TEST_MAP [as 别名]
# 或者: from workspace_tools.tests.TEST_MAP import keys [as 别名]
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
n = None
else:
# Program Number or name
p, n = options.program, options.program_name
if n is not None and p is not None:
args_error(parser, "[ERROR] specify either '-n' or '-p', not both")
if n:
if not n in TEST_MAP.keys():
# Check if there is an alias for this in private_settings.py
if getattr(ps, "test_alias", None) is not None:
alias = ps.test_alias.get(n, "")
if not alias in TEST_MAP.keys():
args_error(parser, "[ERROR] Program with name '%s' not found" % n)
else:
n = alias
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 += '\n'.join(map(str, sorted(TEST_MAP.values())))
args_error(parser, message)
# Target
if options.mcu is None :
示例3: args_error
# 需要导入模块: from workspace_tools.tests import TEST_MAP [as 别名]
# 或者: from workspace_tools.tests.TEST_MAP import keys [as 别名]
# without the rtos
parser.add_option("--rtos", action="store_true", dest="rtos",
default=False, help="Link to the rtos")
# Specify a different linker script
parser.add_option("-l", "--linker", dest="linker_script",
default=None, help="use the specified linker script")
(options, args) = parser.parse_args()
# Program Number or name
p, n = options.program, options.program_name
if n is not None and p is not None:
args_error(parser, "[ERROR] specify either '-n' or '-p', not both")
if n:
if not n in TEST_MAP.keys():
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 += '\n'.join(map(str, sorted(TEST_MAP.values())))
args_error(parser, message)
# Target
if options.mcu is None :
args_error(parser, "[ERROR] You should specify an MCU")
mcu = options.mcu
# Toolchain
if options.tool is None:
args_error(parser, "[ERROR] You should specify a TOOLCHAIN")
示例4: build_mbed_libs
# 需要导入模块: from workspace_tools.tests import TEST_MAP [as 别名]
# 或者: from workspace_tools.tests.TEST_MAP import keys [as 别名]
# Let's build our test
if target not in TARGET_MAP:
print 'Skipped tests for %s target. Target platform not found' % (target)
continue
T = TARGET_MAP[target]
build_mbed_libs_options = ["analyze"] if opts.goanna_for_mbed_sdk else None
build_mbed_libs_result = build_mbed_libs(T, toolchain, options=build_mbed_libs_options)
if not build_mbed_libs_result:
print 'Skipped tests for %s target. Toolchain %s is not yet supported for this target' % (T.name, toolchain)
continue
build_dir = join(BUILD_DIR, "test", target, toolchain)
# Enumerate through all tests
test_map_keys = TEST_MAP.keys()
if opts.shuffle_test_order:
random.shuffle(test_map_keys)
for test_id in test_map_keys:
test = TEST_MAP[test_id]
if opts.test_by_names and test_id not in opts.test_by_names.split(','):
continue
if test_ids and test_id not in test_ids:
continue
if opts.test_only_peripheral and not test.peripherals:
if opts.verbose_skipped_tests:
print "TargetTest::%s::NotPeripheralTestSkipped()" % (target)
continue
示例5: args_error
# 需要导入模块: from workspace_tools.tests import TEST_MAP [as 别名]
# 或者: from workspace_tools.tests.TEST_MAP import keys [as 别名]
# force program to "0" if a source dir is specified
if options.source_dir is not None:
p = 0
n = None
else:
# Program Number or name
p, n = options.program, options.program_name
if n is not None and p is not None:
args_error(parser, "[ERROR] specify either '-n' or '-p', not both")
if n:
# We will transform 'n' to list of 'p' (integers which are test numbers)
nlist = n.split(',')
for test_id in nlist:
if test_id not in TEST_MAP.keys():
args_error(parser, "[ERROR] Program with name '%s' not found"% test_id)
p = [TEST_MAP[n].n for n in nlist]
elif p is None or (p < 0) or (p > (len(TESTS)-1)):
message = "[ERROR] You have to specify one of the following tests:\n"
message += '\n'.join(map(str, sorted(TEST_MAP.values())))
args_error(parser, message)
# If 'p' was set via -n to list of numbers make this a single element integer list
if type(p) != type([]):
p = [p]
# Target
if options.mcu is None :
args_error(parser, "[ERROR] You should specify an MCU")