Use the kconfig option COMPILER_WARNINGS_AS_ERRORS instead
of passing the compiler option directly to the build.
That allows us to do whatever needs to be done in cmake to ensure
warnings are treated as errors.
Also handle better options and paths with spaces on them.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
As discussed during DHCPv4 server integration, group DHCPv4 client files
with DHCPv4 server in a single lib directory.
Renamed internal "dhcpv4.h" header to "dhcpv4_internal.h" so that it's
not confused with the public "dhcpv4.h" header.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
The test instantiate few vnd,i2c devices so it fails with boards with
devices that select I2C, as that causes i2c_test.c to be included with
the build that tries to redefine the same devices as well.
This is a library test anyway, so restricting to native_sim should be
good enough for it anyway.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Move DHCPv4 client tests to subdirectory, to make room for DHCPv4 server
tests.
Rename test project to dhcpv4_client to better reflect its purpose.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Adds a configurable delay to the test threads. It exists to keep
thread0 from hogging the scheduler's spin lock and giving threads
on another core a better chance to obtain that lock and not starve.
Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
This test uses functions and types which are extensions to
the C library. Let's explicity select one of the extensions
which includes it instead of relaying on somebody having
set it for this file somewhere else.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
strnlen is not a C standard API, but an extension.
Instead of relaying that the SOURCE macro was set somewhere else
of that the C library provides a prototype anyhow
let's explicitly define it for this library.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
strnlen is not a C standard API, but an extension.
Instead of relaying that the SOURCE macro was set somewhere else
of that the C library provides a prototype anyhow
let's explicitly define it for this library.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
This test uses functions which are extensions to
the C library. Let's explicity select one of the extensions
which includes it instead of relaying on somebody having
set it for this file somewhere else.
(Note this test is exclusive to native targets)
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
strnlen() and strtok_r() are tested in this files
which are extensions to the the
std C library. Let's explicity select one of the extensions
also when building with the host C library,
instead of relaying on somebody having
set it for this file somewhere else.
Also, let's be nice and undefine them first in case they had
been defined somewhere else in the build scripts.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
This test uses functions which are extensions to
the C library. Let's explicity select one of the extensions
which includes it instead of relaying on somebody having
set it for this file somewhere else.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
This constant is supposed to be defined as a long instead of an int,
presumably to support systems where int isn't large enough.
Signed-off-by: Keith Packard <keithp@keithp.com>
Previously, the number 2 seemed to be somewhat magical. This
removes some of the mystery by labeling it.
So threads >= DETACH_THR_ID will be detached (we should not
attempt to join detached threads).
Signed-off-by: Christopher Friedt <cfriedt@meta.com>
For qemu_x86 and qemu_x86_64, it would seem that
heap-allocated thread stacks, as well as thread stacks
defined via K_THREAD_STACK_ARRAY_DEFINE(), must be at least
4096 bytes in size.
Using those sizes will ensure that these tests do not
fail with stack overflows or MMU faults.
Signed-off-by: Christopher Friedt <cfriedt@meta.com>
Rather than shadowing most of the fields from pthread_attr_t
(struct posix_thread_attr) inside of struct posix_thread, just
embed the structure itself.
Additionally, use pthread_attr_init() to allocate a thread
stack and pthread_attr_destroy() to destroy a thread stack,
dramatically simplifying pthread_create().
A fair bit of rework was needed already to mitigate bitrot
issues in the testsuite. More should probably be done later.
Signed-off-by: Christopher Friedt <cfriedt@meta.com>
The testsuite has been shifted to use dynamic thread
stacks (either statically allocated via a pool, or
dynamically allocated via the heap).
However, we definitely still need coverage for manually
specified thread stacks - but lets avoid duplicating
tests unnecessarily.
Signed-off-by: Christopher Friedt <cfriedt@meta.com>
Rather than fail when attempting to set an extraordinarily large
pthread stack size (much larger than most Zephyr platforms have)
consider the test non-fatal and skip it.
Signed-off-by: Christopher Friedt <cfriedt@meta.com>
Add functions to unset, or remove, specific codec
LTV structure from codec_cfgs or codec_caps.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Add support for CAP test cases.
Split btp_bap.c for better maintenance into unicast and broadcast.
Signed-off-by: Magdalena Kasenberg <magdalena.kasenberg@codecoup.pl>
Adds test cases testing following features:
- function error handling
- basic notification type
- thread notification type
- adding notification to non-empty queue
Signed-off-by: Adam Wojasinski <awojasinski@baylibre.com>
Instead of seeding the random generator from the test
itself calling into a host API, let's use the
entropy generator option to be seeded from /dev/urandom
This avoids trouble with the srandom() and time() calls
not existing depending on the chosen C library.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Zephyr does not include this function under Rule A.4: C Standard Library
Usage Restrictions in Zephyr Kernel, hence a conforming C library need not
provide it.
Signed-off-by: Keith Packard <keithp@keithp.com>
Remove receive and transmit timeouts which are no
longer useful as the RECEIVE_READY and
TRANSMIT_IDLE events will be used to efficiently
manage timeouts between transmit/receive calls.
Then update the the in-tree drivers using the
modem_chat module to omit the process timeout
parameter.
Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
Temporarily ignore the Tx ISO Data Packet Sequence Number use
as the tester app does not have yet a synchronization mechanism for
the sequence number and it constantly fails to send ISO data on time.
Signed-off-by: Magdalena Kasenberg <magdalena.kasenberg@codecoup.pl>
Minor fixes in this test script to:
* Start with an empty flash even if there was a left over flash file
on disk
* Not overwrite the simulation activity from the first part of the test
in the second part of the test, to allow looking into the
traffic and to allow rerunning the test in check mode, to ensure
there is no radio activity changes when another change is done.
* Set the simulation id to something more unique (it was just
"peripheral" before which is too easy to be repeated in another
test)
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Updates the latency_measure benchmark to make the number of
iterations for which each test executes to be configurable.
This allows someone to make a tradeoff between accuracy
and execution time (can be useful for simulators).
Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>
NXP RT series DMA need use buffer in nocached area,
so only use memory region relocated is not enough.
fixing: #67053
Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
This commit adds source and header files required for bmp581 I2C driver.
I have used bmp581_user.h to add more usage related definitions
but bmp581.h to add hardware related definitions.
Signed-off-by: Talha Can Havadar <havadartalha@gmail.com>
Signed-off-by: Gerhard Jörges <joerges@metratec.com>
Fix the handling of buffers with fragments. What seems to have been
broken is the metadata reference that was not passed to the next frag in
the chain.
Add a test to regression too.
The main user of this is IPSP.
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
Use different acquisition time for a board (WB55) that has individual
sampling register, and for another (WBA52) that have two common registers.
Signed-off-by: Guillaume Gautier <guillaume.gautier-ext@st.com>
In preparation for multiple tests, move the current hello_world test
to its own subdirectory. Also, merge the llext compilation in the
parent CMakeLists.txt.
Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
This patch reworks the YAML files for the llext samples and tests to
share a common restriction list. Also, using an arch-specific config
to disable the MPU for the ARM architecture only, there is no need
to duplicate the test cases per architecture.
Use this to enable the "writable" test case for the ARM architecture
and separate the "modules_enabled" case to test building as a module.
Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
Make it so LLEXT_TEST_HELLO is enabled by default, and it is actually
compiled only when the config is enabled.
The check for MODULES==y and LLEXT_TEST_HELLO!=m is redundant, as the
Twister machinery already causes an error when Kconfig flags specified
in the YAML file are coerced to different values.
Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
Add macro that allows registration of initialization functions that
are called when LwM2M engine starts.
On LwM2M engine starts up, it first executes all initialization
functions in following priority order:
1. LWM2M_PRIO_ENGINE
2. LWM2M_PRIO_CORE, this is where all LwM2M core objects are initialized
3. LWM2M_PRIO_OBJ, this is where all other objects are initialized
4. LwM2M_PRIO_APP, application initialization.
Now on the initialization phase, we could rely that certain objects have
already been registered.
For example custom objects can register callbacks to core objects.
On application phase, we can initialize sensor objects and register
their callbacks because objects have already been initialized.
This LWM2M_ON_INIT() should replace all use of SYS_INIT()
with the default CONFIG_KERNEL_INIT_PRIORITY_DEFAULT.
Priority order is actually just alphabetical order of names, so
the order is set on a linkin phase, and we don't need any
runtime checking for it.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
Adjust mesh test timing and timeout value for Advertising
Extensions use/fix in Zephyr Controller. The scanning in
Zephyr Controller is delayed when using extended scanning.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Add test suite which tests writing to and erasing all pages,
of any size defined by the page layout.
If the test is built with MCUBOOT, the test will jump into the
application, then run write/erase/boundary tests on the
bootload partition. If MCUBOOT is not selected, the test will
target the slot1 partition instead, performing the same tests.
Signed-off-by: Bjarki Arge Andreasen <bjarki@arge-andreasen.me>
Change the gpio_qdec driver to support optical encoders.
Add a property to use for defining an arbitrary number of GPIOs for the
sensing devices (typically infrared LEDs, but could also be the
biasing for the phototransistor), and one for adding a delay between
turning those on and reading the pin status.
The infrared LEDs typically consume a non negligible amount of power, so
there's also a new idle-poll-time-us property that enables two possible
modes of operation:
- if idle-poll-time-us is zero (default) the LEDs are enabled all the
time and the driver enters polling mode using the GPIO interrupt as
with mechanical encoders. This is usable for mains powered devices and
has the lowest overhead on the CPU.
- if idle-poll-time-us is non zero, then the driver polls the encoder
all the time, turning on the LEDs just before reading the state and
shutting them off immediately after, but when the encoder is idle it
switches the polling rate to idle-poll-time-us to save power, and only
polls at sample-time-us when some movement is detected.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Added new test for `DT_IRQ_LEVEL` and `DT_INST_IRQ_LEVEL`.
Introduced a new `vnd.cpu-intc` compatible so that we have a
root level interrupt controller that acts as level 1
aggregator, and modified `test_intc` to be level 2 aggregator,
updated test of `DT_IRQN(TEST_I2C_BUS)` accordingly.
Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Fixes an MPU fault that was occurring on some ARM platforms when
executing the events portion of the latency_measure benchmark. The
fault was tracked to an attempt by a user thread to read an MMIO
register that it did not have permissions to access.
The solution was to move the printing of the stats averages out of
the test thread and into the main thread as the main thread always
executes at kernel/supervisor level and will always have permissions
to read that MMIO register.
Fixes#67438
Signed-off-by: Peter Mitsis <peter.mitsis@intel.com>