1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

tests/pkg_fatfs_vfs: format storage before running the test

This commit is contained in:
Benjamin Valentin 2020-07-02 19:11:32 +02:00
parent 5b246d02c0
commit 9f4fa5ac99
2 changed files with 11 additions and 0 deletions

View File

@ -4,6 +4,9 @@ USEMODULE += fatfs_vfs
FEATURES_OPTIONAL += periph_rtc
FEATURES_REQUIRED += periph_spi
# remove this if you don't want to format your SD card
USEMODULE += fatfs_vfs_format
FATFS_IMAGE_FILE_SIZE_MIB ?= 128
ifeq ($(BOARD),native)

View File

@ -80,6 +80,13 @@ static void print_test_result(const char *test_name, int ok)
printf("%s:[%s]\n", test_name, ok ? "OK" : "FAILED");
}
static void test_format(void)
{
#ifdef MODULE_FATFS_VFS_FORMAT
print_test_result("test_format__format", vfs_format(&_test_vfs_mount) == 0);
#endif
}
static void test_mount(void)
{
print_test_result("test_mount__mount", vfs_mount(&_test_vfs_mount) == 0);
@ -412,6 +419,7 @@ int main(void)
printf("Tests for FatFs over VFS - test results will be printed "
"in the format test_name:result\n");
test_format();
test_mount();
test_open();
test_rw();