-
Notifications
You must be signed in to change notification settings - Fork 3k
CMake: Update README.md with CTest/greentea instructions #15001
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
Conversation
@rwalton-arm, thank you for your changes. |
cd cmake_build/<MBED_TARGET>/<PROFILE>/<TOOLCHAIN>/ && cmake ../../../.. -G Ninja -DMBED_GREENTEA_TEST_BAREMETAL=ON && cmake --build . | ||
cmake --build __build | ||
cd __build | ||
ctest -V |
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.
Is it worth adding a note on how to run an individual test?
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.
I'll add a link to the ctest documentation to avoid repeating it here.
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.
Even though how to filter an individual test(s) is in the CTest documentation, it only covers the "run" stage. It's still good to let users know how to build one test. Presumably using --target <test-name>
instead of --target test
? Since building & testing of one test is a very commonly done task, giving a special mention of both in one place could be useful in my opinion.
Especially that the build time for all tests has increased quite a lot by now (e.g. over 10K object files as of today). Even though it's partially because INTERFACE
libraries does lots of duplicated compilation than STATIC
(a bit off-topic now...)
``` | ||
* Build the test binary with the full profile | ||
## How to build and run greentea tests | ||
|
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.
I wonder if we need a note that migration of all tests is still in progress?
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.
This is the last remaining question. Can we merge this to get into the upcoming release (code freeze today).
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.
Should we wait until the migration of all tests is complete before merging this? I can see it causing confusion for users. This PR also removes the previous instructions for running greentea tests, which users could've been relying on. Rather than adding caveats or calling out both methods of running the tests, maybe we wait until the work to migrate all tests is complete, then the documentation is correct (and doesn't need to be changed again later)?
The steps for building and running a greentea test have changed since 40154ee. This commit updates the README with the current instructions for building and running greentea tests using CMake/Ninja/CTest.
15b6127
to
80fe7c2
Compare
The `MBED_HTRUN_ARGUMENTS` argument is a semicolon separated list of arguments | ||
to forward to `mbedhtrun`. You can pass any of the optional flags you would | ||
usually pass to `mbedhtrun` by adding them to this list. |
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.
Worth noting that each argument is already quoted by CTest so the user should not add quotation marks or escape any characters.
For example, a mount point has a space inside, in which case -DMBED_HTRUN_ARGUMENTS="-p;/dev/tty.usbmodem14402;-d;/Volumes/NuMicro MCU"
just works, but -DMBED_HTRUN_ARGUMENTS="-p;/dev/tty.usbmodem14402;-d;/Volumes/NuMicro\ MCU"
causes the backslash to be treated as a literal character, and -DMBED_HTRUN_ARGUMENTS="-p;/dev/tty.usbmodem14402;-d;'/Volumes/NuMicro\ MCU'"
causes the single quotes to be treated as literal characters.
Closing due to inactivity. |
Summary of changes
The steps for building and running a greentea test have changed since
40154ee. This commit updates the README
with the current instructions for building and running greentea tests
using CMake/Ninja/CTest.
Partially fixes #14854
Impact of changes
N/A
Migration actions required
N/A
Documentation
None
Pull request type
Test results
Reviewers