Skip to content

Unit tests: Move storage stubs into the storage directory #14862

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 9 commits into from
Jul 6, 2021

Conversation

LDong-Arm
Copy link
Contributor

Summary of changes

Currently, unit test stubs are mostly located in the top-level UNITTESTS/stubs directory, partly duplicating the way libraries are structured. To make test stubs and their CMake definitions better organized, we relocate them into the libraries being tested. This PR covers stubs for storage.

Fixes #14792

For details, refer to the commit messages.

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

@ARMmbed/mbed-os-core


LDong-Arm added 5 commits July 2, 2021 13:44
Move storage stubs from UNITTESTS/stubs into components inside the
top-level storage directory. Specifically,
* storage/blockdevice/tests/UNITTESTS/doubles/ for BlockDevice stubs.
* storage/kvstore/filesystemstore/tests/UNITTESTS/ for a stub used by
the FileSystemStore test. The stub has been renamed from
kv_config_stub.cpp to filesystemstore_kv_config_stub.cpp, to make it
evident why it doesn't go into storage/kvstore/kv_config/.
The header `mbed.h` pulls in headers from a number of Mbed OS
components that are not necessarily used. It was intended for user
applications only, and libraries and unit tests should explicitly
include library headers it uses to limit dependencies.

This change avoids having to link unnecessary libraries in storage
unit tests' CMake definitions.
@LDong-Arm LDong-Arm requested a review from a team July 2, 2021 12:54
@ciarmcom ciarmcom added the release-type: patch Indentifies a PR as containing just a patch label Jul 2, 2021
@ciarmcom
Copy link
Member

ciarmcom commented Jul 2, 2021

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

@LDong-Arm
Copy link
Contributor Author

LDong-Arm commented Jul 2, 2021

Oh I still need to move mbed-headers-storage. Moving this to draft for now.

@LDong-Arm LDong-Arm marked this pull request as draft July 2, 2021 13:09
@LDong-Arm LDong-Arm changed the title Unit tests: Move storage stubs into the storage directory [WIP] Unit tests: Move storage stubs into the storage directory Jul 2, 2021
LDong-Arm added 4 commits July 2, 2021 16:25
Create a CMake target mbed-headers-blockdevice to separate BlockDevice
headers from the generic mbed-headers-storage. Update tests to use it.
Create a CMake target mbed-headers-filesystem to separate FileSystem
headers from the generic mbed-headers-storage. Update tests to use it.
Create a CMake target mbed-headers-kvstore to separate KVStore headers
from the generic mbed-headers-storage. Update tests to use it.
@LDong-Arm LDong-Arm changed the title [WIP] Unit tests: Move storage stubs into the storage directory Unit tests: Move storage stubs into the storage directory Jul 2, 2021
@LDong-Arm LDong-Arm marked this pull request as ready for review July 2, 2021 15:33
@LDong-Arm
Copy link
Contributor Author

Ready for 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 Jul 6, 2021
@0xc0170
Copy link
Contributor

0xc0170 commented Jul 6, 2021

Ci started

@mbed-ci
Copy link

mbed-ci commented Jul 6, 2021

Jenkins CI Test : ✔️ SUCCESS

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

CLICK for Detailed Summary

jobs Status
jenkins-ci/mbed-os-ci_build-cloud-example-ARM ✔️
jenkins-ci/mbed-os-ci_cmake-cloud-example-ARM ✔️
jenkins-ci/mbed-os-ci_unittests ✔️
jenkins-ci/mbed-os-ci_build-cloud-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_cmake-cloud-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_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 ✔️

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.

Move storage stubs to storage directory
6 participants