Skip to content

Commit 9ca55c8

Browse files
committed
Move 'mbed compile --tests' to 'mbed test --compile' early in compile() and add missing '-c' clean flag
1 parent a40aef8 commit 9ca55c8

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

mbed/mbed.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1867,6 +1867,10 @@ def status_(ignore=False):
18671867
help='Compile code using the mbed build tools',
18681868
description=("Compile this program using the mbed build tools."))
18691869
def compile(toolchain=None, mcu=None, source=False, build=False, compile_library=False, compile_config=False, config_prefix=None, compile_tests=False, clean=False, supported=False):
1870+
# Pipe --tests to mbed tests command
1871+
if compile_tests:
1872+
return test_(toolchain=toolchain, mcu=mcu, source=source, build=build, clean=clean, compile_only=True)
1873+
18701874
# Gather remaining arguments
18711875
args = remainder
18721876
# Find the root of the program
@@ -1893,9 +1897,6 @@ def compile(toolchain=None, mcu=None, source=False, build=False, compile_library
18931897
tchain = program.get_toolchain(toolchain)
18941898
macros = program.get_macros()
18951899

1896-
if compile_tests:
1897-
return test_(toolchain=toolchain, mcu=mcu, source=source, build=build, compile_only=True)
1898-
18991900
if compile_config:
19001901
# Compile configuration
19011902
popen(['python', os.path.join(tools_dir, 'get_config.py')]

0 commit comments

Comments
 (0)