Dynamic host test loader (from directory location)#32
Merged
PrzemekWirkus merged 4 commits intomasterfrom Nov 20, 2015
Merged
Conversation
PrzemekWirkus
added a commit
that referenced
this pull request
Nov 20, 2015
Dynamic host test loader (from directory location)
PrzemekWirkus
added a commit
to ARMmbed/greentea
that referenced
this pull request
Nov 20, 2015
Dynamic host test loader (from directory location) - support for ARMmbed/htrun#32
|
Would this work with |
Contributor
Author
|
@autopulated It should, I've added |
Contributor
Author
|
@autopulated There is a problem with resolving of default host test directory. I've filed issue on myself: #33 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
This feature allows
mbedhtrunto load and register additional host test scripts from given directory.In many cases users will add host tests to their yotta modules preferably under
/test/host_tests/module directory.Host tests script files are enumerated and registered so they can be used with local module test cases.
Rationale
Not all host tests can be stored with
mbedhtrunpackage. Some of them may and will be only used locally, for prototyping. Some host tests may just be very module dependent and should not be stored with `mbedhtrun``.Switch -e (enumerate host tests from directory)
New CLI switch
-e/--enum-host-testsdefines (yotta module) directory in which we will store local host tests. You can also pointmbedhtrunto different directory with pool of host tests.Note: Directory ytmodule
/test/host_testswill be default local host test location used by test tools such asgreentea.Example
In this example we have simple test
basiclocated under/test/basic(C++ code) and corresponding host test under/test/host_tests,In this example we will add to yotta module
./testdirectory sub directoryhost_testsand put simple host testbasic.py.Test
/test/basicis connected with host test by namembed_drivers_basicdefined both in test case C++ source code (see listing below) and as name of host test.Directory structure with local host test(s):
We can now point
mbedhtrun(switch--enum-host-tests .\test\host_tests\) to new location within yotta module and use--listswitch to just registered host tests:New locally defined host test was registered as
mbed_drivers_basic(modulebasic, classbasic.Basic().Where:
mbed_drivers_basicis host test name loaded fromBaseHostTest.Basic.namebasicname is Python file name (no extension)basic.Basic()name is composed from module and class (inherited fromBaseHostTest) name inside host test fileExample test (+ new host test) execution command
Note: Add switch
-vto increase-eswitch's verboseness.basic.cpp listing
Note:
MBED_HOSTTEST_SELECT(mbed_drivers_basic);macro usage.basic.py listing
Note:
name = 'mbed_drivers_basic'host test name definition.