1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/tests
2019-12-06 21:18:21 +01:00
..
bench_msg_pingpong tests: insufficient mem. atmega328p based boards 2019-11-27 15:07:43 +01:00
bench_mutex_pingpong tests: insufficient mem. atmega328p based boards 2019-11-27 15:07:43 +01:00
bench_runtime_coreapis
bench_sched_nop
bench_sizeof_coretypes
bench_thread_flags_pingpong tests: insufficient mem. atmega328p based boards 2019-11-27 15:07:43 +01:00
bench_thread_yield_pingpong tests: insufficient mem. atmega328p based boards 2019-11-27 15:07:43 +01:00
bench_timers tests/bench_timers: fix typos 2019-11-23 22:39:36 +01:00
bitarithm_timings flake8: fix PEP8 W608 invalid escape sequence 2019-11-22 11:47:49 +01:00
blob
bloom_bytes tests: add test_utils_interactive_sync when possible 2019-11-27 15:07:42 +01:00
board_calliope-mini
board_microbit
build_system_cflags_spaces
build_system_utils
buttons
c11_atomics_cpp_compat
can_trx
cb_mux
cb_mux_bench flake8: fix PEP8 W608 invalid escape sequence 2019-11-22 11:47:49 +01:00
cond_order tests: add test_utils_interactive_sync when possible 2019-11-27 15:07:42 +01:00
conn_can tests/conn_can: Edit README 2019-11-27 13:35:57 +01:00
cortexm_common_ldscript tests/cortexm_common_ldscript: fix typos 2019-11-23 22:39:36 +01:00
cpp11_condition_variable
cpp11_mutex
cpp11_thread
cpp_ctors tests/cpp_ctors: remove avsextrem & msba2 from blacklist 2019-11-29 12:13:21 +01:00
cpu_cortexm_address_check
cpu_efm32_features
devfs
driver_ad7746
driver_adcxx1c
driver_ads101x
driver_adt7310
driver_adxl345
driver_apa102
driver_at
driver_at30tse75x
driver_at86rf2xx
driver_ata8520e
driver_bh1750
driver_bmp180
driver_bmx055
driver_bmx280 tests/driver_bmx280: add Makefile.ci 2019-11-22 14:04:38 +01:00
driver_cc110x boards/derfmega*: initial support 2019-11-27 20:53:14 +01:00
driver_ccs811
driver_ccs811_full
driver_dcf77
driver_dht
driver_ds18
driver_ds75lx
driver_ds1307 tests: insufficient mem. atmega328p based boards 2019-11-27 15:07:43 +01:00
driver_ds3234
driver_dsp0401 tests/driver_dsp0401: fix typos 2019-11-23 22:39:36 +01:00
driver_dynamixel
driver_enc28j60 boards/derfmega*: initial support 2019-11-27 20:53:14 +01:00
driver_encx24j600
driver_feetech
driver_fxos8700
driver_grove_ledbar
driver_hd44780 tests/driver_hd44780: disable CI for esp32-wroom-32 2019-12-06 12:42:51 +01:00
driver_hdc1000
driver_hih6130
driver_hts221
driver_ina2xx drivers/ina2xx: Match RIOT's driver design goals 2019-11-22 20:28:57 +01:00
driver_ina3221
driver_io1_xplained tests/driver_io1_xplained: fix typos 2019-11-23 22:39:36 +01:00
driver_isl29020
driver_isl29125
driver_jc42
driver_kw2xrf test/kw2xrf: use fmt_is_number() 2019-12-05 15:39:24 +01:00
driver_l3g4200d
driver_lc709203f Merge pull request #12628 from aabadie/pr/make/develhelp_cleanup 2019-11-28 09:26:52 +01:00
driver_lis2dh12 many typo fixes 2019-11-23 22:39:07 +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
driver_mpl3115a2
driver_mpu9x50
driver_mpu9150
driver_mq3
driver_my9221
driver_nrf24l01p_lowlevel
driver_nrfmin tests: add test_utils_interactive_sync when possible 2019-11-27 15:07:42 +01:00
driver_nvram_spi
driver_opt3001
driver_pca9685 tests: insufficient mem. atmega328p based boards 2019-11-27 15:07:43 +01:00
driver_pcd8544
driver_ph_oem
driver_pir
driver_pn532
driver_pulse_counter
driver_qmc5883l
driver_rn2xx3
driver_sdcard_spi
driver_sds011 many typo fixes 2019-11-23 22:39:07 +01:00
driver_servo
driver_sht1x
driver_sht2x
driver_sht3x
driver_si70xx
driver_si114x
driver_soft_spi
driver_srf02
driver_srf04
driver_srf08 many typo fixes 2019-11-23 22:39:07 +01:00
driver_sx127x
driver_tcs37727
driver_tmp00x
driver_tps6274x many typo fixes 2019-11-23 22:39:07 +01:00
driver_tsl2561
driver_tsl4531x
driver_vcnl40x0
driver_veml6070
driver_ws281x
driver_xbee
eepreg
emb6
embunit
event_wait_timeout
events
evtimer_msg
evtimer_underflow
external_module_dirs
fault_handler
float tests: add test_utils_interactive_sync when possible 2019-11-27 15:07:42 +01:00
fmt_print
gnrc_gomach
gnrc_ipv6_ext tests/gnrc_ipv6_ext: move board specific deps in Makefile.board.dep 2019-12-06 21:18:21 +01:00
gnrc_ipv6_ext_frag Merge pull request #12799 from chudov/derfmega-PR 2019-11-28 13:57:56 +01:00
gnrc_ipv6_fwd_w_sub
gnrc_ipv6_nib
gnrc_ipv6_nib_6ln
gnrc_lwmac
gnrc_mac_timeout
gnrc_ndp tests/gnrc_ndp: add z1 to insufficient memory 2019-11-27 15:07:43 +01:00
gnrc_netif tests/gnrc_netif: Adapt test to new interface names 2019-11-29 10:22:00 +01:00
gnrc_netif_ieee802154 tests: expect match \r\n or \s 2019-11-27 14:12:12 +01:00
gnrc_rpl_srh Merge pull request #12799 from chudov/derfmega-PR 2019-11-28 13:57:56 +01:00
gnrc_sixlowpan
gnrc_sixlowpan_frag tests/gnrc_sixlowpan_frag: check packet buffer in test_rbuf_rm_by_dg 2019-11-29 15:35:55 +01:00
gnrc_sock_dns Merge pull request #12799 from chudov/derfmega-PR 2019-11-28 13:57:56 +01:00
gnrc_sock_ip many typo fixes 2019-11-23 22:39:07 +01:00
gnrc_sock_neterr
gnrc_sock_udp many typo fixes 2019-11-23 22:39:07 +01:00
gnrc_tcp Merge pull request #12799 from chudov/derfmega-PR 2019-11-28 13:57:56 +01:00
gnrc_udp boards/derfmega*: initial support 2019-11-27 20:53:14 +01:00
heap_cmd tests: add test_utils_interactive_sync when possible 2019-11-27 15:07:42 +01:00
irq
isr_yield_higher tests/isr_yield_higher: Make use of US_PER_MS 2019-11-22 23:29:13 +01:00
kconfig tests: Add Kconfig test application 2019-12-04 15:23:52 +01:00
l2util
leds
libc_newlib tests/libc_newlib: fix typos 2019-11-23 22:39:36 +01:00
log_color
log_printfnoformat
lua_loader tests/lua_loader: fix typos 2019-11-23 22:39:36 +01:00
lwip Merge pull request #12822 from fjmolinas/pr_fix_eol 2019-11-28 08:01:30 +01:00
lwip_sock_ip Merge pull request #12822 from fjmolinas/pr_fix_eol 2019-11-28 08:01:30 +01:00
lwip_sock_tcp Merge pull request #12822 from fjmolinas/pr_fix_eol 2019-11-28 08:01:30 +01:00
lwip_sock_udp Merge pull request #12822 from fjmolinas/pr_fix_eol 2019-11-28 08:01:30 +01:00
malloc tests/malloc: fix test regexp to consider whole line 2019-11-27 10:41:33 +01:00
mcuboot
memarray tests/memarray: add automatic test script 2019-11-28 08:47:57 +01:00
minimal Merge pull request #10741 from basilfx/feature/stdio_null 2019-12-03 18:08:26 +01:00
mpu_stack_guard
msg_avail tests: add test_utils_interactive_sync when possible 2019-11-27 15:07:42 +01:00
msg_send_receive
msg_try_receive tests: insufficient mem. atmega328p based boards 2019-11-27 15:07:43 +01:00
mtd_flashpage tests/mtd_flashpage: adapt test for msp430 2019-11-24 13:19:20 +01:00
mutex_order flake8: fix PEP8 W608 invalid escape sequence 2019-11-22 11:47:49 +01:00
mutex_unlock_and_sleep tests: add test_utils_interactive_sync when possible 2019-11-27 15:07:42 +01:00
nanocoap_cli
netdev_test tests: add test_utils_interactive_sync when possible 2019-11-27 15:07:42 +01:00
netstats_l2 tests/netstat_l2: add esp8266 boards to BOARD_PROVIDES_NETIF 2019-11-23 14:26:37 +01:00
nhdp
nimble_autoconn_ccnl
nimble_autoconn_gnrc
nimble_l2cap
nimble_l2cap_server
nordic_softdevice tests: add test_utils_interactive_sync when possible 2019-11-27 15:07:42 +01:00
od
periph_adc tests/periph_adc: fix content printf on failure 2019-11-28 09:07:52 +01:00
periph_backup_ram tests/periph_backup_ram: disable test_utils_interactive_sync 2019-12-05 22:44:46 +01:00
periph_cpuid tests: expect match \r\n or \s 2019-11-27 14:12:12 +01:00
periph_dac
periph_dma
periph_eeprom
periph_flashpage Merge pull request #11960 from fjmolinas/pr_msp430_flashpage_raw 2019-11-25 12:48:48 +01:00
periph_gpio
periph_gpio_arduino
periph_hwrng
periph_i2c
periph_pm tests/periph_pm: use button as a wake-up source 2019-12-04 16:18:16 +01:00
periph_pwm
periph_qdec
periph_rtc
periph_rtt tests: add test_utils_interactive_sync when possible 2019-11-27 15:07:42 +01:00
periph_spi
periph_timer tests: expect match \r\n or \s 2019-11-27 14:12:12 +01:00
periph_timer_short_relative_set tests/periph_timer_short_relative_set: fix diff calculation for non 32 bit timers 2019-12-02 11:28:26 +01:00
periph_uart
periph_uart_mode
periph_uart_nonblocking tests/periph_uart_nonblocking: add simple test application 2019-11-28 09:26:58 +01:00
periph_wdt Merge pull request #12822 from fjmolinas/pr_fix_eol 2019-11-28 08:01:30 +01:00
pipe tests/pipe: cleanup application 2019-11-23 15:06:54 +01:00
pkg_c25519 flake8: fix PEP8 F632 use ==/!= 2019-11-22 11:47:49 +01:00
pkg_cayenne-lpp
pkg_cifra
pkg_cmsis-dsp
pkg_cn-cbor
pkg_fatfs many typo fixes 2019-11-23 22:39:07 +01:00
pkg_fatfs_vfs many typo fixes 2019-11-23 22:39:07 +01:00
pkg_hacl flake8: fix PEP8 W608 invalid escape sequence 2019-11-22 11:47:49 +01:00
pkg_heatshrink flake8: fix PEP8 W608 invalid escape sequence 2019-11-22 11:47:49 +01:00
pkg_jsmn tests/pkg_jsmn: don't use '%.*s' string formatter 2019-11-23 20:57:19 +01:00
pkg_libb2 boards/derfmega*: initial support 2019-11-27 20:53:14 +01:00
pkg_libcoap
pkg_libcose flake8: fix PEP8 F632 use ==/!= 2019-11-22 11:47:49 +01:00
pkg_libfixmath Merge pull request #12822 from fjmolinas/pr_fix_eol 2019-11-28 08:01:30 +01:00
pkg_libfixmath_unittests
pkg_libhydrogen
pkg_littlefs
pkg_lora-serialization
pkg_micro-ecc tests/pkg_micro-ecc: Cleanup and AVR fixes 2019-11-25 16:36:23 +01:00
pkg_micro-ecc-with-hwrng
pkg_microcoap boards/derfmega*: initial support 2019-11-27 20:53:14 +01:00
pkg_minmea
pkg_monocypher
pkg_nanocbor
pkg_nanopb
pkg_oonf_api
pkg_qdsa flake8: fix PEP8 W608 invalid escape sequence 2019-11-22 11:47:49 +01:00
pkg_relic boards/derfmega*: initial support 2019-11-27 20:53:14 +01:00
pkg_semtech-loramac many typo fixes 2019-11-23 22:39:07 +01:00
pkg_spiffs
pkg_tiny-asn1 tests/pkg_tiny-asn1: fix typos 2019-11-23 22:39:36 +01:00
pkg_tinycbor
pkg_tinycrypt tests/pkg_tinycrypt: fix typos 2019-11-23 22:39:36 +01:00
pkg_tweetnacl boards/derfmega*: initial support 2019-11-27 20:53:14 +01:00
pkg_u8g2 tests/pkg_u8g2: fix typos 2019-11-23 22:39:36 +01:00
pkg_ubasic
pkg_ucglib tests/pkg_ucglib: fix typos 2019-11-23 22:39:37 +01:00
pkg_umorse
pkg_wolfcrypt-ed25519-verify
pkg_wolfssl
posix_semaphore tests: add test_utils_interactive_sync when possible 2019-11-27 15:07:42 +01:00
posix_time tests: add test_utils_interactive_sync when possible 2019-11-27 15:07:42 +01:00
progress_bar tests/progress_bar: add test application 2019-12-02 16:48:16 +01:00
ps_schedstatistics tests/ps_schedstatistics: improve automatic test script 2019-11-28 08:31:11 +01:00
pthread
pthread_barrier tests: expect match \r\n or \s 2019-11-27 14:12:12 +01:00
pthread_cleanup
pthread_condition_variable tests: insufficient mem. atmega328p based boards 2019-11-27 15:07:43 +01:00
pthread_cooperation boards/derfmega*: initial support 2019-11-27 20:53:14 +01:00
pthread_flood
pthread_rwlock
pthread_tls tests/pthread_tls: fix typos 2019-11-23 22:39:37 +01:00
puf_sram tests/puf_sram: add newline in printf 2019-11-25 02:08:59 +01:00
riotboot tests/riotboot: add shell_commands 2019-12-02 17:27:35 +01:00
riotboot_flashwrite
riotboot_hdr
rmutex flake8: fix PEP8 W608 invalid escape sequence 2019-11-22 11:47:49 +01:00
rmutex_cpp flake8: fix PEP8 W608 invalid escape sequence 2019-11-22 11:47:49 +01:00
rng many typo fixes 2019-11-23 22:39:07 +01:00
saul
sched_testing
shell tests: add test_utils_interactive_sync when possible 2019-11-27 15:07:42 +01:00
slip
sntp boards/derfmega*: initial support 2019-11-27 20:53:14 +01:00
socket_zep Merge pull request #12628 from aabadie/pr/make/develhelp_cleanup 2019-11-28 09:26:52 +01:00
ssp tests/ssp: warning stringop-overflow has to be disabled 2019-11-22 13:56:41 +01:00
stdin tests/stdin: refactor test application 2019-12-05 12:27:00 +01:00
struct_tm_utility tests: add test_utils_interactive_sync when possible 2019-11-27 15:07:42 +01:00
sys_arduino
sys_arduino_analog
sys_arduino_lib tests/sys_arduino_lib: demo the use of Arduino library 2019-11-22 13:26:35 +01:00
sys_crypto tests/crypto: remove useless BOARD_BLACKLIST 2019-11-22 19:21:06 +01:00
sys_irq_handler tests/sys_irq_handler: fix typos 2019-11-23 22:39:37 +01:00
test_tools
thread_basic tests: add test_utils_interactive_sync when possible 2019-11-27 15:07:42 +01:00
thread_cooperation tests: add test_utils_interactive_sync when possible 2019-11-27 15:07:42 +01:00
thread_exit tests: add test_utils_interactive_sync when possible 2019-11-27 15:07:42 +01:00
thread_flags
thread_flags_xtimer
thread_float
thread_flood tests: add test_utils_interactive_sync when possible 2019-11-27 15:07:42 +01:00
thread_msg tests: add test_utils_interactive_sync when possible 2019-11-27 15:07:42 +01:00
thread_msg_block_race tests: add test_utils_interactive_sync when possible 2019-11-27 15:07:42 +01:00
thread_msg_block_w_queue tests: insufficient mem. atmega328p based boards 2019-11-27 15:07:43 +01:00
thread_msg_block_wo_queue tests: insufficient mem. atmega328p based boards 2019-11-27 15:07:43 +01:00
thread_msg_seq tests: add test_utils_interactive_sync when possible 2019-11-27 15:07:42 +01:00
thread_priority_inversion tests/thread_priority_inversion: fix typos 2019-11-23 22:39:37 +01:00
thread_race tests: add test_utils_interactive_sync when possible 2019-11-27 15:07:42 +01:00
trace tests: expect match \r\n or \s 2019-11-27 14:12:12 +01:00
trickle
unittests unittests: add tests for fmt_is_x() functions 2019-12-05 15:39:24 +01:00
usbus
usbus_cdc_acm_stdio
usbus_cdc_ecm
warn_conflict many typo fixes 2019-11-23 22:39:07 +01:00
xtimer_drift
xtimer_hang many typo fixes 2019-11-23 22:39:07 +01:00
xtimer_longterm
xtimer_msg
xtimer_msg_receive_timeout
xtimer_mutex_lock_timeout many typo fixes 2019-11-23 22:39:07 +01:00
xtimer_now64_continuity flake8: fix PEP8 W608 invalid escape sequence 2019-11-22 11:47:49 +01:00
xtimer_periodic_wakeup
xtimer_remove
xtimer_reset
xtimer_usleep tests: add test_utils_interactive_sync when possible 2019-11-27 15:07:42 +01:00
xtimer_usleep_short
Makefile.tests_common tests: add test_utils_interactive_sync when possible 2019-11-27 15:07:42 +01:00
README.md Merge pull request #12824 from fjmolinas/pr_pexpect_doc 2019-11-27 18:52:09 +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+) ,')

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