![](/media/cache/group/Dangerous-Situations26.png.50x50_q85.jpg)
Greentea test for Mbed HTTP with a host test runner
Mbed OS Integration Test example
This is an example application that contains simple integration tests that can be ran with Greentea. It also contains a host runner example that runs on the computer, and can be used to communicate back and forth from the device. More information can be found in the Testing tools section in the Mbed OS documentation.
Which tests
There are two tests included:
- simple-test - bare minimum Greentea test.
- toilet-test - test for the Mbed HTTP library that sends data to the cloud. A host test is included to verify that the right data was sent.
How to run
-
Clone this repository via Mbed CLI:
$ mbed import https://os.mbed.com/teams/sandbox/code/mbed-http-integration-test/
-
Set your target:
$ mbed target auto
-
Set your compiler toolchain:
$ mbed toolchain GCC_ARM
-
If you’re using WiFi, set your credentials in
mbed_app.json
. - If you’re not using the built-in network adapter, add the driver, and then select the driver in TESTS/tests/toilet-test/main.cpp. For more information see IP Networking in the Mbed OS documentation.
-
Run the tests:
$ mbed test -v -n tests-tests-*
-
Example output:
mbedgt: test case report: +--------------+---------------+-------------------------+--------------+--------+--------+--------+--------------------+ | target | platform_name | test suite | test case | passed | failed | result | elapsed_time (sec) | +--------------+---------------+-------------------------+--------------+--------+--------+--------+--------------------+ | K64F-GCC_ARM | K64F | tests-tests-simple-test | simple test | 1 | 0 | OK | 0.0 | | K64F-GCC_ARM | K64F | tests-tests-toilet-test | dump message | 1 | 0 | OK | 10.77 | +--------------+---------------+-------------------------+--------------+--------+--------+--------+--------------------+ mbedgt: test case results: 2 OK mbedgt: completed in 52.50 sec