Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake: greentea: Migrate the NFC EEPROM test to CTest #15095

Merged
merged 6 commits into from
Sep 28, 2021

Conversation

LDong-Arm
Copy link
Contributor

@LDong-Arm LDong-Arm commented Sep 20, 2021

Summary of changes

Fixes #15093

We are migrating greentea tests from standalone CMake projects that use Mbed OS to executables within the Mbed OS CMake project. This has the benefit of building all greentea tests globally and using CTest to automate running on local and CI boards. This PR covers the NFC EEPROM test (the only NFC greentea test).

For example,

mbed-tools configure -t GCC_ARM -m DISCO_L475VG_IOT01A --mbed-os-path . -o __build
cmake --build __build/ --target mbed-connectivity-nfc-eeprom -DMBED_HTRUN_ARGUMENTS='-p;<port>;-d;<mount>'
ctest --test-dir __build -V -R mbed-connectivity-nfc-eeprom

Impact of changes

Migration actions required

Documentation

None


Pull request type

[x] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Test results

[] No Tests required for this change (E.g docs only update)
[x] Covered by existing mbed-os tests (Greentea or Unittest)
[] Tests / results supplied as part of this PR

Reviewers


The most common extension for static libraries is .a and CMake generates
it with both GCC and Arm toolchains. Mbed CLI 1 generates .ar files with
the Arm Compiler, but since Mbed CLI 2 uses memap.py to generate map
files too, both extensions should be permitted.

This fixes a warning when building greentea tests:

    Malformed input found when parsing ARMCC map: _deps/greentea-client-build/libclient_userio.a(greentea_test_env.o)
    Malformed input found when parsing ARMCC map: _deps/greentea-client-build/libclient_userio.a(greentea_test_env.o)
    Malformed input found when parsing ARMCC map: _deps/greentea-client-build/libclient_userio.a(greentea_test_env.o)
    ...

which repeats over 30 times per test.
Subdirectories should always be included in the CMake "all" target when
building any tests, either unit tests or greentea tests.
When unit tests or unit test stubs get added as CMake targets, they
becomes part of the "all" target and get compiled when building the
whole project. When building greentea tests we need to disable unit
tests and stubs to avoid unnecessary compilation and errors.
Greentea tests run on microcontrollers, so any required drivers need
to be available and built.

Note: Even though unit tests do not require drivers, for ease of
maintenance there's no need to exclude those drivers when building unit
tests because a driver only gets enabled when the Mbed target matches.
@LDong-Arm LDong-Arm requested a review from a team September 20, 2021 16:18
@ciarmcom ciarmcom added the release-type: patch Indentifies a PR as containing just a patch label Sep 20, 2021
@ciarmcom ciarmcom requested a review from a team September 20, 2021 16:30
@ciarmcom
Copy link
Member

@LDong-Arm, thank you for your changes.
@ARMmbed/mbed-os-maintainers please review.

Copy link
Contributor

@rajkan01 rajkan01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mergify mergify bot added needs: CI and removed needs: review labels Sep 21, 2021
@LDong-Arm LDong-Arm requested a review from a team September 21, 2021 15:17
@ciarmcom
Copy link
Member

This pull request has automatically been marked as stale because it has had no recent activity. @ARMmbed/mbed-os-maintainers, please start CI to get the PR merged.

@ciarmcom ciarmcom added stale Stale Pull Request and removed stale Stale Pull Request labels Sep 22, 2021
@0xc0170 0xc0170 removed the stale Stale Pull Request label Sep 28, 2021
@0xc0170
Copy link
Contributor

0xc0170 commented Sep 28, 2021

CI started

@mbed-ci
Copy link

mbed-ci commented Sep 28, 2021

Jenkins CI Test : ✔️ SUCCESS

Build Number: 1 | 🔒 Jenkins CI Job | 🌐 Logs & Artifacts

CLICK for Detailed Summary

jobs Status
jenkins-ci/mbed-os-ci_cmake-cloud-example-ARM ✔️
jenkins-ci/mbed-os-ci_unittests ✔️
jenkins-ci/mbed-os-ci_cmake-cloud-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_build-cloud-example-ARM ✔️
jenkins-ci/mbed-os-ci_build-cloud-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_build-greentea-ARM ✔️
jenkins-ci/mbed-os-ci_cmake-example-ARM ✔️
jenkins-ci/mbed-os-ci_build-greentea-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_cmake-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_build-example-ARM ✔️
jenkins-ci/mbed-os-ci_build-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_greentea-test ✔️

@0xc0170 0xc0170 merged commit ff6d401 into ARMmbed:master Sep 28, 2021
@mergify mergify bot removed the ready for merge label Sep 28, 2021
@mbedmain mbedmain added release-version: 6.15.1 Release-pending and removed release-type: patch Indentifies a PR as containing just a patch Release-pending labels Nov 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add CTest support for greentea tests: connectivity/nfc
7 participants