tests-filesystem-general_filesystem declares BlockDevice and FileSystem
pointers as globals. If these are initialized to their respective
default_instance values in the declaration, the LFS init happens during
OS startup when __libc_init_array() is invoked by mbed_toolchain_init().
If the filesystem blockdevice does not currently contain a valid filesystem
(e.g. the chip has just been erased), then LFS will flag this as corruption
and abort the mounting process.
This cleanup process can take long enough (and is running pre-main) that
greentea times out waiting for the device to respond to its sync packet,
and resets the device.
To resolve this, move the initialization into the first test case
(bd_init_fs_reformat) right before it initializes and formats the
blockdevice and filesystem.
ARM microlib is not supported below features
- fflush(NULL) return `-1` instead `0`
- fread with size parameter "Zero".
- if file opened in append mode, file postion starts from the beginning.
Macro which restricted compilation to GCC_ARM is removed.
Existing read_write() test is amended to call stat() and check that correct size is returned.
In addition, prevent FS tests from running on internal flash,
due to the fact that file system on internal flash is not part of
our offering (TDBStore should be used there instead).
This is achieved by checking whether the board can allocate a certain memory
chunk (threshold) and skipping the test if it can't.
This should prevent these boards from failing in CI.
mbed.h was added in test, via greentea and utest header files. 'mbed.h' is removed
from header files and required header file and namespace is added to CPP/C files
Revert deprecation of FlashIAPBlockDevice 2 argument constructor has this was a breaking change. This follows a similar change in the external flashiap-driver repo.
"/fs" is a tautology - not a good name for the default filing system, as
whereever we use it, we know we're specifying a filing system. Rename to
"/default".