mbed-os/storage
Robert Walton fca7323f73 CMake: QSPIFBlockDevice: Guard unit test directory
In the QSPIFBlockDevice component we checked if BUILD_TESTING was
enabled before adding the QSPIFBlockDevice/UNITTESTS subdirectory. In
the parent blockdevice/CMakeLists.txt we added the QSPIFBlockDevice
subdirectory to the build under two separate conditions:

* when "QSPIF" is present in MBED_TARGET_LABELS
* when building only unit tests

This wasn't quite enough, as when we build greentea tests for some
targets QSPIF is enabled in MBED_TARGET_LABELS, causing the
QSPIFBlockDevice subdirectory and its unit tests to be added when
building greentea tests. This caused a test failure on targets which
enable QSPIF:

```
The following tests FAILED:
	 40 - qspif-unittest_NOT_BUILT (Not Run)
```

To fix this we need to specifically check that we're not building
greentea tests before adding the QSPIFBlockDevice/UNITTESTS directory to
the project.

Part of this issue is our reliance on MBED_TARGET_LABELS to pull
features in to the build. We should refactor our usage of
MBED_TARGET_LABELS and use CMake target dependencies where possible.
Then we wouldn't need to add subdirectories under various, often
conflicting, scenarios. Instead the targets would always be available
and we would just choose which ones to actually build in different cases
using CMake target linking.
2021-09-15 11:38:30 +01:00
..
blockdevice CMake: QSPIFBlockDevice: Guard unit test directory 2021-09-15 11:38:30 +01:00
docs Refactor KVStore config override explanation 2021-05-11 17:19:16 +01:00
filesystem CMake: Add option to enable greentea tests 2021-08-10 16:35:11 +01:00
kvstore CMake: Add option to enable greentea tests 2021-08-10 16:35:11 +01:00
platform CMake: Rename CMake targets 2020-11-06 17:25:22 +00:00
CMakeLists.txt Unit tests: Create mbed-headers-filesystem 2021-07-02 16:25:43 +01:00