Skip to content

Conversation

@LDong-Arm
Copy link
Contributor

@LDong-Arm LDong-Arm commented Jun 22, 2021

Description

Add an option --app-config to configure and compile, to allow users to specify an application configuration file. If unspecified, mbed-tools will use mbed_app.json if the latter exists.

Tests are provided.

Fixes #291

Also: Remove default arguments of build() that duplicate what we set with click.

Test Coverage

  • This change is covered by existing or additional automated tests.
  • Manual testing has been performed (and evidence provided) as automated testing was not feasible.
  • Additional tests are not required for this change (e.g. documentation update).

@codecov
Copy link

codecov bot commented Jun 22, 2021

Codecov Report

Merging #292 (c5eaa49) into master (f55d2eb) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #292   +/-   ##
=======================================
  Coverage   97.08%   97.08%           
=======================================
  Files          92       92           
  Lines        2779     2781    +2     
=======================================
+ Hits         2698     2700    +2     
  Misses         81       81           
Impacted Files Coverage Δ
src/mbed_tools/cli/build.py 100.00% <100.00%> (ø)
src/mbed_tools/cli/configure.py 100.00% <100.00%> (ø)

@LDong-Arm
Copy link
Contributor Author

LDong-Arm commented Jun 24, 2021

The Travis failure has nothing to do with this PR or mbed-tools. I've created a fix for it: ARMmbed/mbed-os#14829

Update: See ARMmbed/mbed-os#14829 (comment). The proper fix would be migrating K64F from ARDUINO form factor to ARDUINO_UNO form factor. The main issue to track Pin Names migration of all targets is ARMmbed/mbed-os#14484.

Alternatively, we can use a different target in Travis for the time being.

@LDong-Arm LDong-Arm requested a review from Patater June 25, 2021 09:55
@Patater Patater self-assigned this Jun 25, 2021
This commit removes the default arguments of the `build()` function
to rely on click to provide default values. As for `--toolchain`
and `--mbed-targets` which must be provided by the user, we enable
`required=True` to let click check them for us. This is consistent
with how arguments are checked for the `configure()` function.

Despite the main benefit of taking advantage of click's built-in
check, a slight drawback is that click only checks one argument at a
time, instead of asking the user to specify both toolchain and
mbed-target. But this is okay because the user needs to pass both in
order to not get any errors eventually.

The test case where both target and toolchain options are missing
has been removed accordingly. The existing tests for one missing
option (one for toolchain, one for target) are sufficient.
Add an option `--app-config` to `configure` and `compile`, to allow
users to specify an application configuration file. If unspecified,
mbed-tools will use `mbed_app.json` if the latter exists.

Tests are provided.

Fixes ARMmbed#291
@LDong-Arm
Copy link
Contributor Author

Rebased and updated commit message

@Patater Patater merged commit 9a0d686 into ARMmbed:master Jun 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing --app-config option

2 participants