-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Allow unit tests defined anywhere in mbed-os #13253
Conversation
@jamesbeyond @0xc0170 We will need this for the directory structure work. Any suggestions? |
1c7d033
to
a884f1a
Compare
after the change, is the unit-test still required to be is a
|
For a test to compile & run, the directory does not have to be named UNITTESTS - it's not a magic keyword, unlike TESTS for Greentea. Hopefully our CI scripts don't look for UNITTESTS as a magic name? |
@LDong-Arm, thank you for your changes. |
@@ -178,7 +178,7 @@ foreach(testfile ${unittest-file-list}) | |||
|
|||
file(RELATIVE_PATH | |||
TEST_SUITE_NAME # output | |||
${PROJECT_SOURCE_DIR} # root | |||
"${PROJECT_SOURCE_DIR}/.." # root |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The relative path (to mbed-os) is the binary name of a test case. ${PROJECT_SOURCE_DIR}
is UNITTESTS
.
CI started |
Test run: SUCCESSSummary: 1 of 1 test jobs passed |
I see, Shall we keep the consistency of keeping the |
As we can see, the test case names have changed: https://mbed-os.mbedcloudtesting.com/blue/organizations/jenkins/mbed-os-ci_unittests/detail/mbed-os-ci_unittests/6431/tests |
I agree personally. We keep the name UNITTESTS for now as we re-structure some libraries, and plan to change it once we switch to a new build tool. |
will that work for unit tests outside of mbed-os directory? |
Not yet with this change, which is part of our refactoring work with fairly minimal impact. |
Thanks @LDong-Arm! So does that mean it will be worked on in the future? Would be glad to help as it is something we're looking for doing ourselves anyway. |
CI restarted (old results here) |
Test run: SUCCESSSummary: 1 of 1 test jobs passed |
Summary of changes
Currently unit tests are inside the top-level
UNITTESTS
. But in our new directory structure proposal, unit tests will be moved into libraries. To make it possible, this PR is to allowunittest.cmake
to sit anywhere inside Mbed OS.Before:
UNITTESTS/foo/test_A/unittest.cmake
->BUILD/unittests/foo-test_A
bar/UNITTESTS/test_B/unittest.cmake
-> not builtAfter:
UNITTESTS/foo/test_A/unittest.cmake
->BUILD/unittests/UNITTESTS-foo-test_A
bar/UNITTESTS/test_B/unittest.cmake
->BUILD/unittests/bar-UNITTESTS-test_B
IMO we can fine tune the test binary names in the future, but they don't really matter in my opinion.
Impact of changes
Migration actions required
Documentation
Pull request type
Test results
Reviewers
@0xc0170 @jamesbeyond @ARMmbed/mbed-os-core