Skip to content
Permalink
Browse files

tests/subsys/fs/littlefs: add tests

Verify all FS API calls using the nRF52840 development kit.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
  • Loading branch information...
pabigot authored and carlescufi committed Jul 31, 2019
1 parent bd6af27 commit 979fb85d50f6b31682e1ae46e83157bb10c11935
@@ -0,0 +1,8 @@
# SPDX-License-Identifier: Apache-2.0

cmake_minimum_required(VERSION 3.13.1)
include($ENV{ZEPHYR_BASE}/cmake/app/boilerplate.cmake NO_POLICY_SCOPE)
project(littlefs)

FILE(GLOB app_sources src/*.c)
target_sources(app PRIVATE ${app_sources})
@@ -0,0 +1,8 @@
#
# Copyright (c) 2019 Peter Bigot Consulting, LLC
#
# SPDX-License-Identifier: Apache-2.0
#
CONFIG_SPI=y
CONFIG_SPI_NOR=y
CONFIG_SPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096
@@ -0,0 +1,26 @@
/*
* Copyright (c) 2019 Peter Bigot Consulting, LLC
*
* SPDX-License-Identifier: Apache-2.0
*/

&mx25r64 {
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;

partition@0 {
label = "small";
reg = <0x00000000 0x00010000>;
};
partition@200000 {
label = "medium";
reg = <0x00010000 0x000F0000>;
};
partition@220000 {
label = "large";
reg = <0x00100000 0x00300000>;
};
};
};
@@ -0,0 +1,12 @@
CONFIG_FILE_SYSTEM=y
CONFIG_FILE_SYSTEM_LITTLEFS=y

CONFIG_MAIN_STACK_SIZE=4096

CONFIG_LOG=y
CONFIG_FLASH=y
CONFIG_FLASH_MAP=y
CONFIG_FLASH_PAGE_LAYOUT=y

CONFIG_ZTEST=y
CONFIG_ZTEST_STACKSIZE=4096
@@ -0,0 +1,26 @@
/*
* Copyright (c) 2019 Peter Bigot Consulting, LLC
*
* SPDX-License-Identifier: Apache-2.0
*/

/* Tests of functions in testfs_util */

#include <string.h>
#include <ztest.h>
#include "testfs_tests.h"

void test_main(void)
{
ztest_test_suite(littlefs_test,
ztest_unit_test(test_util_path_init_base),
ztest_unit_test(test_util_path_init_overrun),
ztest_unit_test(test_util_path_init_extended),
ztest_unit_test(test_util_path_extend),
ztest_unit_test(test_util_path_extend_up),
ztest_unit_test(test_util_path_extend_overrun),
ztest_unit_test(test_lfs_basic),
ztest_unit_test(test_lfs_dirops)
);
ztest_run_test_suite(littlefs_test);
}

0 comments on commit 979fb85

Please sign in to comment.
You can’t perform that action at this time.