Commit graph

676 commits

Author SHA1 Message Date
Fabio Baltieri 7db1d17ee3 yamllint: fix all yamllint line-length errors
Fix all line-length errors detected by yamllint:

yamllint -f parsable -c .yamllint $( find -regex '.*\.y[a]*ml' ) | \
  grep '(line-length)'

Using a limit is set to 100 columns, not touching the commandlines in
GitHub workflows (at least for now).

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2023-01-04 01:16:45 +09:00
Krzysztof Chruscinski 537062b110 tests: lib: mpsc_pbuf: Add qemu_x86_64
Add target which supports SMP.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-12-29 10:33:29 +01:00
Krzysztof Chruscinski f0485c7053 tests: lib: mpsc_pbuf: Add stress test
Added stress test which validates proper behavior of mpsc_pbuf
when there are 2 producing contexts and dedicated consumer
context. Various configuration are tested with consumer having
the lowest, medium and the higher priority.

Test produces random size packets at random intervals. It validates
that each produced packet is consumed or dropped.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-12-29 10:33:29 +01:00
Krzysztof Chruscinski 300f9b95e5 tests: lib: mpsc_pbuf: Add new test case
Added test case for putting words when packet is claimed.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-12-29 10:33:29 +01:00
Krzysztof Chruscinski d6442ac9e1 tests: lib: mpsc_pbuf: Adapt test after changes in the module
Adapt test to the new method of buffer full detection. New
method increased buffer capacity.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-12-29 10:33:29 +01:00
Krzysztof Chruscinski b80becbb4d tests: lib: mpsc_pbuf: Add native_posix to allowed list
Add plaftorm used for integration to platform_allowed list.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-12-29 10:33:29 +01:00
Gerard Marull-Paretas adbd0603b6 lib: linear_range: fix count for ranges with step 0
Ranges with step 0, that is, multiple indices representing the same
value, need to report the count exclusively based on indices. This makes
it possible to later retrieve all values, e.g. in a group.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-12-27 13:12:55 +01:00
Mahesh Mahadevan 41dda6938e tests: devicetree: device: Add mimxrt595_evk_cm33 exclusion
Adds mimxrt595_evk_cm33 target to the exclusion list for tests
as this board enabled i2c by default for regulator usage which
conflicts with the test.

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2022-12-05 11:03:14 +01:00
Yuval Peress 0433965982 dsp: move cmsis_dsp basicmath tests
Move the tests to tests/subsys/dsp/ as they'll be a part of the Zephyr
dsp subsystem.

Signed-off-by: Yuval Peress <peress@google.com>
2022-12-02 20:15:55 +01:00
Gerard Marull-Paretas 55da0217da sys: linear_range: fix index calculation when spanning across groups
When dealing with groups, the specified window in
linear_range_group_get_win_index can span across multiple groups. In the
current implementation, if maximum value was not in the same sub-window
as the minimum value the function would return -EINVAL. This patch fixes
the problem and updates test cases to cover such scenario.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-12-02 11:29:35 +01:00
Anas Nashif ba7d730e9b tests/samples: use integration_plaforms in more tests/samples
integration_platforms help us control what get built/executed in CI and
for each PR submitted. They do not filter out platforms, instead they
just minimize the amount of builds/testing for a particular
tests/sample.
Tests still run on all supported platforms when not in integration mode.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-11-29 16:03:23 +01:00
Anas Nashif 808266a493 tests: use ignore_fault field instead of tags
Use dedicated field in the yaml file instead of mixing this testing
feature with tags.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-11-25 06:38:05 -05:00
Gerard Marull-Paretas 9f509f5b11 tests: lib: linear_range: add coverage
Add coverage for the linear_range API.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-11-24 10:16:03 +01:00
Pieter De Gendt 5710f609c9 tests: devicetree: add tests for DT_GPARENT/DT_INST_GPARENT
Add some coverage for the DT_GPARENT/DT_INST_GPARENT macros.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2022-11-17 10:18:11 -06:00
Francois Ramu e7a071f43c tests: lib: cmis_dsp transform requires more than 128KB of RAM
Increase the min ram configuration when running the
libraries.cmsis_dsp.transform.cf64 testcase of the
tests/lib/cmsis_dsp/transform/
Fixes https://github.com/zephyrproject-rtos/zephyr/issues/52284

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-11-17 11:17:53 +01:00
Stephanos Ioannidis 3bdbc3f8a4 tests: cmsis_dsp: transform: Remove MPS2 AN521 from intg. platforms
This commit removes the `mps2_an521_remote` board from the integration
platform list of the CMSIS-DSP transform tests because this board no
longer has a sufficient code memory (FLASH) to fit these tests after
the resizing done in the PR #52052 for TF-M compatibility.

Consider adding `mps2_an386` as an integration platform for these tests
once the support for it is added to Zephyr (refer to the issue #45319).

Signed-off-by: Stephanos Ioannidis <stephanos.ioannidis@nordicsemi.no>
2022-11-09 23:20:06 +09:00
Keith Packard f35f44147f tests/sprintf: Enable picolibc float I/O
When built with picolibc, this test requires float I/O support

Signed-off-by: Keith Packard <keithp@keithp.com>
2022-11-08 10:44:36 +01:00
Keith Packard e7ec39434b tests/cbprintf_package: Use minimal libc for long double tests
These tests fail because picolibc and cbprintf_package generate slightly
different results.

Signed-off-by: Keith Packard <keithp@keithp.com>
2022-11-08 10:44:36 +01:00
Francois Ramu b5d235022a tests: lib: cmsis_dsp testcases with min ram for execution
Since the new  CONFIG_ZTEST_NEW_API the ram fr execution
must be adjusted (higher)
to avoid buffer allocation failure s with some target board.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-11-03 09:07:20 +00:00
Kumar Gala ab02bbc965 tests: lib: p4workq: Convert CONFIG_MP_NUM_CPUS handling
Move runtime checks to use arch_num_cpus() and build checks
to use CONFIG_MP_MAX_NUM_CPUS.  This is to allow runtime
determination of the number of CPUs in the future.

Signed-off-by: Kumar Gala <kumar.gala@intel.com>
2022-10-31 17:08:34 +01:00
Evgeniy Paltsev ac76c27af8 tests: arc: enable previously disabled tests on ARCv3 64bit platforms
Enable all cbprintf / logging related tests which were previously
disabled for qemu_arc_hs6x.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Evgeniy Paltsev <PaltsevEvgeniy@gmail.com>
2022-10-31 11:22:12 +01:00
Kumar Gala a1195ae39b smp: Move for loops to use arch_num_cpus instead of CONFIG_MP_NUM_CPUS
Change for loops of the form:

for (i = 0; i < CONFIG_MP_NUM_CPUS; i++)
   ...

to

unsigned int num_cpus = arch_num_cpus();
for (i = 0; i < num_cpus; i++)
   ...

We do the call outside of the for loop so that it only happens once,
rather than on every iteration.

Signed-off-by: Kumar Gala <kumar.gala@intel.com>
2022-10-21 13:14:58 +02:00
Stephanos Ioannidis 30c5e0222b tests: cmsis_dsp: MVE correlate out-of-bounds access workaround
The MVE `arm_correlate_f32` and `arm_correlate_q31` implementations may
write to negative indices of the output buffer (refer to the upstream
CMSIS-DSP bug ARM-software/CMSIS-DSP#59).

This commit adds a workaround for the above bug by overallocating the
output buffer memory and offsetting the output buffer supplied to the
function.

Revert this commit when this bug is fixed.

Signed-off-by: Stephanos Ioannidis <stephanos.ioannidis@nordicsemi.no>
2022-10-20 22:12:42 +09:00
Kumar Gala 4f0166088c tests: move to using CONFIG_MP_MAX_NUM_CPUS
For tests that set CONFIG_MP_NUM_CPUS, switch to using
CONFIG_MP_MAX_NUM_CPUS instead as we work to phase out
CONFIG_MP_NUM_CPUS.

Signed-off-by: Kumar Gala <kumar.gala@intel.com>
2022-10-20 22:04:10 +09:00
Stephanos Ioannidis 9dd570f8a2 tests: Remove explicit newlib nano override
This commit removes explicit `CONFIG_NEWLIB_LIBC_NANO=n` overrides
because the newlib nano variant is no longer enabled by default when
it is available.

Signed-off-by: Stephanos Ioannidis <stephanos.ioannidis@nordicsemi.no>
2022-10-19 16:02:51 +02:00
Jamie McCrae 6798f447d5 tests: devicetree: device: Add bl5340 and bt610 exclusions
Adds bt610 and bl5340_dvk_cpuapp* targets to exclusion list for tests
as these boards enabled i2c by default for GPIO usage which conflicts
with the test.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2022-10-19 10:46:53 +02:00
Stephanos Ioannidis 44be5c941a tests: cmsis_dsp: Remove invalid mps3_an547 integration platform spec
This commit removes the `mps3_an547` board from the integration
platform list for the tests whose minimum flash size requirement exceed
the size of the flash available on the board.

Signed-off-by: Stephanos Ioannidis <stephanos.ioannidis@nordicsemi.no>
2022-10-18 17:52:48 +09:00
Maureen Helm 03c8deb599 devicetree: Add model name helpers based on compat
Follow up to e1e16640b5 adding model name
helpers to access generated macros based on a compatible's matching
entries in vendor prefixes.

Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2022-10-07 11:48:02 -07:00
Anas Nashif a5bd666f4e lib: notify: build sys-notify conditionally.
Add a new Kconfig and build this code conditionally, so we do not end up
with this file being built for each zephyr app.

Partial fix for #50654

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-10-03 10:18:15 +02:00
Anas Nashif a81b322828 lib: onoff: add a config for on-off and build conditionally
Do not build this service unconditionally.

Partial fix of #50654

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-10-03 10:18:15 +02:00
Gerard Marull-Paretas b8f9d8add7 tests: devicetree: cover DT(_INST)_FOREACH_PROP_ELEM_SEP(_VARGS)
Add coverage for DT(_INST)_FOREACH_PROP_ELEM_SEP(_VARGS).

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-10-03 10:11:18 +02:00
Andrei Emeltchenko 2e56f955db trivial: Remove empty files
Remove empty files.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2022-09-30 09:41:55 +00:00
Andrei Emeltchenko 1d879b93c5 trivial: tests: Remove empty file
Remove empty file.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2022-09-29 13:41:18 -05:00
Anas Nashif 215159c6ff tests: mem_blocks: remove board configs using dma logging
This is no longer needed and currently generating a fault with this
backend. Using the ztest delay fixes the issue and produces the complete
console output.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-09-26 10:53:43 +00:00
Zhao Shuai b15e64569c tests: lib: add a tag to uniquely identify mem_blocks test
To identify mem_blocks test uniquely.

Signed-off-by: Zhao Shuai <shuai1x.zhao@intel.com>
2022-09-26 08:11:13 +00:00
Henri Xavier 1a276d0ac6 ring_buffer: Introduce RING_BUF_ITEM_SIZEOF
Currently, to compute the 'item' size in a ring buffer, we have
`SIZE32_OF`.

Several issues with this:
- `SIZE32_OF` only works on variables, not types, due to an extra
 parenthesis pair. Indeed, `sizeof((int))` is not valid C, whereas
 `sizeof((my_var))` is.
- `SIZE32_OF` is not a proper public API
- `SIZE32_OF` rounds down if the argument size is not a multiple
 of 4 bytes.

Thus, we introduce a proper `RING_BUF_ITEM_SIZEOF`, fixing the
aforementioned issues.

Signed-off-by: Henri Xavier <datacomos@huawei.com>
2022-09-20 09:08:14 +00:00
Krzysztof Chruscinski a7224830ce lib: os: cbprintf: Mechanism for detecting %p in static package
Static packaging is using only argument types to build a package. There
is one case where analysing argument type only is not enough to
determine package content. That is %p with (unsigned) char pointer vs
%s. In case of %s a string might need to be appended to the package
and in case of %p it must be avoided. Format string analysis is required
to distinguish those two cases.
In order to speed up the runtime inspection, additional information is
added to a static package. That is index of the string argument (where
first argument has index 0). This information allows quick format string
inspection where nth format specifier is found and checked if it is a
pointer format specifier.
Inspection algorithm is added to cbprintf_package_convert() and if %p
is found then data for that argument is discarded. Additionally, log
warning is printed with suggestion to cast pointer argument to void *
to avoid confusion. It is desired to get rid of this ambiguity because
there are going to be logging configurations where strings are stripped
from a binary and runtime inspection cannot be performed.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2022-09-19 10:14:23 +00:00
Enjia Mai ca5d698563 tests: lib: move the cmsis_dsp transform test to new ztest API
Migrate the testsuite tests/lib/cmsis_dsp/transform to the new
ztest API.

Signed-off-by: Enjia Mai <enjia.mai@intel.com>
2022-09-14 07:22:09 -04:00
Enjia Mai ccb3927233 tests: lib: move the cmsis_dsp matrix test to new ztest API
Migrate the testsuite tests/lib/cmsis_dsp/matrix to the new
ztest API.

Signed-off-by: Enjia Mai <enjia.mai@intel.com>
2022-09-14 07:22:09 -04:00
Enjia Mai 26b816cb5a tests: lib: move the cmsis_dsp filtering test to new ztest API
Migrate the testsuite tests/lib/cmsis_dsp/filtering to the new
ztest API.

Signed-off-by: Enjia Mai <enjia.mai@intel.com>
2022-09-14 07:22:09 -04:00
Enjia Mai 082e598f84 tests: lib: move the cmsis_dsp interpolation test to new ztest API
Migrate the testsuite tests/lib/cmsis_dsp/interpolation to the new
ztest API.

Signed-off-by: Enjia Mai <enjia.mai@intel.com>
2022-09-14 07:22:09 -04:00
Enjia Mai 63105256f7 tests: lib: move the cmsis_dsp statistics test to new ztest API
Migrate the testsuite tests/lib/cmsis_dsp/statistics to the new
ztest API.

Signed-off-by: Enjia Mai <enjia.mai@intel.com>
2022-09-14 07:22:09 -04:00
Enjia Mai 3e2fe17fa8 tests: lib: move the cmsis_dsp support test to new ztest API
Migrate the testsuite tests/lib/cmsis_dsp/support to the new
ztest API.

Signed-off-by: Enjia Mai <enjia.mai@intel.com>
2022-09-14 07:22:09 -04:00
Daniel Leung db9d83fbb8 tests: devicetree: add bits to test multi-bus nodes
This adds a few bits to the devicetree API tests for multi-bus
nodes where a bus can support multiple protocols. This uses
I3C as basis as I3C controller can support both I2C and I3C on
the same bus, while I2C controller cannot support both. So
this needs to make sure the correct bus macros are generated
if appropriate (and not generated if not needed).

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-09-09 17:42:33 -04:00
Michał Barnaś 1ea41b34c6 ztest: improve some tests
This commit changes some tests from using zassert_equal to validate
the pointers to using the zassert_is_null and zassert_not_null.

Signed-off-by: Michał Barnaś <mb@semihalf.com>
2022-09-09 07:05:38 -04:00
Michał Barnaś dae8efa692 ztest: remove the obsolete NULL appended to zassert macros
This commit removes the usage of NULL parameter as message in
zassert_* macros after making it optional

Signed-off-by: Michał Barnaś <mb@semihalf.com>
2022-09-09 07:05:38 -04:00
Gerard Marull-Paretas 3732bbfa12 tests: devicetree: add tests for DT_CHILD/DT_INST_CHILD
Add some coverage for the DT_CHILD/DT_INST_CHILD macros.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-09-06 08:45:25 -07:00
Dominik Ermel d5810693ea tests: lib: gui: lvgl: Switch to FIXED_PARTITION_ macros
The commit switches flash area access from FLASH_AREA_ macros
to FIXED_PARTITION_ macros and to usage of DTS node labels,
to identify partitions, instead of label property.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2022-09-06 09:56:37 +02:00
Gerard Marull-Paretas 79e6b0e0f6 includes: prefer <zephyr/kernel.h> over <zephyr/zephyr.h>
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>
2022-09-05 16:31:47 +02:00
Maureen Helm e1e16640b5 devicetree: Add vendor name helpers based on vendor prefixes
Adds vendor name helpers to access generated macros based on matching
entries in the vendor prefixes file.

Signed-off-by: Maureen Helm <maureen.helm@intel.com>
2022-09-01 14:53:55 -07:00