Unit tests: Add boilerplate code for AnalogIn.cpp
In pursuit of increasing unit test coverage of Mbed OS, we add the
boilerplate code for unit testing of AnalogIn.cpp and an empty test
source file. This serves two purposes - it allows us to report on
currently untested sources in code coverage data, and it makes it a
little easier for developers to write unit tests for these sources.

The 'empty' test file contains a main function that simply returns. This
is required to allow CMake's add_executable() to be used to pull in the
source file for the SUT, which ensures that this source file is built
and therefore instrumented to generate coverage data. The alternative
that was explored was to instead use Google Test's TEST() macro and
prefix the test name with 'DISABLED_' to skip it, but that resulted in
the test being reported as skipped, which was deemed undesireable for
these 'empty' tests.
ls
1 parent 9491403 commit c6312a3c70410ba507c5c41291b43b11ae904dc7
@Hari Limaye Hari Limaye authored on 10 Aug 2021
Showing 3 changed files
View
drivers/tests/UNITTESTS/AnalogIn/CMakeLists.txt 0 → 100644
View
drivers/tests/UNITTESTS/AnalogIn/test_analogin.cpp 0 → 100644
View
drivers/tests/UNITTESTS/CMakeLists.txt