Singletest option -p to force peripherals #947
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
mbed/workspace_tools/singletest.py
script can work in--auto
mode withmbed-ls
module (not yet released officially).Auto-detection function doesn't allow users to define peripherals from command line. Now option
-p
can give you this functionality. You can set up forsingletest.py
global peripheral set which will be added to each auto-detected MUT (Mbed Under Test). This will allow users with farms (test beds) with common peripheral configuration for each device to run also peripheral tests.sengletest.py
simple peripheral description you would usually pass via option-M
andmuts_all.json
file.-p
with other options like-n
,-O
,-j
etc.Examples of -p option use
Separation between peripheral test mode and common test mode
Our test suite creates logical separation between tests for peripherals (see option
-P
) and common tests (see option-C
) which are tests without any external peripheral dependency like connected via SPI SD card).But as we said earlier we can mix new option
-p
with existing test suite options.When user tries to mix option
-p
and use option-n
(Specify by name test cases to be executed) to define test case names in peripheral test case namespace and common test case names, test suite will add non-peripheral test case names and just execute them.It shows option
-p
is not filtering non-peripheral test cases.Option
-P
didn't change its meaning. Please use option-P
to filter out non-peripheral test casesSee example below where we add use of peripheral
SD
with new option-p
(addSD
dependent test case names to global test case namespace) and at the same time we want to run two test cases by name:PERF_1
which is dedicatedSD
peripheral test andMBED_11
which is common test (no peripheral required)See below how we've added
SD
test case names to test namespace so option-n
can catch them and execute.See below how we've filtered out all non-peripheral test case names so option
-n
can now only catch peripheral test case names.Option
-C
will cancel out all peripheral tests in-n
even you specify peripherals using-p
:Peripheral usage use case
You can connect few boards all equipped with additional SD card peripheral and test for each of this boards
SD
peripheral related tests. Note that all devices should have common peripheral (SD card connected) and you can't exclude some devices from "I'm having this peripheral(s)" peripheral list.Example configuration (one LPC1768 device)
Note: Our simple configuration with one LPC1768 connected to host PC.
Building all default tests (no peripheral tests included)
Note: We have built only basic tests (just like for option
-C
)Using option -p to force peripheral on all auto-detected devices
Note:
singletest.py
built all tests related to SD card (option-p
) and only allowed peripheral tests to be included (already existing option `-P). Option
-O`` used to only build, no test execution on hardware.Building tests for few types of peripherals
Note: We've only built tests related to
digital_loop
andTMP102
peripherals.Let's run some tests related to this configuration:
Note: We've only executed tests related to
digital_loop
andTMP102
peripherals.Option -P for auto-detection doesn't work (if no -p defined)
Note: By default there are no peripherals attached to MUT because there is no extra peripheral information.
Auto-detection mode --auto silently assumes we are using -C switch to only use default tests (no peripheral association)
Note: Option
-C
used with--auto
mode doesn't do anything (assumed silently if no other things specified).Example
Let's connect two devices with connected peripherals (some peripherals will be shared between this devices).
I've connected:
Note we share few the same peripherals across those two boards.
Let's first detect them (no peripherals can be detected with
--auto
option) but I know hardware configuration I'm using:Now we can just use our experience and mix few options to just execute two tests across all connected platforms:
And execute one test from common test domain (
MBED_11
, one from peripheral connected to and available on both platforms (PERF_1
), and one only for KL25Z platform (KL25Z_4
).