Enable all these tests which run in native_posix in native_sim,
Switch from native_posix to native_sim as default test platform
And switch native_posix overlays to native_sim.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Rework RAM disk driver to be configured using devicetree and
support multiple instances.
This patch also removes a copy of the RAM disk driver,
tests/subsys/fs/fat_fs_dual_drive/src/disk_access_test_drv.c,
that was there for testing multiple disk drivers support.
Bonus: one SYS_INIT() less and a memory region can be exported to the
host.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
Test will now use disk_access_ functions to erase FAT FS
disk before some operations when target disk is not set with
CONFIG_DISK_DRIVER_FLASH.
Fixes#53151
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
The MKFS portion of the test is still was being included
in the build when it shouldn't because of a file glob
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
Clean up occurrences of "#if IS_ENABLED(CONFIG_FOO)" an replace
with classical "#if defined(CONFIG_FOO)".
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
MKFS testing inappropriately uses flash API in the FAT FS API test,
causing build errors for the test when testing file systems on storage
devices other than flash. Hotfix by making this part of the test
conditional on CONFIG_FLASH.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
Remove all obsolete DISK_FLASH* Kconfig options.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
Add flash disk description to overlays. Specify custom flashdisk
partition for fat fs api test to match the Kconfig values, because
native posix storage partition is too small for FatFS filesystem.
Co-authored-by: Johann Fischer <johann.fischer@nordicsemi.no>
Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
As of today <zephyr/zephyr.h> is 100% equivalent to <zephyr/kernel.h>.
This patch proposes to then include <zephyr/kernel.h> instead of
<zephyr/zephyr.h> since it is more clear that you are including the
Kernel APIs and (probably) nothing else. <zephyr/zephyr.h> sounds like a
catch-all header that may be confusing. Most applications need to
include a bunch of other things to compile, e.g. driver headers or
subsystem headers like BT, logging, etc.
The idea of a catch-all header in Zephyr is probably not feasible
anyway. Reason is that Zephyr is not a library, like it could be for
example `libpython`. Zephyr provides many utilities nowadays: a kernel,
drivers, subsystems, etc and things will likely grow. A catch-all header
would be massive, difficult to keep up-to-date. It is also likely that
an application will only build a small subset. Note that subsystem-level
headers may use a catch-all approach to make things easier, though.
NOTE: This patch is **NOT** removing the header, just removing its usage
in-tree. I'd advocate for its deprecation (add a #warning on it), but I
understand many people will have concerns.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Update CONFIG_DISK_FLASH_DEV_NAME to devicetree node name as
we have removed the "label" property. This gets the associated
tests to pass again.
Signed-off-by: Kumar Gala <galak@kernel.org>
Add a bunch of missing "zephyr/" prefixes to #include statements in
various test and test framework files.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
In order to bring consistency in-tree, migrate all tests to the new
prefix <zephyr/...>. Note that the conversion has been scripted, refer
to #45388 for more details.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Mounting FAT FS will set FS_MOUNT_FLAG_USE_DISK_ACCESS to the flags
of an object serving the mount point.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
Move to CMake 3.20.0.
At the Toolchain WG it was decided to move to CMake 3.20.0.
The main reason for increasing CMake version is better toolchain
support.
Better toolchain support is added in the following CMake versions:
- armclang, CMake 3.15
- Intel oneAPI, CMake 3.20
- IAR, CMake 3.15 and 3.20
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
The commit adds initializations of fs_dir_t variables in preparation
for fs_opendir function change that will require fs_dir_t object, passed
to the function, to be initialized before first usage.
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
The commit adds initializations of fs_file_t variables in preparation
for fs_open function change that will require fs_file_t object, passed
to the function, to be initialized before first usage.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
Make sure that "%ld" gets a long int argument.
This commit eliminates a couple of compiler warnings of this kind:
test_fat_file.c: In function 'test_file_truncate':
test_fat_file.c:180:11: error: format '%ld' expects argument
of type 'long int', but argument 2 has type 'off_t' {aka 'int'}
[-Werror=format=]
180 | TC_PRINT("Original size of file = %ld\n", orig_pos);
Signed-off-by: Martin Åberg <martin.aberg@gaisler.com>
Adds various tests for mounting ELM FAT FS with FS_MOUNT_FLAG_NO_FORMAT
and FS_MOUNT_FLAG_READ_ONLY, and operations on read-only mounted
file system.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
The addition of support for open flags, within fs_open, requires
addition of new test cases to FAT FS back-end tests.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
The fs_open has been extended with support for open flags.
Currently supported flags are:
FS_O_READ -- open for read
FS_O_WRITE -- open for write
FS_O_CREATE -- create file if it does not exist
FS_O_APPEND -- move to the end of file before each write
The FAT FS and LittleFS front-ends within the Zephyr has also been
modified to utilize the flags.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
An old doxygen biolerplate was being copied all over the tests. The
defined groups are not being used anywhere and it does not follow how we
document tests for example in the kernel and other places.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
A hardcoded path lenth of 80 will not be able to suppor the full length
of 255 when LFN is enabled. This does produce a compiler error,
thankfully, this is only applicable to the test cases.
Signed-off-by: Roman Vaughan <nzsmartie@gmail.com>
... because it is (required).
This makes a difference when building with CMake and forgetting
ZEPHYR_BASE or not registering Zephyr in the CMake package registry.
In this particular case, REQUIRED turns this harmless looking log
statement:
-- Could NOT find Zephyr (missing: Zephyr_DIR)
-- The C compiler identification is GNU 9.3.0
-- The CXX compiler identification is GNU 9.3.0
-- Check for working C compiler: /usr/bin/cc
-- ...
-- ...
-- ...
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at CMakeLists.txt:8 (target_sources):
Cannot specify sources for target "app" which is not built by
this project.
... into this louder, clearer, faster and (last but not least) final
error:
CMake Error at CMakeLists.txt:5 (find_package):
Could not find a package configuration file provided by "Zephyr" with
any of the following names:
ZephyrConfig.cmake
zephyr-config.cmake
Add the installation prefix of "Zephyr" to CMAKE_PREFIX_PATH or set
"Zephyr_DIR" to a directory containing one of the above files. If
"Zephyr" provides a separate development package or SDK, be sure it
has been installed.
-- Configuring incomplete, errors occurred!
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Using find_package to locate Zephyr.
Old behavior was to use $ENV{ZEPHYR_BASE} for inclusion of boiler plate
code.
Whenever an automatic run of CMake happend by the build system / IDE
then it was required that ZEPHYR_BASE was defined.
Using ZEPHYR_BASE only to locate the Zephyr package allows CMake to
cache the base variable and thus allowing subsequent invocation even
if ZEPHYR_BASE is not set in the environment.
It also removes the risk of strange build results if a user switchs
between different Zephyr based project folders and forgetting to reset
ZEPHYR_BASE before running ninja / make.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Remove leading/trailing blank lines in .c, .h, .py, .rst, .yml, and
.yaml files.
Will avoid failures with the new CI test in
https://github.com/zephyrproject-rtos/ci-tools/pull/112, though it only
checks changed files.
Move the 'target-notes' target in boards/xtensa/odroid_go/doc/index.rst
to get rid of the trailing blank line there. It was probably misplaced.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
According to the comment in #20008 I found out that some test cases
for different tests have same names.
To get rid of it, I decided to change test cases names.
Signed-off-by: Maksim Masalski <maksim.masalski@intel.com>
This board and SoC was discontinued some time ago and is currently not
maintained in the zephyr tree.
Remove all associated configurations and variants from the tree.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
move fs.h to fs/fs.h and
create a shim for backward-compatibility.
No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.
Related to #16539
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Per guidelines, all statements should have braces around them. We do not
have a CI check for this, so a few went in unnoticed.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Update the files which contain no license information with the
'Apache-2.0' SPDX license identifier. Many source files in the tree are
missing licensing information, which makes it harder for compliance
tools to determine the correct license.
By default all files without license information are under the default
license of Zephyr, which is Apache version 2.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Move to latest cmake version with many bug fixes and enhancements.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
These tests were creating objects from header file in the bss.
Fixed it by moving the objects to appropriate object files.
Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
When using an IDE (e.g. Eclipse, Qt Creator), the project name gets
displayed. This greatly simplifies the navigation between projects when
having many of them open at the same time. Naming every project "NONE"
defeats this functionality.
This patch tries to use sensible project names while not duplicating
too much of what is already represented in the path. This is done by
using the name of the directory the relevant CMakeLists.txt file is
stored in. To ensure unique project names in the samples (and again, in
the tests folder) folder, small manual adjustments have been done.
Signed-off-by: Reto Schneider <code@reto-schneider.ch>