Commit Graph

1805 Commits

Author SHA1 Message Date
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
Hu Zhenyu
3cef8e68df tests: drivers: disk: Replace the MAX function with if and else
As the parameter of "MAX" is uint32, the nagetive number will be
bigger than 0. The MAX function does not work as expected. So
change it to if/else form.

Fixes #51146

Signed-off-by: Hu Zhenyu <zhenyu.hu@intel.com>
2022-10-18 21:11:21 -04:00
Francois Ramu
31afbf7902 tests: drivers: eeprom testing on stm32 platforms
Add the testcase for running the test of the
stm32 eeprom driver on stm32 platforms like the nucleo_l152re
or nucleo_l073rz boards.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-10-17 14:41:01 +09:00
Martin Jäger
2fd5cbdaf4 tests: drivers: can: api: add twai build-test for esp32c3
The TWAI peripheral needs a connected CAN transceiver also for testing
in loopback mode.

As there is no board available with this configuration, at least make
sure the CAN API test is built in CI for esp32c3_devkitm.

Signed-off-by: Martin Jäger <martin@libre.solar>
2022-10-14 09:55:09 +02:00
Manuel Arguelles
2c62966621 tests: gpio: add overlays for s32z270dc2_r52 boards
Enable testing of GPIO driver minimal API's on s32z270dc2_r52 boards.
These boards do not have built-in user LED, therefore a GPIO pin is used
instead.

Signed-off-by: Manuel Arguelles <manuel.arguelles@nxp.com>
2022-10-14 09:51:14 +02:00
Gerard Marull-Paretas
6a0f554ffa include: add missing kernel.h include
Some files make use of Kernel APIs without including kernel.h, fix this
problem.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-10-11 18:05:17 +02:00
Maciej Perkowski
9018338863 tests: drivers: flash: Fix nrf_qspi_nor_4B_addr requirements
The test requires external memory connected but it was not
reflected in the yaml decription. Therefore, the test was failing
instead of being skipped. It is the same story as with #47241

Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
2022-10-04 19:16:37 +00:00
Lucas Tamborrino
9bfa83f441 tests: drivers: spi loopback test for DMA on ESP32C3
Add SPI DMA test mode.

Signed-off-by: Lucas Tamborrino <lucas.tamborrino@espressif.com>
2022-10-04 10:35:14 +02:00
Lucas Tamborrino
af47b9b34b tests: drivers: spi loopback test for DMA on ESP32/S2
Add SPI DMA test mode.

Signed-off-by: Lucas Tamborrino <lucas.tamborrino@espressif.com>
2022-10-04 10:35:14 +02:00
TOKITA Hiroshi
6bbd2b2d06 tests: drivers: watchdog: Add support for GD32 SoCs
Enable watchdog tests for boards that implement GD32 SoC.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2022-10-03 18:07:16 +02:00
Andriy Gelman
072a428f78 drivers: flash: Add xmc4xxx flash drivers
Add xmc4xxx flash drivers.

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
2022-10-03 13:56:49 +02:00
Josia Strack
ba7eb1025a drivers: gpio: Add driver for pcf8574
Adds a driver for pcf8574 via i2c.

Signed-off-by: Josia Strack <josia.strack@ithinx.io>
2022-10-03 13:56:32 +02:00
Martin Jäger
9cec058e8e boards: posix: native_posix: enable can_loopback0 by default
The .yaml file states that CAN is supported, but the basic sample
application samples/drivers/can/counter cannot be compiled without
additional configuration.

The loopback driver does not require any additional steps like the
linux SocketCAN driver, so it is safe to enable it by default and
get rid of the many overlay files in the tests.

ISO-TP tests and the counter sample are excluded via .yaml from
twister tests because of timing issues.

Signed-off-by: Martin Jäger <martin@libre.solar>
2022-10-03 10:17:12 +02:00
Ryan Erickson
46045e6df0 tests: ADC API: Add support for MG100 board
MG100 board added to ADC API tests.

Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>
2022-10-03 10:11:28 +02:00
Ryan Erickson
a16fb03608 tests: modem: build_all: Add MG100 board exclusions
Add MG100 board to test exclusions where necessary.

Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>
2022-10-03 10:11:28 +02:00
Enjia Mai
cce22da0bc tests: drivers: pwm: move the pwm_loopback test to new ztest API
Migrate the testsuite tests/drivers/pwm/pwm_loopback to the new
ztest API.

Signed-off-by: Enjia Mai <enjia.mai@intel.com>
2022-10-03 10:10:15 +02:00
Enjia Mai
08a7b3e421 tests: drivers: pwm: move the pwm api test to new ztest API
Migrate the testsuite tests/drivers/pwm/pwm_api to the new
ztest API.

Signed-off-by: Enjia Mai <enjia.mai@intel.com>
2022-10-03 10:10:15 +02:00
Ederson de Souza
edd524b4e3 drivers/mm: Add API to query memory regions
Some systems may need to query the available memory regions in runtime.
For those, this patch adds a simple API that memory management drivers
can implement to provide such discovery.

A small test also added to exercise the default, empty implementation.

Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
2022-10-01 14:52:29 -04:00
Henrik Brix Andersen
707fa6a1f6 tests: drivers: can: api: skip RTR tests if not supported
Skip the Remote Transmission Request (RTR) frame tests if the CAN
controller driver does not support RTR filters.

Fixes: #50218

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-09-21 08:50:47 +00:00
Sylvio Alves
7891bed6e7 tests: counter: add esp32 test case
Adds only ESP32 board test case.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2022-09-19 18:37:28 +02:00
Enjia Mai
4c9faf95ef tests: driver: gpio: fix the incorrect testsuite names
There are some erros in previous ztest API migration of
the gpio_basic_api tests. Fix the incorrect testsuite
name of the callback mgmt and vari tests.

Fixes: #49953

Signed-off-by: Enjia Mai <enjia.mai@intel.com>
2022-09-19 09:34:36 +00:00
Hu Zhenyu
9fd919a466 tests: drivers: i2s: i2s_speed: move to new ztest API
Move drivers i2s_speed tests to use new ztest API

Signed-off-by: Hu Zhenyu <zhenyu.hu@intel.com>
2022-09-16 08:35:36 +00:00
Hake Huang
0d4ff38fa2 tests: adc-dma: fix the dma dest address check failure
force the dma destintion address 32 bit aligned

fixing: #49792

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2022-09-15 14:16:48 -05:00
Lauren Murphy
85445474f2 boards, dts: fix filenames and dts refs for adsp clock
Changes filenames and DTS references from CAVS clock to
ADSP clock.

Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
2022-09-14 07:23:08 -04:00
Francois Ramu
5aedd860f5 tests: drivers: adc stm32wb and stm32l5 start on channel1
Start testing adc_api on channel 1
for stm32w55 nucleo and stm32l562 disco boards
since the VREFINT on channel 0

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-09-14 09:30:43 +00:00
Henrik Brix Andersen
b4af14600a tests: drivers: can: shell: add tests for start/stop shell commands
Add tests for the CAN controller start/stop shell commands.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-09-13 16:06:50 +00:00
Henrik Brix Andersen
6cdb418e5d tests: drivers: can: fd: test returned error codes when started/stopped
Add tests for the required error return codes when the CAN controller is
started/stopped.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-09-13 16:06:50 +00:00
Henrik Brix Andersen
94d37023c6 tests: drivers: can: api: test returned error codes when started/stopped
Add tests for the required error return codes when the CAN controller is
started/stopped.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-09-13 16:06:50 +00:00
Henrik Brix Andersen
180cdc105e drivers: can: add start and stop CAN controller API functions
Up until now, the Zephyr CAN controller drivers set a default bitrate (or
timing) specified via devicetree and start the CAN controller in their
respective driver initialization functions.

This is fine for CAN nodes using only one fixed bitrate, but if the bitrate
is set by the user (e.g. via a DIP-switch or other HMI which is very
common), the CAN driver will still initialise with the default
bitrate/timing at boot and use this until the application has determined
the requested bitrate/timing and set it using
can_set_bitrate()/can_set_timing().

During this period, the CAN node will potentially destroy valid CAN frames
on the CAN bus (which is using the soon-to-be-set-by-the-application
bitrate) by sending error frames. This causes interruptions to the ongoing
CAN bus traffic when a Zephyr-based CAN node connected to the bus is
(re-)booted.

Instead, require all configuration (setting bitrate, timing, or mode) to
take place when the CAN controller is stopped. This maps nicely to entering
"reset mode" (called "configuration mode" or "freeze mode" for some CAN
controller implementations) when stopping and exiting this mode when
starting the CAN controller.

Fixes: #45304

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-09-13 16:06:50 +00:00
Henrik Brix Andersen
6d094d0ad5 tests: drivers: can: api: add missing test case documentation
Add missing CAN controller API test case documentation.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-09-13 16:06:50 +00:00
Thomas Stranger
1c411cc7f0 tests: drviers: remove superfluous source files
During rebase two test main source files, that were removed during the
transition to the new ztest api, were accidetally added again.

First Removed in #49509 and #49554.
This commit removes them again.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2022-09-12 10:54:18 +00:00
Hu Zhenyu
0d0f2e94a2 tests: counter_basic_api will return pass even if no counter is found
In test_all_instances(), if ARRAY_SIZE(devices) is 0, the test is not
performed. At this time, the test result should be TC_FAIL, instead of
TC_PASS. A zassert is needed to filter this case.
Fixes: #45647

Signed-off-by: Hu Zhenyu <zhenyu.hu@intel.com>
2022-09-09 16:32:07 -04:00
Hu Zhenyu
d366334568 tests: drivers: kscan: move to new ztest API
Move drivers kscan tests to use new ztest API

Signed-off-by: Hu Zhenyu <zhenyu.hu@intel.com>
2022-09-09 16:24:20 -04:00
Enjia Mai
aee3a2189b tests: drivers: move the espi test to new ztest API
Migrate the testsuite tests/drivers/espi to the new
ztest API.

Signed-off-by: Enjia Mai <enjia.mai@intel.com>
2022-09-09 16:14:07 -04:00
Gerson Fernando Budke
b5f65f201d boards: arm: stm32l562e_dk_ns: Add flash partitions
The current stm32l562_dk_ns has no flash partitions defined. This add
flash partitions following partition sizes that are compatible with
the TF-M platform defined at flash_layout.h and removes the redundant
overlays board files.

Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
2022-09-09 16:40:20 +00:00
Thomas Stranger
604a405308 tests/drivers/w1: add ds2485 overlay and configuration
Adds the ds2485 driver overlay and a test configuration
for it.

Signed-off-by: Thomas Stranger <thomas.stranger@outlook.com>
2022-09-09 14:11:30 +00: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
Enjia Mai
4b90e788f6 tests: drivers: dac: move the dac loopback test to new ztest API
Migrate the testsuite tests/drivers/dac/dac_loopback to the new
ztest API.

Signed-off-by: Enjia Mai <enjia.mai@intel.com>
2022-09-08 15:29:51 +00:00
Enjia Mai
40e44a4b3e tests: drivers: dac: move the dac api test to new ztest API
Migrate the testsuite tests/drivers/dac/dac_api to the new
ztest API.

Signed-off-by: Enjia Mai <enjia.mai@intel.com>
2022-09-08 15:29:51 +00:00
Enjia Mai
87abb27021 tests: drivers: uart: move the uart basic tests to new ztest API
Migrate the testsuite tests/drivers/uart/uart_basic_api to the
new ztest API.

Signed-off-by: Enjia Mai <enjia.mai@intel.com>
2022-09-08 15:25:52 +00:00
Enjia Mai
4ec2258f06 tests: drivers: uart: move the uart PM tests to new ztest API
Migrate the testsuite tests/drivers/uart/uart_pm to the
new ztest API.

Signed-off-by: Enjia Mai <enjia.mai@intel.com>
2022-09-08 15:25:52 +00:00
Enjia Mai
d40b1356e9 tests: drivers: uart: move the uart mix tests to new ztest API
Migrate the testsuite tests/drivers/uart/uart_mix_fifo_poll to the
new ztest API.

Signed-off-by: Enjia Mai <enjia.mai@intel.com>
2022-09-08 15:25:52 +00:00
Enjia Mai
8995a58702 tests: drivers: uart: move the uart async tests to new ztest API
Migrate the testsuite tests/drivers/uart/uart_async_api to the
new ztest API.

Signed-off-by: Enjia Mai <enjia.mai@intel.com>
2022-09-08 15:25:52 +00:00
Pierre Marzin
a05c827063 boards: h3ulcb: Add support of pwm0
Declare pw0 channel0 that can be used on H3ULCB (test pin CP8).
Add support status to H3ULCB board documentation.
PWM0 is disabled by default as its usage could consume uneeded
power.
Only enable it into the test API with overlay.

Signed-off-by: Pierre Marzin <pierre.marzin@iot.bzh>
2022-09-07 15:50:49 +02:00
Francois Ramu
735921fa68 tests: drivers: flash on stm32l475 requires higher stack size
Increasing the stack size to pass the
tests/drivers/flash testcase on the disco_l475_iot1 disco kit.
Note that CONFIG_MPU_ALLOW_FLASH_WRITE is set.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-09-07 15:38:08 +02:00
Francois Ramu
6205866143 tests: drivers: flash driver for the non-secure stm32u5 board
this commit adds an overlay to run the tests/drivers/flash
on the b_u585i_iot02a_ns target platform.
It renames the non-secure partition to slot1_ns_partition
to match the testcases.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-09-07 15:38:08 +02:00
Kevin Wang
82785ca48f tests: drivers: spi: spi_loopback: Add board's overlay
Add child node in spi node for testcase parsing compatible

Signed-off-by: Kevin Wang <yunkai@andestech.com>
2022-09-07 15:34:47 +02:00
Francois Ramu
45cffd79a9 tests/drivers/spi: loopback testing on the stm32u5x spi with DMA
Adds the dma transfer for the SPI loopback test
for the b_u585i_iot02a disco kit and nuceo_u575zi_q.
GPDMA1 is the DMA instance
Connect pins on the target board D11 <--> D12 of the CN13

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2022-09-07 15:34:35 +02:00
Hu Zhenyu
99ab3fba54 tests: Change the result compare method in pin_get_config()
Fixes #47921
When setting a GPIO to certain value, and then get the GPIO value, on some
platforms, such as ITE, these two values may not be the same. For example
setting GPIO_OUTPUT | GPIO_OUTPUT_INT_HIGH, it will read back
GPIO_OUTPUT | GPIO_OUTPUT_INT_HIGH | GPIO_VOLTAGE_3P3. This is as expected,
as GPIO_VOLTAGE is a read only property. So when comparing the gpio set
and get values, it is necessary to filter the read only bits first and
then compare to the set value.

Signed-off-by: Hu Zhenyu <zhenyu.hu@intel.com>
2022-09-07 15:34:28 +02:00
TOKITA Hiroshi
32735c992a tests: drivers: adc: Add support for rpi_pico
Add support for rpi_pico board to adc_api test.

At this time, twister couldn't with rpi_pico board,
Test it built with west and checked the console output.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@fujitsu.com>
2022-09-06 17:11:19 +02:00