1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/tests
2020-03-12 18:04:42 +01:00
..
bench_msg_pingpong
bench_mutex_pingpong
bench_runtime_coreapis
bench_sched_nop
bench_sizeof_coretypes
bench_thread_flags_pingpong
bench_thread_yield_pingpong
bench_timers tests/bench_timers: fix NDEBUG compile problem 2020-03-12 17:40:46 +01:00
bench_xtimer tests/bench_xtimer: fix NDEBUG compile problem 2020-03-12 17:40:46 +01:00
bench_xtimer_load tests/bench_xtimer_load: initial commit 2020-02-11 15:49:23 +01:00
bitarithm_timings
blob
bloom_bytes tests: remove uneeded DISABLE_MODULE+=auto_init 2020-02-12 16:51:34 +01:00
board_calliope-mini
board_microbit
build_system_cflags_spaces
build_system_utils
buttons
c11_atomics_cpp_compat tests/c11_atomics_cpp_compat: don't disable auto_init 2020-03-06 15:20:25 +01:00
can_trx
candev test/candev: add candev test app with native support 2020-03-10 18:13:15 +01:00
cb_mux
cb_mux_bench
cond_order
conn_can tests/conn_can: make auto_init_can explicit 2020-03-10 18:12:37 +01:00
cortexm_common_ldscript
cpp11_condition_variable tests/cpp11_condition_variable: fix NDEBUG compile problem 2020-03-12 17:40:46 +01:00
cpp11_mutex
cpp11_thread
cpp_ctors tests: remove uneeded DISABLE_MODULE+=auto_init 2020-02-12 16:51:34 +01:00
cpp_exclude
cpp_ext
cpu_cortexm_address_check
cpu_efm32_features
devfs
disp_dev tests/sys_disp_dev: add disp_dev test application 2020-03-03 10:25:55 +01:00
driver_ad7746
driver_adcxx1c
driver_ads101x tests: replace SLEEP define 2019-10-10 10:47:38 +02:00
driver_adt7310
driver_adxl345
driver_apa102
driver_apds99xx tests: add APDS99XX ALS and proximity 2020-03-11 14:21:47 +01:00
driver_apds99xx_full tests: add APDS99XX ALS and proximity 2020-03-11 14:21:47 +01:00
driver_at
driver_at24cxxx tests/driver_at24cxxx: test for at24cxxx EEPROM 2020-02-24 14:00:25 +01:00
driver_at24mac tests: add test for at24mac driver 2020-02-13 15:58:43 +01:00
driver_at30tse75x
driver_at86rf2xx tests: remove uneeded DISABLE_MODULE+=auto_init 2020-02-12 16:51:34 +01:00
driver_ata8520e
driver_bh1750
driver_bh1900nux Add bh1900nux driver 2020-02-12 07:34:22 +01:00
driver_bmp180
driver_bmx055
driver_bmx280
driver_cc110x tests/driver_cc110x: exclude hifive1* boards 2020-01-11 17:30:19 +01:00
driver_ccs811
driver_ccs811_full
driver_dcf77
driver_dht
driver_ds18 drivers/ds18: add arduino-nano to BOARD_WHITELIST in ds18 driver test 2020-02-07 12:55:43 +03:00
driver_ds75lx
driver_ds1307
driver_ds3234
driver_dsp0401
driver_dynamixel
driver_enc28j60
driver_encx24j600
driver_feetech
driver_fxos8700
driver_grove_ledbar
driver_hd44780
driver_hdc1000
driver_hih6130
driver_hts221
driver_ili9341 tests/driver_ili9341: enable backlight on PineTime 2020-01-14 21:06:43 +01:00
driver_ina2xx
driver_ina3221 tests/driver_ina3221: add missing stdio.h include 2020-01-11 13:32:01 +01:00
driver_io1_xplained
driver_isl29020
driver_isl29125
driver_itg320x tests: add driver for ITG320X 3-axis gyroscope 2020-01-11 08:02:34 +01:00
driver_jc42
driver_kw2xrf
driver_l3g4200d
driver_lc709203f
driver_lis2dh12 drivers/lis2dh12: added interrupt function 2020-03-04 17:01:58 +01:00
driver_lis3dh
driver_lis3mdl
driver_lpd8808
driver_lpsxxx
driver_lsm6dsl
driver_lsm303dlhc
driver_ltc4150
driver_mag3110
driver_mma8x5x
driver_mma7660
driver_motor_driver tests/driver_motor_driver: fix NDEBUG compile problem 2020-03-12 17:44:41 +01:00
driver_mpl3115a2
driver_mpu9x50
driver_mpu9150
driver_mq3
driver_my9221
driver_nrf24l01p_lowlevel
driver_nrfmin
driver_nvram_spi
driver_opt3001
driver_pca9685
driver_pcd8544
driver_ph_oem tests/driver_ph_oem: add missing stdio.h include 2020-01-11 17:28:12 +01:00
driver_pir
driver_pn532
driver_pulse_counter
driver_qmc5883l
driver_rn2xx3
driver_sdcard_spi
driver_sds011
driver_servo
driver_sht1x
driver_sht2x
driver_sht3x
driver_shtc1 Driver/shtc1: add saul integration 2019-12-16 15:29:04 +01:00
driver_si70xx
driver_si114x
driver_soft_spi
driver_sps30 tests: add test application for Sensirion SPS30 sensor driver 2020-02-20 14:26:55 +01:00
driver_srf02
driver_srf04
driver_srf08 tests/driver_srf08: update with new init scheme 2020-02-25 21:24:02 +01:00
driver_stmpe811 tests/driver_stmpe811: add test application 2020-02-13 09:14:51 +01:00
driver_sx127x tests: fix enumeration type usage in driver_sx127x 2020-03-09 13:53:57 +01:00
driver_tcs37727
driver_tmp00x
driver_tps6274x
driver_tsl2561
driver_tsl4531x
driver_vcnl40x0
driver_veml6070
driver_ws281x tests/driver_ws281x: resolve weird feature dependencies 2020-02-11 16:03:21 +01:00
driver_xbee
eepreg
emb6
embunit tests/embunit: fix NDEBUG compile problem 2020-03-12 18:04:42 +01:00
emcute tests: provide tests for emcute 2020-02-19 17:28:20 +01:00
event_threads tests/event_threads: remove arch_arm7 from blacklist 2020-02-11 15:39:34 +01:00
event_wait_timeout tests/event_wait_timeout: test 64-bit variant 2020-02-13 16:18:32 +01:00
events tests/events: fix NDEBUG compile problem 2020-03-12 18:04:42 +01:00
evtimer_msg
evtimer_underflow
external_board_native tests/external_board_native: require arch_native 2019-12-30 17:15:08 +01:00
external_module_dirs
fault_handler
float tests: remove uneeded DISABLE_MODULE+=auto_init 2020-02-12 16:51:34 +01:00
fmt_print
frac-config
gnrc_dhcpv6_client tests: add dhcpv6_client test application 2020-01-16 12:36:10 +01:00
gnrc_dhcpv6_client_6lbr boards/olimexino-stm32: add support for olimexino-stm32 board 2020-03-11 10:59:57 +01:00
gnrc_gomach
gnrc_ipv6_ext tests/gnrc_*: remove useless BOARD_BLACKLIST 2020-01-14 07:48:08 +01:00
gnrc_ipv6_ext_frag tests/gnrc_ipv6_ext_frag: fix NDEBUG compile problem 2020-03-12 18:04:42 +01:00
gnrc_ipv6_fwd_w_sub tests/gnrc_ipv6_fwd_w_sub: fix NDEBUG compile problem 2020-03-12 18:04:42 +01:00
gnrc_ipv6_nib tests/gnrc_ipv6_nib: fix NDEBUG compile problem 2020-03-12 18:04:42 +01:00
gnrc_ipv6_nib_6ln tests/gnrc_ipv6_nib_6ln: fix NDEBUG compile problem 2020-03-12 18:04:42 +01:00
gnrc_lwmac
gnrc_mac_timeout
gnrc_ndp
gnrc_netif tests/gnrc_netif: fix NDEBUG compile problem 2020-03-12 18:04:42 +01:00
gnrc_netif_ieee802154
gnrc_rpl_p2p tests: add simple compile test for gnrc_rpl_p2p 2020-02-19 22:54:09 +01:00
gnrc_rpl_srh tests/gnrc_*: remove useless BOARD_BLACKLIST 2020-01-14 07:48:08 +01:00
gnrc_sixlowpan tests/gnrc_sixlowpan: fix NDEBUG compile problem 2020-03-12 18:04:42 +01:00
gnrc_sixlowpan_frag tests: remove uneeded DISABLE_MODULE+=auto_init 2020-02-12 16:51:34 +01:00
gnrc_sixlowpan_iphc_w_vrb tests/gnrc_sixlowpan_iphc_w_vrb: fix NDEBUG compile problem 2020-03-12 18:04:42 +01:00
gnrc_sock_async_event tests/gnrc_sock_async_event: fix NDEBUG compile problem 2020-03-12 18:04:42 +01:00
gnrc_sock_dns tests/gnrc_sock_dns: add a message queue 2020-02-22 00:18:01 +01:00
gnrc_sock_ip tests/gnrc_sock_ip: fix NDEBUG compile problem 2020-03-12 18:04:42 +01:00
gnrc_sock_neterr
gnrc_sock_udp tests/gnrc_sock_udp: fix NDEBUG compile problem 2020-03-12 18:04:42 +01:00
gnrc_tcp gnrc_tcp: Add Endpoints for connection specification 2020-02-26 21:24:06 +01:00
gnrc_udp
heap_cmd
irq tests/irq: remove USEMODULE += auto_init 2020-03-06 15:15:38 +01:00
isr_yield_higher
kconfig
l2util
leds
libc_newlib
log_color
log_printfnoformat
lua_loader tests/lua_loader: cleanup Python test script 2020-01-08 09:46:09 +01:00
lwip lwip: amend for async callback argument 2020-03-11 16:54:13 +01:00
lwip_sock_ip drivers/netdev: use netdev_trigger_event_isr function 2020-03-06 14:03:43 +01:00
lwip_sock_tcp tests: remove uneeded DISABLE_MODULE+=auto_init 2020-02-12 16:51:34 +01:00
lwip_sock_udp drivers/netdev: use netdev_trigger_event_isr function 2020-03-06 14:03:43 +01:00
malloc
mcuboot
memarray memarray: fix memarray init 2020-03-09 17:56:34 +01:00
minimal
mpu_noexec_ram tests/mpu_noexec_ram: convert to an automated test 2020-03-10 11:16:22 +01:00
mpu_stack_guard tests/mpu_stack_guard: update Makefile.ci 2020-03-03 22:58:21 +01:00
msg_avail tests: remove uneeded DISABLE_MODULE+=auto_init 2020-02-12 16:51:34 +01:00
msg_send_receive
msg_try_receive
mtd_flashpage
mtd_mapper mtd_mapper: add test 2020-03-04 10:47:54 +01:00
mutex_order
mutex_unlock_and_sleep tests: remove uneeded DISABLE_MODULE+=auto_init 2020-02-12 16:51:34 +01:00
nanocoap_cli net/gnrc/netif: Move GNRC_NETIF_IPV6_ADDRS_NUMOF to 'CONFIG_' namespace 2020-01-13 12:28:37 +01:00
netdev_test Merge pull request #13579 from jia200x/pr/gnrc_netif_send 2020-03-06 20:07:45 +01:00
netstats_l2
nimble_autoconn_ccnl
nimble_autoconn_gnrc
nimble_l2cap tests/nimble_l2cap: fix type passing AD to bluetil 2019-12-16 16:00:36 +01:00
nimble_l2cap_server
nordic_softdevice tests/nordic_softdevice: disable CI testing 2020-03-04 14:15:17 +01:00
od
periph_adc
periph_backup_ram
periph_cpuid
periph_dac
periph_dma
periph_eeprom
periph_flashpage
periph_gpio
periph_gpio_arduino
periph_hwrng
periph_i2c
periph_pm
periph_pwm
periph_qdec
periph_rtc tests/periph_rtc: don't set time in the past 2020-03-03 11:01:02 +01:00
periph_rtt tests/periph_rtt: only disable periph_init_rtt 2020-03-06 11:21:28 +01:00
periph_spi tests: add stm32f030f4-demo to Makefile.ci 2019-10-21 15:33:11 +02:00
periph_timer boards: add kw41z-mini 2020-02-27 21:34:04 -06:00
periph_timer_short_relative_set
periph_uart tests/periph_uart: fix shell buffer size 2020-01-31 13:57:08 +01:00
periph_uart_mode
periph_uart_nonblocking
periph_wdt Merge pull request #13152 from miri64/shell_commands/enh/version 2020-03-11 18:36:43 +01:00
phydat_dump tests: add phydat dump test 2020-02-29 12:36:55 +01:00
pipe
pkg_c25519
pkg_cayenne-lpp
pkg_cifra
pkg_cmsis-dsp tests/pkg_cmsis-dsp: cleanup Python test script 2020-01-08 09:43:16 +01:00
pkg_cmsis-nn tests/pkg_cmsis-nn: add cifar10 example application 2020-02-14 16:23:41 +01:00
pkg_cn-cbor
pkg_cryptoauthlib_compare_sha256 tests: add pkg_cryptoauthlib_compare_sha256 2020-01-30 23:51:48 +01:00
pkg_cryptoauthlib_internal-tests tests/pkg_cryptoauthlib_internal: add unsupported device handling 2020-02-06 15:09:38 +01:00
pkg_fatfs
pkg_fatfs_vfs
pkg_flatbuffers tests/pkg_flattbuffers: add sample application 2020-01-13 09:41:23 +01:00
pkg_hacl
pkg_heatshrink
pkg_jsmn
pkg_libb2
pkg_libcoap
pkg_libcose
pkg_libfixmath
pkg_libfixmath_unittests test/libfixmath: remove use of export for LINKFLAGS 2020-01-02 09:52:30 +01:00
pkg_libhydrogen
pkg_littlefs
pkg_littlefs2 tests/littlefs2: Add test for LittleFS v2.x.y 2020-02-20 14:51:45 +01:00
pkg_lora-serialization
pkg_micro-ecc
pkg_micro-ecc-with-hwrng
pkg_microcoap
pkg_minmea
pkg_monocypher
pkg_nanocbor
pkg_nanopb
pkg_qcbor add QCBOR package 2020-03-09 20:29:50 +01:00
pkg_qdsa
pkg_relic pkg/relic: use random module for seeding relic PRNG 2020-02-06 21:11:39 +01:00
pkg_semtech-loramac tests/pkg_semtech_loramac: fix i-nucleo-lrwan1 board name 2020-01-19 15:11:31 +01:00
pkg_spiffs
pkg_tensorflow-lite tests/pkg_tensorflow-lite: exclude boards with too few memory 2020-01-14 22:23:08 +01:00
pkg_tiny-asn1
pkg_tinycbor
pkg_tinycrypt
pkg_tweetnacl
pkg_u8g2 tests/pkg_u8g2: update tests 2020-01-14 13:23:25 +01:00
pkg_ubasic
pkg_ucglib
pkg_umorse
pkg_utensor boards/olimexino-stm32: add support for olimexino-stm32 board 2020-03-11 10:59:57 +01:00
pkg_wolfcrypt-ed25519-verify
pkg_wolfssl
posix_semaphore tests: remove uneeded DISABLE_MODULE+=auto_init 2020-02-12 16:51:34 +01:00
posix_time
progress_bar
ps_schedstatistics
pthread
pthread_barrier
pthread_cleanup
pthread_condition_variable
pthread_cooperation
pthread_flood
pthread_rwlock
pthread_tls
puf_sram tests/puf_sram: disable interactive sync 2020-01-20 14:14:25 +01:00
riotboot
riotboot_flashwrite
riotboot_hdr
rmutex
rmutex_cpp
rng tests/rng: reflecting xtimer's member change 2020-01-10 10:07:56 -08:00
saul
sched_testing
shell tests: remove uneeded DISABLE_MODULE+=auto_init 2020-02-12 16:51:34 +01:00
slip
sntp
socket_zep tests: remove uneeded DISABLE_MODULE+=auto_init 2020-02-12 16:51:34 +01:00
ssp Add CPU feature for stack smash protections 2020-01-22 15:59:02 +01:00
stdin
struct_tm_utility tests: remove uneeded DISABLE_MODULE+=auto_init 2020-02-12 16:51:34 +01:00
sys_arduino tests/sys_arduino: fix test synchronization issues 2020-01-15 10:05:46 +01:00
sys_arduino_analog
sys_arduino_lib
sys_crypto tests/crypto*: use crypto_% modules instead of CFLAGS 2020-03-06 19:49:58 +01:00
sys_irq_handler
test_tools
thread_basic tests: remove uneeded DISABLE_MODULE+=auto_init 2020-02-12 16:51:34 +01:00
thread_cooperation tests: remove uneeded DISABLE_MODULE+=auto_init 2020-02-12 16:51:34 +01:00
thread_exit tests: remove uneeded DISABLE_MODULE+=auto_init 2020-02-12 16:51:34 +01:00
thread_flags tests/thread_flags: add call to set_timeout_flag64 2020-02-13 15:37:30 +01:00
thread_flags_xtimer
thread_float
thread_flood tests: remove uneeded DISABLE_MODULE+=auto_init 2020-02-12 16:51:34 +01:00
thread_msg tests: remove uneeded DISABLE_MODULE+=auto_init 2020-02-12 16:51:34 +01:00
thread_msg_block_race tests: remove uneeded DISABLE_MODULE+=auto_init 2020-02-12 16:51:34 +01:00
thread_msg_block_w_queue tests: remove uneeded DISABLE_MODULE+=auto_init 2020-02-12 16:51:34 +01:00
thread_msg_block_wo_queue tests: remove uneeded DISABLE_MODULE+=auto_init 2020-02-12 16:51:34 +01:00
thread_msg_seq tests: remove uneeded DISABLE_MODULE+=auto_init 2020-02-12 16:51:34 +01:00
thread_priority_inversion
thread_race tests: remove uneeded DISABLE_MODULE+=auto_init 2020-02-12 16:51:34 +01:00
thread_zombie tests: remove uneeded DISABLE_MODULE+=auto_init 2020-02-12 16:51:34 +01:00
trace
trickle
unittests tests/unittests/tests-gnrc_ipv6: fix NDEBUG compile problem 2020-03-12 17:40:46 +01:00
usbus tests/usbus: Default to RIOT peripheral PID 2020-01-14 11:27:12 +01:00
usbus_cdc_acm_stdio Merge pull request #12402 from ant9000/pr/usbus_cdc_acm_stdio_fix 2020-01-15 19:52:13 +01:00
usbus_cdc_ecm tests/usbus_cdc_ecm: Default to RIOT peripheral PID 2020-01-14 11:24:16 +01:00
vfs_plus_stdio tests: provide test for vfs+fmt corner-case 2019-12-18 14:15:40 +01:00
warn_conflict
xtimer_drift tests/xtimer_drift: ztimer_xtimer_compat fix 2020-03-04 12:44:03 +01:00
xtimer_hang
xtimer_longterm
xtimer_msg
xtimer_msg_receive_timeout
xtimer_mutex_lock_timeout tests/xtimer_mutex_lock_timeout: minimal xtimer_mutex_lock_timeout test 2020-03-05 18:45:28 +01:00
xtimer_now64_continuity
xtimer_periodic_wakeup
xtimer_remove
xtimer_reset
xtimer_usleep
xtimer_usleep_short
ztimer_msg tests: add ztimer test applications 2020-03-04 12:44:02 +01:00
ztimer_overhead tests/ztimer_overhead: update to use signed ztimer_overhead() 2020-03-10 12:23:33 +01:00
Makefile.tests_common tests/Makefile.tests_common: interactive_sync only with testrunner 2020-01-19 20:38:39 +01:00
README.md tests/README.md: add paragraph explaining expect() 2020-02-24 11:45:33 +01:00

Running and creating tests

There are a number of tests included in RIOT. They are located in the tests folder. These tests allow basic functionality to be verified as well as provide an example of usage.

Implementing automated tests

The goal is to be able to run all tests in a sequential way for as many targets as possible.

As some board can't be reset without a manual trigger tests should be implemented with some kind of synchronization. This can be done in two ways:

  • use test_utils_interactive_sync when uart input/output does not need to be disabled for the test. This is enabled by default.
  • set up the test in a loop so the test script will be able so sync with some kind of start condition in the test.

The module for the first option is test_utils_interactive_sync and is set as a default module in Makefile.tests_common. It can be disabled by setting in the application makefile DISABLE_MODULE += test_utils_interactive_sync. The python test script will adapt to it automatically.

Running automated tests

Some tests can be performed automatically. The test automation scripts are defined in the <test_application>/tests/ folder. They are written in python and interact through the uart with the test application code running on a board to do the validation. It is recommended to flash the board with the test just before running it because some platforms cannot be reset while testing.

From the test application directory run:

BOARD=<board_of_your_choice> make flash test

An automated way of knowing if a test is available is to execute the 'test/available' target from the test application directory. It executes without error if tests run by 'make test' are present.

make test/available

Automated Tests Guidelines

When using pexpect $ is useless for matching the end of a line, instead use \r\n(pexpect end-of-line).

Beware of + and * at the end of patterns. These patterns will always get a minimal match (non-greedy).(pexpect end-of-patterns) This can be an issue when matching groups and using the matched groups to verify some kind of behavior since * could return an empty match and + only a subset.

This is especially prevalent since printf() is buffered so the output might not arrive in a single read to pexpect.

To avoid this make sure to match a non-ambiguous character at the end of the pattern like \r\n, \s, \), etc..

don't:

    child.expect(r'some string: (\d+)')

do:

    child.expect(r'some string: (\d+)\r\n')
    child.expect(r'some string: (\d+)\s')
    child.expect(r'some string: (\d+) ,')

Use expect() instead of assert()

In order to make a test application functional in all cases, use expect() instead of assert(). The former works like the latter, but will still be compiled in if NDEBUG is defined. This is useful to keep a test application working even when compiling with -DNDEBUG, allowing for the code-under-test to be compiled with that flag. Otherwise, the application would force compiling all tested code with assertions enabled. expect() is defined in the header test_utils/expect.h.

Interaction through the uart

Tests implemented with testrunner use the cleanterm target that provides an interaction without adding extra text output or input handling. It can currently be expected to have unmodified line based interaction with the board.

The expected behavior is verified with the test in tests/test_tools.

Tests cannot rely on having on all boards and terminal programs:

  • unbuffered input
  • allowing sending special characters like ctrl+c/ctrl+d