Skip to content

CMake: Refactor Greentea test CMakeLists.txt #14247

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

Merged
merged 2 commits into from
Feb 15, 2021

Conversation

rajkan01
Copy link
Contributor

@rajkan01 rajkan01 commented Feb 8, 2021

Summary of changes

  • Added the new CMake MBED_TEST_LINK_LIBRARIES command-line argument support to receive all dependent libraries for the particular greentea test suite

For example:

  • To select mbed-os library, use cmake with -DMBED_TEST_LINK_LIBRARIES=mbed-os
  • To select baremetal library, use cmake with -DMBED_TEST_LINK_LIBRARIES=mbed-baremetal
  • To select baremetal with external error logging library to the test with -D "MBED_TEST_LINK_LIBRARIES=mbed-baremetal ext-errorlogging"

Impact of changes

None.

Migration actions required

None.

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

@hugueskamba @0xc0170


@ciarmcom ciarmcom added the release-type: patch Indentifies a PR as containing just a patch label Feb 8, 2021
@ciarmcom ciarmcom requested review from 0xc0170, hugueskamba and a team February 8, 2021 17:30
@ciarmcom
Copy link
Member

ciarmcom commented Feb 8, 2021

@rajkan01, thank you for your changes.
@hugueskamba @0xc0170 @ARMmbed/mbed-os-tools @ARMmbed/mbed-os-core @ARMmbed/mbed-os-hal @ARMmbed/mbed-os-maintainers please review.

@rajkan01 rajkan01 force-pushed the refactor_greentea_cmakelist branch from 37b641d to 9530abe Compare February 8, 2021 20:10
0xc0170
0xc0170 previously requested changes Feb 9, 2021
@rajkan01 rajkan01 force-pushed the refactor_greentea_cmakelist branch from 9530abe to 7374f5f Compare February 9, 2021 10:47
@mergify mergify bot dismissed 0xc0170’s stale review February 9, 2021 10:47

Pull request has been modified.

@rajkan01 rajkan01 requested a review from 0xc0170 February 9, 2021 10:50
@rajkan01 rajkan01 force-pushed the refactor_greentea_cmakelist branch 2 times, most recently from 3c2da58 to 6467cff Compare February 9, 2021 11:46
@rajkan01 rajkan01 requested a review from 0xc0170 February 9, 2021 11:46
@rajkan01 rajkan01 force-pushed the refactor_greentea_cmakelist branch 2 times, most recently from 6777938 to 8715161 Compare February 9, 2021 12:50
MarceloSalazar
MarceloSalazar previously approved these changes Feb 9, 2021
Copy link

@MarceloSalazar MarceloSalazar left a comment

Choose a reason for hiding this comment

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

Thanks for the changes. I trust it works - I'll test once all work on Greentea is complete.

@mergify mergify bot added needs: CI and removed needs: work labels Feb 9, 2021
Copy link
Contributor

@0xc0170 0xc0170 left a comment

Choose a reason for hiding this comment

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

Otherwise LGTM

@rajkan01 rajkan01 force-pushed the refactor_greentea_cmakelist branch from 8715161 to fbf6d88 Compare February 9, 2021 15:40
@rajkan01 rajkan01 requested a review from 0xc0170 February 9, 2021 15:41
@mergify mergify bot dismissed MarceloSalazar’s stale review February 9, 2021 15:43

Pull request has been modified.

@rajkan01 rajkan01 force-pushed the refactor_greentea_cmakelist branch from fbf6d88 to 4bb5733 Compare February 9, 2021 15:54
@rajkan01 rajkan01 force-pushed the refactor_greentea_cmakelist branch from 4bb5733 to be3a399 Compare February 10, 2021 14:56
- Added the new CMake `MBED_TEST_LINK_LIBRARIES` command-line argument support to receive
  all dependent libraries for the particular greentea test suite.
For example:
- To select mbed-os library, use cmake with -DMBED_TEST_LINK_LIBRARIES=mbed-os
- To select baremetal library, use cmake with -DMBED_TEST_LINK_LIBRARIES=mbed-baremetal
- To select baremetal with external error logging library to the test with -D "MBED_TEST_LINK_LIBRARIES=mbed-baremetal ext-errorlogging"
@rajkan01 rajkan01 force-pushed the refactor_greentea_cmakelist branch from be3a399 to b1c4c44 Compare February 11, 2021 11:06
@rajkan01 rajkan01 requested a review from rwalton-arm February 11, 2021 11:08
@rajkan01
Copy link
Contributor Author

@0xc0170 I have updated this PR as suggested in the review comment, please re-review

0xc0170
0xc0170 previously approved these changes Feb 11, 2021
@0xc0170
Copy link
Contributor

0xc0170 commented Feb 11, 2021

@rajkan01 shouldn't we update our docs as well, this config will be required to be passed when building a test. I wonder if we should document that this config should be used for selectable components?
Use case: if I am testing BLE with lets say storage, do I define target_link_libraries in my test to add mbed-ble and mbed-storage. But if I want to support mbed-baremetal and mbed-os,I let a user to choose from. My test would only have these 2 required libs.
I would like to avoid a confusion - how test should link the components together. WE provide t his macro for selectable components, so do not need to touch CMakelist and select via CMake argument.

A test can also check if baremetal was requested and report an error if it's not supported. It would use this MBED_TEST_LINK_LIBRARIES to check - we can provide a function later if this more common use case.

@rwalton-arm @hugueskamba What do you think?

@0xc0170 0xc0170 self-requested a review February 11, 2021 11:43
@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 the stale Stale Pull Request label Feb 11, 2021
@mergify mergify bot dismissed 0xc0170’s stale review February 11, 2021 19:29

Pull request has been modified.

Copy link
Contributor

@0xc0170 0xc0170 left a comment

Choose a reason for hiding this comment

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

Let's wait for @rwalton-arm review

@0xc0170
Copy link
Contributor

0xc0170 commented Feb 12, 2021

I started CI meanwhile

@mbed-ci
Copy link

mbed-ci commented Feb 12, 2021

Jenkins CI Test : ✔️ SUCCESS

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

CLICK for Detailed Summary

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

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

Successfully merging this pull request may close these issues.

7 participants