-
Notifications
You must be signed in to change notification settings - Fork 3k
Host test autodetection #900
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
Host test autodetection #900
Conversation
Sync with master
Reactored RTOS tests
…e_main, dev_null, rtc, stdio
Ran checks for current implementation on LPC1768
…o-test description
Checked refactoring progress on LPC11U24
…nt for 'Elapsed Time (sec)' report in singletest.py console reports
Refactoring Tested with few Nucleo boards and Nordic board
We can now use --config -f <mcu> to filter only targets we are interested in
Timeout is captured by application supervising host_test and duration is modiffied Added functionality preventing MUT printouts to reset device's timeout value or script execution timer counter
Added switch --tc to force certain toolchains. Switch --auto and -tc works well with switch --config so do not hesitate to check your configuration before running your test suite.
Minor code indents
void notify_test_description(const char *description); | ||
|
||
// Host test auto-detection API | ||
#define TEST_START(TESTID) notify_test_id(TESTID); notify_start() |
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 would use prefix with the name of this test env, it's either part of mbed or any other. The other libraries can easily have similar macros TEST_DESCRIPTION or similar.
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.
Yes, you are right, I will change it to something more mbed
specific / descriptive.
Host test autodetection improvements
Description
In order to achieve leaner test suite functionality and in the future decouple functionality such as:
mbed-ls - cool mbed-enabled platform auto-detection on your host!
mbed-ls is Python module used to detect and list mbed-enabled devices connected to host computer. package will support Windows 7, Ubuntu and MacOS. It will be delivered as redistributable Python module (package) and command line tool.
Currently mbed-ls module is under development but already decoupled mbed-ls functionality is delivered to mbed SDK's test suite.
You will be able for example to use this tool from command line!
New command line switch
--auto
and--tc
are added toworkspace_tools/singletest.py
script and replace (not completely, you will be still able to use configuration files just because they are more powerful than mbed-ls) existing file based test configuration.Currently you will execute your automated tests like this:
With mbed-ls tools you will be able to auto-detect all connected to your host devices and just decide which toolchains you want to include.
Below command is replacement for
-i
and-M
combo. Tests will be built using default compiler for each detected mbed-enabled platform.Note: Now mbed-ls tools will detect devices for you, pair serial ports and disks (mount points) and based on TargetID determine mbed-enabled target generic name.
or just for example specify that you want to build tests using default toolchains (per platform) and GCC_ARM for all platforms.
New
--auto
command is compatible with existing command line switches so you can for example:-f
):-V
to see test printouts in real time, choose test(s) you want to execute with-n
option and define your favorite toolchain(s) with--tc
:Host test script auto-detection
Structure for host tests and C/C++ test source code changed. In the future tests will be deployed together with corresponding modules. For now mbed SDK tests have to improve. We want to remove dependency on
workspace_tools/tests.py
test meta-data and move test / test runner handshake inside test source code.TEST_*
are used to notify host test system about prefered host test handler. Now test will decide which host test should handle it, not extra meta-data.Note, things like:
TEST_TIMEOUT()
.TEST_DESCRIPTION()
.TEST_HOSTTEST()
.TEST_RESULT()
macro - if applicable. Host test can decide about test case result in many cases.mbed SDK is now in color!
Colorama is new package dependency added so CLI is now colorful (Hard to say if this is good or bad).

Below sample of new color format:
Multiple boards of the same type
Few boards of the same type can be auto-detected but tests are performed for one device of each type.
Test execution in above configuration:
Testing
Solution tested with 8 of mbed-enabled boards. Both test auto-detection for
test_env
and unit tests usingCppUTest
works well.This solution will be tested with greater number of boards soon, so pelase wait for notification in this pool request.