GitHub hosted

Greentea test for Mbed HTTP with a host test runner

Download repository: zip

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.

Here’s a video.

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

  1. Clone this repository via Mbed CLI:

    $ mbed import

  2. Set your target:

    $ mbed target auto

  3. Set your compiler toolchain:

    $ mbed toolchain GCC_ARM

  4. If you’re using WiFi, set your credentials in mbed_app.json.

  5. 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.
  6. Run the tests:

    $ mbed test -v -n tests-tests-*

  7. 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