Hi Inderpal,
On Fri, Apr 12, 2019 at 02:38:27PM +0530, inderpal singh wrote:
> Hi There,
>
> How can I run existing test suite for particular BSP instead of native.
>
> #newt test all
> instead of native how can I run this on my target.
There are two kinds of Mynewt unit tests:
1. Self tests.
2. Hosted test.
Self tests run in the simulator via "newt test".
Hosted tests run on actual hardware. These need to be built into a
Mynewt app which gets loaded onto a device.
Hosted tests are more challenging to use than self tests because:
1. The system does not reset itself between each unit test. Your unit
tests need to ensure a clean state when they are set up.
2. You need some extra tooling to retrieve test results from the device.
3. The tests must run in a constrained embedded environment.
`apps/testbench` is an example of an app that runs hosted tests. You
use the `newtmgr` tool
(http://mynewt.apache.org/latest/newtmgr/index.html) to run tests and
collect test results.
To run all hosted tests:
newtmgr run test all
To read results:
newtmgr log show testlog
A few notes:
* You will need to specify a connection profile or connection string
on the command line; see the newtmgr documentation.
* The `log show` command needs to be executed many times to collect
all the test results.
I recommend starting with this testbench application. Once you get it
running, you can add additional tests.
Chris