5 years, 4 months ago.

Step by step how write and execute unit test

Hi all, I tried make unit test function in my code but it don't work :(

for example I have simple function a+b = c:

include the mbed library with this snippet

int add(int value1, int value2) {
return value1 + value2;
}

I use Clion to write code, and have mbec-cli, mbedgt.

I read doc about test but there was not details how write unit test (expectedly for GreenTea an Icetea) . Someone can write how step by step write unit test to test this function in IDE and test it in target for example nucleo?

which framework for test is best: gtest, unity, catch.

1 Answer

5 years, 3 months ago.

Hi, please read https://github.com/ARMmbed/mbed-os/tree/master/UNITTESTS that should explain all needed