Testing Frameworks

PlatformIO supports the most popular testing frameworks and allows you to easily switch between them using the test_framework option in “platformio.ini” (Project Configuration File).

You can mix different frameworks in the same project. For example, use a more advanced C++ testing framework with Mocks for the Native development platform to run desktop tests on a host machine and a lightweight framework, such as Unity, for running tests on the target embedded device with constrained resources.

Compatibility

Framework

Test Types

Development Platforms

Mocking

Doctest

Native

Native

No

GoogleTest

Any

Native, Espressif 8266, Espressif 32

Yes

Unity

Any

Any

No

Tip

We highly recommend using the Unity testing framework if you plan to run tests on the target devices with constrained resources. The Unity has minimal requirements and works even on the 8-bit AVR MCUs.

See supported testing frameworks: