mirror of https://github.com/ARMmbed/mbed-os.git
Docstrings. Empty executable search path handling.
parent
61dee45dca
commit
8b74c5b3c7
|
@ -214,11 +214,10 @@ if __name__ == '__main__':
|
||||||
if options.cppcheck_validation:
|
if options.cppcheck_validation:
|
||||||
for toolchain in toolchains:
|
for toolchain in toolchains:
|
||||||
if not TOOLCHAIN_CLASSES[toolchain].check_executable():
|
if not TOOLCHAIN_CLASSES[toolchain].check_executable():
|
||||||
if TOOLCHAIN_PATHS[toolchain] == '':
|
search_path = TOOLCHAIN_PATHS[toolchain] or "No path set"
|
||||||
TOOLCHAIN_PATHS[toolchain] = "No path set"
|
|
||||||
args_error(parser, "Could not find executable for %s.\n"
|
args_error(parser, "Could not find executable for %s.\n"
|
||||||
"Currently set search path: %s"
|
"Currently set search path: %s"
|
||||||
% (toolchain, TOOLCHAIN_PATHS[toolchain]))
|
% (toolchain, search_path))
|
||||||
for target in targets:
|
for target in targets:
|
||||||
try:
|
try:
|
||||||
mcu = TARGET_MAP[target]
|
mcu = TARGET_MAP[target]
|
||||||
|
|
|
@ -233,11 +233,10 @@ if __name__ == '__main__':
|
||||||
notify = None
|
notify = None
|
||||||
|
|
||||||
if not TOOLCHAIN_CLASSES[toolchain].check_executable():
|
if not TOOLCHAIN_CLASSES[toolchain].check_executable():
|
||||||
if TOOLCHAIN_PATHS[toolchain] == '':
|
search_path = TOOLCHAIN_PATHS[toolchain] or "No path set"
|
||||||
TOOLCHAIN_PATHS[toolchain] = "No path set"
|
|
||||||
args_error(parser, "Could not find executable for %s.\n"
|
args_error(parser, "Could not find executable for %s.\n"
|
||||||
"Currently set search path: %s"
|
"Currently set search path: %s"
|
||||||
%(toolchain,TOOLCHAIN_PATHS[toolchain]))
|
%(toolchain,search_path))
|
||||||
|
|
||||||
# Test
|
# Test
|
||||||
for test_no in p:
|
for test_no in p:
|
||||||
|
|
|
@ -116,11 +116,10 @@ if __name__ == '__main__':
|
||||||
toolchain = options.tool[0]
|
toolchain = options.tool[0]
|
||||||
|
|
||||||
if not TOOLCHAIN_CLASSES[toolchain].check_executable():
|
if not TOOLCHAIN_CLASSES[toolchain].check_executable():
|
||||||
if TOOLCHAIN_PATHS[toolchain] == '':
|
search_path = TOOLCHAIN_PATHS[toolchain] or "No path set"
|
||||||
TOOLCHAIN_PATHS[toolchain] = "No path set"
|
|
||||||
args_error(parser, "Could not find executable for %s.\n"
|
args_error(parser, "Could not find executable for %s.\n"
|
||||||
"Currently set search path: %s"
|
"Currently set search path: %s"
|
||||||
% (toolchain, TOOLCHAIN_PATHS[toolchain]))
|
% (toolchain, search_path))
|
||||||
|
|
||||||
# Find all tests in the relevant paths
|
# Find all tests in the relevant paths
|
||||||
for path in all_paths:
|
for path in all_paths:
|
||||||
|
|
|
@ -44,6 +44,9 @@ class ARM(mbedToolchain):
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def check_executable():
|
def check_executable():
|
||||||
|
"""Returns True if the executable (armcc) location specified by the
|
||||||
|
user exists OR the executable can be found on the PATH.
|
||||||
|
Returns False otherwise."""
|
||||||
if not TOOLCHAIN_PATHS["ARM"] or not exists(TOOLCHAIN_PATHS['ARM']):
|
if not TOOLCHAIN_PATHS["ARM"] or not exists(TOOLCHAIN_PATHS['ARM']):
|
||||||
exe = find_executable('armcc')
|
exe = find_executable('armcc')
|
||||||
if not exe:
|
if not exe:
|
||||||
|
|
|
@ -272,6 +272,9 @@ class GCC(mbedToolchain):
|
||||||
class GCC_ARM(GCC):
|
class GCC_ARM(GCC):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def check_executable():
|
def check_executable():
|
||||||
|
"""Returns True if the executable (arm-none-eabi-gcc) location
|
||||||
|
specified by the user exists OR the executable can be found on the PATH.
|
||||||
|
Returns False otherwise."""
|
||||||
if not TOOLCHAIN_PATHS["GCC_ARM"] or not exists(TOOLCHAIN_PATHS['GCC_ARM']):
|
if not TOOLCHAIN_PATHS["GCC_ARM"] or not exists(TOOLCHAIN_PATHS['GCC_ARM']):
|
||||||
exe = find_executable('arm-none-eabi-gcc')
|
exe = find_executable('arm-none-eabi-gcc')
|
||||||
if not exe:
|
if not exe:
|
||||||
|
@ -306,6 +309,9 @@ class GCC_ARM(GCC):
|
||||||
class GCC_CR(GCC):
|
class GCC_CR(GCC):
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def check_executable():
|
def check_executable():
|
||||||
|
"""Returns True if the executable (arm-none-eabi-gcc) location
|
||||||
|
specified by the user exists OR the executable can be found on the PATH.
|
||||||
|
Returns False otherwise."""
|
||||||
if not TOOLCHAIN_PATHS["GCC_CR"] or not exists(TOOLCHAIN_PATHS['GCC_CR']):
|
if not TOOLCHAIN_PATHS["GCC_CR"] or not exists(TOOLCHAIN_PATHS['GCC_CR']):
|
||||||
exe = find_executable('arm-none-eabi-gcc')
|
exe = find_executable('arm-none-eabi-gcc')
|
||||||
if not exe:
|
if not exe:
|
||||||
|
|
|
@ -47,6 +47,9 @@ class IAR(mbedToolchain):
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def check_executable():
|
def check_executable():
|
||||||
|
"""Returns True if the executable (arm-none-eabi-gcc) location
|
||||||
|
specified by the user exists OR the executable can be found on the PATH.
|
||||||
|
Returns False otherwise."""
|
||||||
if not TOOLCHAIN_PATHS["IAR"] or not exists(TOOLCHAIN_PATHS['IAR']):
|
if not TOOLCHAIN_PATHS["IAR"] or not exists(TOOLCHAIN_PATHS['IAR']):
|
||||||
exe = find_executable('iccarm')
|
exe = find_executable('iccarm')
|
||||||
if not exe:
|
if not exe:
|
||||||
|
|
Loading…
Reference in New Issue