tests: add test_utils_interactive_sync when possible
- Define test_utils_interactive_sync as DEFAULT_MODULE in Makefile.tests_common - For tests disabling autoinit, add test_utils_interactive_sync to main - Add DISABLE_MODULE += test_utils_interactive_sync for tests requiring sudo, `tests/shell`, `tests/minimal` and `tests/stdin` - Add shell_commands to tests/periph_wdt and tests/struct_tm_utility to pull `r` and `s` commands - Remove includes and usage in `tests/main.c` for tests that where already using test_utils_interactive_sync
This commit is contained in:
parent
eb9cb198a0
commit
416c048737
@ -1,4 +1,7 @@
|
|||||||
APPLICATION ?= tests_$(notdir $(patsubst %/,%,$(CURDIR)))
|
APPLICATION ?= tests_$(notdir $(patsubst %/,%,$(CURDIR)))
|
||||||
|
|
||||||
|
DEFAULT_MODULE += test_utils_interactive_sync
|
||||||
|
|
||||||
ifneq (,$(filter tests_driver_%,$(APPLICATION)))
|
ifneq (,$(filter tests_driver_%,$(APPLICATION)))
|
||||||
BOARD ?= samr21-xpro
|
BOARD ?= samr21-xpro
|
||||||
endif
|
endif
|
||||||
|
|||||||
@ -22,6 +22,8 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
|
|
||||||
|
#include "test_utils/interactive_sync.h"
|
||||||
|
|
||||||
#include "xtimer.h"
|
#include "xtimer.h"
|
||||||
#include "fmt.h"
|
#include "fmt.h"
|
||||||
|
|
||||||
@ -63,6 +65,8 @@ int main(void)
|
|||||||
|
|
||||||
bloom_init(&bloom, BLOOM_BITS, bf, hashes, BLOOM_HASHF);
|
bloom_init(&bloom, BLOOM_BITS, bf, hashes, BLOOM_HASHF);
|
||||||
|
|
||||||
|
test_utils_interactive_sync();
|
||||||
|
|
||||||
printf("Testing Bloom filter.\n\n");
|
printf("Testing Bloom filter.\n\n");
|
||||||
printf("m: %" PRIu32 " k: %" PRIu32 "\n\n", (uint32_t) bloom.m,
|
printf("m: %" PRIu32 " k: %" PRIu32 "\n\n", (uint32_t) bloom.m,
|
||||||
(uint32_t) bloom.k);
|
(uint32_t) bloom.k);
|
||||||
|
|||||||
@ -24,7 +24,6 @@
|
|||||||
#include "cond.h"
|
#include "cond.h"
|
||||||
#include "mutex.h"
|
#include "mutex.h"
|
||||||
#include "thread.h"
|
#include "thread.h"
|
||||||
#include "test_utils/interactive_sync.h"
|
|
||||||
|
|
||||||
#define THREAD_NUMOF (5U)
|
#define THREAD_NUMOF (5U)
|
||||||
#define THREAD_FIRSTGROUP_NUMOF (3U)
|
#define THREAD_FIRSTGROUP_NUMOF (3U)
|
||||||
@ -63,8 +62,6 @@ int main(void)
|
|||||||
puts("Condition variable order test");
|
puts("Condition variable order test");
|
||||||
puts("Please refer to the README.md for more information\n");
|
puts("Please refer to the README.md for more information\n");
|
||||||
|
|
||||||
test_utils_interactive_sync();
|
|
||||||
|
|
||||||
mutex_init(&testlock);
|
mutex_init(&testlock);
|
||||||
cond_init(&testcond);
|
cond_init(&testcond);
|
||||||
|
|
||||||
|
|||||||
@ -10,8 +10,6 @@
|
|||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from testrunner import test_utils_interactive_sync
|
|
||||||
|
|
||||||
thread_prio = {
|
thread_prio = {
|
||||||
3: 6,
|
3: 6,
|
||||||
4: 4,
|
4: 4,
|
||||||
@ -23,7 +21,6 @@ first_group_size = 3
|
|||||||
|
|
||||||
|
|
||||||
def testfunc(child):
|
def testfunc(child):
|
||||||
test_utils_interactive_sync(child)
|
|
||||||
|
|
||||||
for k in thread_prio.keys():
|
for k in thread_prio.keys():
|
||||||
child.expect_exact("T{} (prio {}): waiting on condition variable now"
|
child.expect_exact("T{} (prio {}): waiting on condition variable now"
|
||||||
|
|||||||
@ -9,6 +9,7 @@
|
|||||||
#include "embUnit.h"
|
#include "embUnit.h"
|
||||||
#include "tests-cpp_ctors.h"
|
#include "tests-cpp_ctors.h"
|
||||||
#include "thread.h" /* For thread_getpid() */
|
#include "thread.h" /* For thread_getpid() */
|
||||||
|
#include "test_utils/interactive_sync.h"
|
||||||
|
|
||||||
long tests_cpp_ctors_global_value(void);
|
long tests_cpp_ctors_global_value(void);
|
||||||
long tests_cpp_ctors_static_value(void);
|
long tests_cpp_ctors_static_value(void);
|
||||||
@ -58,6 +59,8 @@ Test *tests_cpp_ctors_tests(void)
|
|||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
|
test_utils_interactive_sync();
|
||||||
|
|
||||||
TESTS_START();
|
TESTS_START();
|
||||||
TESTS_RUN(tests_cpp_ctors_tests());
|
TESTS_RUN(tests_cpp_ctors_tests());
|
||||||
TESTS_END();
|
TESTS_END();
|
||||||
|
|||||||
@ -5,7 +5,6 @@ from testrunner import run
|
|||||||
|
|
||||||
|
|
||||||
def testfunc(child):
|
def testfunc(child):
|
||||||
child.expect("All up, running the shell now")
|
|
||||||
child.sendline("ifconfig")
|
child.sendline("ifconfig")
|
||||||
child.expect(r"Iface\s+(\d+)\s+HWaddr:")
|
child.expect(r"Iface\s+(\d+)\s+HWaddr:")
|
||||||
|
|
||||||
|
|||||||
@ -23,6 +23,8 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
|
#include "test_utils/interactive_sync.h"
|
||||||
|
|
||||||
#include "board.h"
|
#include "board.h"
|
||||||
|
|
||||||
/* as default we run the test 100k times */
|
/* as default we run the test 100k times */
|
||||||
@ -34,6 +36,8 @@
|
|||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
|
test_utils_interactive_sync();
|
||||||
|
|
||||||
double x = 1234567.0 / 1024.0;
|
double x = 1234567.0 / 1024.0;
|
||||||
|
|
||||||
puts("Testing floating point arithmetic...\n");
|
puts("Testing floating point arithmetic...\n");
|
||||||
|
|||||||
@ -35,6 +35,8 @@ USEMODULE += shell
|
|||||||
USEMODULE += shell_commands
|
USEMODULE += shell_commands
|
||||||
USEMODULE += ps
|
USEMODULE += ps
|
||||||
|
|
||||||
|
DISABLE_MODULE += test_utils_interactive_sync
|
||||||
|
|
||||||
# The test requires some setup and to be run as root
|
# The test requires some setup and to be run as root
|
||||||
# So it cannot currently be run
|
# So it cannot currently be run
|
||||||
TEST_ON_CI_BLACKLIST += all
|
TEST_ON_CI_BLACKLIST += all
|
||||||
|
|||||||
@ -44,6 +44,8 @@ USEMODULE += shell
|
|||||||
USEMODULE += shell_commands
|
USEMODULE += shell_commands
|
||||||
USEMODULE += ps
|
USEMODULE += ps
|
||||||
|
|
||||||
|
DISABLE_MODULE += test_utils_interactive_sync
|
||||||
|
|
||||||
# The test requires some setup and to be run as root
|
# The test requires some setup and to be run as root
|
||||||
# So it cannot currently be run
|
# So it cannot currently be run
|
||||||
TEST_ON_CI_BLACKLIST += all
|
TEST_ON_CI_BLACKLIST += all
|
||||||
|
|||||||
@ -39,6 +39,8 @@ USEMODULE += shell
|
|||||||
USEMODULE += shell_commands
|
USEMODULE += shell_commands
|
||||||
USEMODULE += ps
|
USEMODULE += ps
|
||||||
|
|
||||||
|
DISABLE_MODULE += test_utils_interactive_sync
|
||||||
|
|
||||||
# The test requires some setup and to be run as root
|
# The test requires some setup and to be run as root
|
||||||
# So it cannot currently be run
|
# So it cannot currently be run
|
||||||
TEST_ON_CI_BLACKLIST += all
|
TEST_ON_CI_BLACKLIST += all
|
||||||
|
|||||||
@ -25,6 +25,8 @@
|
|||||||
#include "net/gnrc/sixlowpan/frag/rb.h"
|
#include "net/gnrc/sixlowpan/frag/rb.h"
|
||||||
#include "xtimer.h"
|
#include "xtimer.h"
|
||||||
|
|
||||||
|
#include "test_utils/interactive_sync.h"
|
||||||
|
|
||||||
#define TEST_NETIF_HDR_SRC { 0xb3, 0x47, 0x60, 0x49, \
|
#define TEST_NETIF_HDR_SRC { 0xb3, 0x47, 0x60, 0x49, \
|
||||||
0x78, 0xfe, 0x95, 0x48 }
|
0x78, 0xfe, 0x95, 0x48 }
|
||||||
#define TEST_NETIF_HDR_DST { 0xa4, 0xf2, 0xd2, 0xc9, \
|
#define TEST_NETIF_HDR_DST { 0xa4, 0xf2, 0xd2, 0xc9, \
|
||||||
@ -627,6 +629,8 @@ static void run_unittests(void)
|
|||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
|
test_utils_interactive_sync();
|
||||||
|
|
||||||
/* no auto-init, so xtimer needs to be initialized manually*/
|
/* no auto-init, so xtimer needs to be initialized manually*/
|
||||||
xtimer_init();
|
xtimer_init();
|
||||||
/* netreg requires queue, but queue size one should be enough for us */
|
/* netreg requires queue, but queue size one should be enough for us */
|
||||||
|
|||||||
@ -32,6 +32,8 @@ USEMODULE += shell_commands
|
|||||||
|
|
||||||
USEMODULE += posix_inet
|
USEMODULE += posix_inet
|
||||||
|
|
||||||
|
DISABLE_MODULE += test_utils_interactive_sync
|
||||||
|
|
||||||
LOW_MEMORY_BOARDS := nucleo-f334r8 msb-430 msb-430h
|
LOW_MEMORY_BOARDS := nucleo-f334r8 msb-430 msb-430h
|
||||||
|
|
||||||
ifeq ($(BOARD),$(filter $(BOARD),$(LOW_MEMORY_BOARDS)))
|
ifeq ($(BOARD),$(filter $(BOARD),$(LOW_MEMORY_BOARDS)))
|
||||||
|
|||||||
@ -39,6 +39,8 @@ USEMODULE += shell
|
|||||||
USEMODULE += shell_commands
|
USEMODULE += shell_commands
|
||||||
USEMODULE += od
|
USEMODULE += od
|
||||||
|
|
||||||
|
DISABLE_MODULE += test_utils_interactive_sync
|
||||||
|
|
||||||
# Export used tap device to environment
|
# Export used tap device to environment
|
||||||
export TAPDEV = $(TAP)
|
export TAPDEV = $(TAP)
|
||||||
|
|
||||||
|
|||||||
@ -12,7 +12,6 @@ from testrunner import run
|
|||||||
|
|
||||||
def testfunc(child):
|
def testfunc(child):
|
||||||
# check startup message
|
# check startup message
|
||||||
child.expect('Shell-based test application for heap functions.')
|
|
||||||
child.sendline('heap')
|
child.sendline('heap')
|
||||||
ret = child.expect([r'heap: \d+ \(used \d+, free \d+\) \[bytes\]', 'heap statistics are not supported'])
|
ret = child.expect([r'heap: \d+ \(used \d+, free \d+\) \[bytes\]', 'heap statistics are not supported'])
|
||||||
if ret == 1:
|
if ret == 1:
|
||||||
|
|||||||
@ -20,6 +20,8 @@ ifneq ($(BOARD),native)
|
|||||||
TESTS=
|
TESTS=
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
DISABLE_MODULE += test_utils_interactive_sync
|
||||||
|
|
||||||
# test fails on murdock and on my machine due to the process exiting directly
|
# test fails on murdock and on my machine due to the process exiting directly
|
||||||
TEST_ON_CI_BLACKLIST += all
|
TEST_ON_CI_BLACKLIST += all
|
||||||
|
|
||||||
|
|||||||
@ -22,6 +22,8 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#include "test_utils/interactive_sync.h"
|
||||||
|
|
||||||
#include "net/sock/ip.h"
|
#include "net/sock/ip.h"
|
||||||
#include "xtimer.h"
|
#include "xtimer.h"
|
||||||
|
|
||||||
@ -1081,6 +1083,8 @@ int main(void)
|
|||||||
{
|
{
|
||||||
uint8_t code = 0;
|
uint8_t code = 0;
|
||||||
|
|
||||||
|
test_utils_interactive_sync();
|
||||||
|
|
||||||
#ifdef SO_REUSE
|
#ifdef SO_REUSE
|
||||||
code |= 1;
|
code |= 1;
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -33,6 +33,8 @@
|
|||||||
#include "constants.h"
|
#include "constants.h"
|
||||||
#include "stack.h"
|
#include "stack.h"
|
||||||
|
|
||||||
|
#include "test_utils/interactive_sync.h"
|
||||||
|
|
||||||
#define _TEST_BUFFER_SIZE (128)
|
#define _TEST_BUFFER_SIZE (128)
|
||||||
#define _QUEUE_SIZE (1)
|
#define _QUEUE_SIZE (1)
|
||||||
|
|
||||||
@ -958,6 +960,8 @@ static void test_tcp_write6__success(void)
|
|||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
|
test_utils_interactive_sync();
|
||||||
|
|
||||||
uint8_t code = 0;
|
uint8_t code = 0;
|
||||||
|
|
||||||
#ifdef SO_REUSE
|
#ifdef SO_REUSE
|
||||||
|
|||||||
@ -28,6 +28,8 @@
|
|||||||
#include "constants.h"
|
#include "constants.h"
|
||||||
#include "stack.h"
|
#include "stack.h"
|
||||||
|
|
||||||
|
#include "test_utils/interactive_sync.h"
|
||||||
|
|
||||||
#define _TEST_BUFFER_SIZE (128)
|
#define _TEST_BUFFER_SIZE (128)
|
||||||
|
|
||||||
static uint8_t _test_buffer[_TEST_BUFFER_SIZE];
|
static uint8_t _test_buffer[_TEST_BUFFER_SIZE];
|
||||||
@ -1317,6 +1319,8 @@ static void test_sock_udp_send6__no_sock(void)
|
|||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
|
test_utils_interactive_sync();
|
||||||
|
|
||||||
uint8_t code = 0;
|
uint8_t code = 0;
|
||||||
|
|
||||||
#ifdef SO_REUSE
|
#ifdef SO_REUSE
|
||||||
|
|||||||
@ -4,5 +4,6 @@ include ../Makefile.tests_common
|
|||||||
CFLAGS += -DNDEBUG -DLOG_LEVEL=LOG_NONE
|
CFLAGS += -DNDEBUG -DLOG_LEVEL=LOG_NONE
|
||||||
|
|
||||||
DISABLE_MODULE += auto_init
|
DISABLE_MODULE += auto_init
|
||||||
|
DISABLE_MODULE += test_utils_interactive_sync
|
||||||
|
|
||||||
include $(RIOTBASE)/Makefile.include
|
include $(RIOTBASE)/Makefile.include
|
||||||
|
|||||||
@ -25,6 +25,7 @@
|
|||||||
|
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "msg.h"
|
#include "msg.h"
|
||||||
|
#include "test_utils/interactive_sync.h"
|
||||||
|
|
||||||
#define MSG_QUEUE_LENGTH (8)
|
#define MSG_QUEUE_LENGTH (8)
|
||||||
|
|
||||||
@ -32,11 +33,14 @@ msg_t msg_queue[MSG_QUEUE_LENGTH];
|
|||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
|
test_utils_interactive_sync();
|
||||||
|
|
||||||
msg_t msges[MSG_QUEUE_LENGTH];
|
msg_t msges[MSG_QUEUE_LENGTH];
|
||||||
|
|
||||||
msg_init_queue(msg_queue, MSG_QUEUE_LENGTH);
|
msg_init_queue(msg_queue, MSG_QUEUE_LENGTH);
|
||||||
|
|
||||||
puts("[START]");
|
puts("[START]");
|
||||||
|
|
||||||
/* add message to own queue */
|
/* add message to own queue */
|
||||||
for (int idx = 0; idx < MSG_QUEUE_LENGTH; ++idx) {
|
for (int idx = 0; idx < MSG_QUEUE_LENGTH; ++idx) {
|
||||||
msges[idx].type = idx;
|
msges[idx].type = idx;
|
||||||
|
|||||||
@ -22,6 +22,8 @@
|
|||||||
#include "thread.h"
|
#include "thread.h"
|
||||||
#include "mutex.h"
|
#include "mutex.h"
|
||||||
|
|
||||||
|
#include "test_utils/interactive_sync.h"
|
||||||
|
|
||||||
static mutex_t mutex = MUTEX_INIT;
|
static mutex_t mutex = MUTEX_INIT;
|
||||||
static volatile int indicator;
|
static volatile int indicator;
|
||||||
static kernel_pid_t main_pid;
|
static kernel_pid_t main_pid;
|
||||||
@ -47,6 +49,8 @@ static void *second_thread(void *arg)
|
|||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
|
test_utils_interactive_sync();
|
||||||
|
|
||||||
uint32_t count = 0;
|
uint32_t count = 0;
|
||||||
uint32_t kcount = 0;
|
uint32_t kcount = 0;
|
||||||
|
|
||||||
|
|||||||
@ -28,6 +28,8 @@
|
|||||||
#include "thread.h"
|
#include "thread.h"
|
||||||
#include "utlist.h"
|
#include "utlist.h"
|
||||||
|
|
||||||
|
#include "test_utils/interactive_sync.h"
|
||||||
|
|
||||||
#define _EXP_LENGTH (64)
|
#define _EXP_LENGTH (64)
|
||||||
|
|
||||||
#define _MAC_STACKSIZE (THREAD_STACKSIZE_DEFAULT + THREAD_EXTRA_STACKSIZE_PRINTF)
|
#define _MAC_STACKSIZE (THREAD_STACKSIZE_DEFAULT + THREAD_EXTRA_STACKSIZE_PRINTF)
|
||||||
@ -249,6 +251,8 @@ static int test_set_addr(void)
|
|||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
|
test_utils_interactive_sync();
|
||||||
|
|
||||||
/* initialization */
|
/* initialization */
|
||||||
gnrc_pktbuf_init();
|
gnrc_pktbuf_init();
|
||||||
msg_init_queue(_main_msg_queue, _MAIN_MSG_QUEUE_SIZE);
|
msg_init_queue(_main_msg_queue, _MAIN_MSG_QUEUE_SIZE);
|
||||||
|
|||||||
@ -6,7 +6,6 @@ from testrunner import run
|
|||||||
|
|
||||||
|
|
||||||
def testfunc(child):
|
def testfunc(child):
|
||||||
child.expect_exact("All up, running the shell now")
|
|
||||||
child.expect_exact(">")
|
child.expect_exact(">")
|
||||||
time.sleep(1) # Wait 1s to let some time for the interface to be fully ready
|
time.sleep(1) # Wait 1s to let some time for the interface to be fully ready
|
||||||
child.sendline("ifconfig")
|
child.sendline("ifconfig")
|
||||||
|
|||||||
@ -29,6 +29,8 @@
|
|||||||
#include "periph_conf.h"
|
#include "periph_conf.h"
|
||||||
#include "periph/rtt.h"
|
#include "periph/rtt.h"
|
||||||
|
|
||||||
|
#include "test_utils/interactive_sync.h"
|
||||||
|
|
||||||
#define TICKS_TO_WAIT (5 * RTT_FREQUENCY)
|
#define TICKS_TO_WAIT (5 * RTT_FREQUENCY)
|
||||||
|
|
||||||
static volatile uint32_t last;
|
static volatile uint32_t last;
|
||||||
@ -46,6 +48,8 @@ void cb(void *arg)
|
|||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
|
test_utils_interactive_sync();
|
||||||
|
|
||||||
puts("\nRIOT RTT low-level driver test");
|
puts("\nRIOT RTT low-level driver test");
|
||||||
puts("This test will display 'Hello' every 5 seconds\n");
|
puts("This test will display 'Hello' every 5 seconds\n");
|
||||||
|
|
||||||
|
|||||||
@ -5,5 +5,6 @@ FEATURES_REQUIRED += periph_wdt
|
|||||||
|
|
||||||
USEMODULE += xtimer
|
USEMODULE += xtimer
|
||||||
USEMODULE += shell
|
USEMODULE += shell
|
||||||
|
USEMODULE += shell_commands
|
||||||
|
|
||||||
include $(RIOTBASE)/Makefile.include
|
include $(RIOTBASE)/Makefile.include
|
||||||
|
|||||||
@ -2,6 +2,5 @@ include ../Makefile.tests_common
|
|||||||
|
|
||||||
USEPKG += libfixmath
|
USEPKG += libfixmath
|
||||||
USEMODULE += libfixmath
|
USEMODULE += libfixmath
|
||||||
USEMODULE += test_utils_interactive_sync
|
|
||||||
|
|
||||||
include $(RIOTBASE)/Makefile.include
|
include $(RIOTBASE)/Makefile.include
|
||||||
|
|||||||
@ -33,7 +33,6 @@
|
|||||||
|
|
||||||
#include "kernel_defines.h"
|
#include "kernel_defines.h"
|
||||||
#include "fix16.h"
|
#include "fix16.h"
|
||||||
#include "test_utils/interactive_sync.h"
|
|
||||||
|
|
||||||
#ifndef M_PI
|
#ifndef M_PI
|
||||||
# define M_PI 3.14159265359
|
# define M_PI 3.14159265359
|
||||||
@ -238,9 +237,6 @@ static void unary_ops(void)
|
|||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
/* Sync to prevent flooding of buffer */
|
|
||||||
test_utils_interactive_sync();
|
|
||||||
|
|
||||||
puts("Unary.");
|
puts("Unary.");
|
||||||
unary_ops();
|
unary_ops();
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
from testrunner import run, test_utils_interactive_sync
|
from testrunner import run
|
||||||
|
|
||||||
|
|
||||||
def expect_unary(child):
|
def expect_unary(child):
|
||||||
@ -46,7 +46,6 @@ def expect_binary(child):
|
|||||||
|
|
||||||
|
|
||||||
def testfunc(child):
|
def testfunc(child):
|
||||||
test_utils_interactive_sync(child)
|
|
||||||
child.expect_exact('Unary.')
|
child.expect_exact('Unary.')
|
||||||
expect_unary(child)
|
expect_unary(child)
|
||||||
child.expect_exact('Binary.')
|
child.expect_exact('Binary.')
|
||||||
|
|||||||
@ -32,6 +32,8 @@
|
|||||||
#include "thread.h"
|
#include "thread.h"
|
||||||
#include "xtimer.h"
|
#include "xtimer.h"
|
||||||
|
|
||||||
|
#include "test_utils/interactive_sync.h"
|
||||||
|
|
||||||
#define SEMAPHORE_MSG_QUEUE_SIZE (8)
|
#define SEMAPHORE_MSG_QUEUE_SIZE (8)
|
||||||
#define SEMAPHORE_TEST_THREADS (5)
|
#define SEMAPHORE_TEST_THREADS (5)
|
||||||
static char test1_thread_stack[THREAD_STACKSIZE_MAIN];
|
static char test1_thread_stack[THREAD_STACKSIZE_MAIN];
|
||||||
@ -292,6 +294,8 @@ void test4(void)
|
|||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
|
test_utils_interactive_sync();
|
||||||
|
|
||||||
msg_init_queue(main_msg_queue, SEMAPHORE_MSG_QUEUE_SIZE);
|
msg_init_queue(main_msg_queue, SEMAPHORE_MSG_QUEUE_SIZE);
|
||||||
xtimer_init();
|
xtimer_init();
|
||||||
puts("######################### TEST1:");
|
puts("######################### TEST1:");
|
||||||
|
|||||||
@ -2,6 +2,4 @@ include ../Makefile.tests_common
|
|||||||
|
|
||||||
USEMODULE += posix_time
|
USEMODULE += posix_time
|
||||||
|
|
||||||
USEMODULE += test_utils_interactive_sync
|
|
||||||
|
|
||||||
include $(RIOTBASE)/Makefile.include
|
include $(RIOTBASE)/Makefile.include
|
||||||
|
|||||||
@ -26,11 +26,9 @@
|
|||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include "test_utils/interactive_sync.h"
|
|
||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
test_utils_interactive_sync();
|
|
||||||
puts("5 x usleep(i++ * 500000)");
|
puts("5 x usleep(i++ * 500000)");
|
||||||
for (unsigned i = 0; i < 5; i++) {
|
for (unsigned i = 0; i < 5; i++) {
|
||||||
useconds_t us = i * 500000u;
|
useconds_t us = i * 500000u;
|
||||||
|
|||||||
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
from testrunner import run, test_utils_interactive_sync
|
from testrunner import run
|
||||||
|
|
||||||
US_PER_SEC = 1000000
|
US_PER_SEC = 1000000
|
||||||
EXTERNAL_JITTER = 0.15
|
EXTERNAL_JITTER = 0.15
|
||||||
@ -22,7 +22,6 @@ class InvalidTimeout(Exception):
|
|||||||
|
|
||||||
def testfunc(child):
|
def testfunc(child):
|
||||||
try:
|
try:
|
||||||
test_utils_interactive_sync(child)
|
|
||||||
start_test = time.time()
|
start_test = time.time()
|
||||||
child.expect_exact("5 x usleep(i++ * 500000)")
|
child.expect_exact("5 x usleep(i++ * 500000)")
|
||||||
for i in range(5):
|
for i in range(5):
|
||||||
|
|||||||
@ -27,6 +27,8 @@
|
|||||||
#include <thread.h>
|
#include <thread.h>
|
||||||
#include <xtimer.h>
|
#include <xtimer.h>
|
||||||
|
|
||||||
|
#include "test_utils/interactive_sync.h"
|
||||||
|
|
||||||
#define NB_THREADS (5U)
|
#define NB_THREADS (5U)
|
||||||
|
|
||||||
static char stacks[NB_THREADS][THREAD_STACKSIZE_DEFAULT];
|
static char stacks[NB_THREADS][THREAD_STACKSIZE_DEFAULT];
|
||||||
@ -54,6 +56,8 @@ static void *_thread_fn(void *arg)
|
|||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
|
test_utils_interactive_sync();
|
||||||
|
|
||||||
for (unsigned i = 0; i < NB_THREADS; ++i) {
|
for (unsigned i = 0; i < NB_THREADS; ++i) {
|
||||||
pids[i] = thread_create(stacks[i], sizeof(stacks[i]),
|
pids[i] = thread_create(stacks[i], sizeof(stacks[i]),
|
||||||
THREAD_PRIORITY_MAIN - 1,
|
THREAD_PRIORITY_MAIN - 1,
|
||||||
|
|||||||
@ -10,6 +10,7 @@ USEMODULE += ps
|
|||||||
RIOT_TERMINAL ?= socat
|
RIOT_TERMINAL ?= socat
|
||||||
|
|
||||||
DISABLE_MODULE += auto_init
|
DISABLE_MODULE += auto_init
|
||||||
|
DISABLE_MODULE += test_utils_interactive_sync
|
||||||
|
|
||||||
# chronos is missing a getchar implementation
|
# chronos is missing a getchar implementation
|
||||||
BOARD_BLACKLIST += chronos
|
BOARD_BLACKLIST += chronos
|
||||||
|
|||||||
@ -31,6 +31,8 @@
|
|||||||
#include "msg.h"
|
#include "msg.h"
|
||||||
#include "od.h"
|
#include "od.h"
|
||||||
|
|
||||||
|
#include "test_utils/interactive_sync.h"
|
||||||
|
|
||||||
#define MSG_QUEUE_SIZE (8)
|
#define MSG_QUEUE_SIZE (8)
|
||||||
#define MSG_TYPE_ISR (0x3456)
|
#define MSG_TYPE_ISR (0x3456)
|
||||||
#define RECVBUF_SIZE (IEEE802154_FRAME_LEN_MAX)
|
#define RECVBUF_SIZE (IEEE802154_FRAME_LEN_MAX)
|
||||||
@ -104,6 +106,8 @@ static void test_recv(void)
|
|||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
|
test_utils_interactive_sync();
|
||||||
|
|
||||||
puts("Socket ZEP device driver test");
|
puts("Socket ZEP device driver test");
|
||||||
msg_init_queue(_msg_queue, MSG_QUEUE_SIZE);
|
msg_init_queue(_msg_queue, MSG_QUEUE_SIZE);
|
||||||
_main_pid = sched_active_pid;
|
_main_pid = sched_active_pid;
|
||||||
|
|||||||
@ -2,4 +2,6 @@ include ../Makefile.tests_common
|
|||||||
|
|
||||||
USEMODULE += stdin
|
USEMODULE += stdin
|
||||||
|
|
||||||
|
DISABLE_MODULE += test_utils_interactive_sync
|
||||||
|
|
||||||
include $(RIOTBASE)/Makefile.include
|
include $(RIOTBASE)/Makefile.include
|
||||||
|
|||||||
@ -3,6 +3,7 @@ include ../Makefile.tests_common
|
|||||||
DISABLE_MODULE += auto_init
|
DISABLE_MODULE += auto_init
|
||||||
|
|
||||||
USEMODULE += shell
|
USEMODULE += shell
|
||||||
|
USEMODULE += shell_commands
|
||||||
USEMODULE += timex
|
USEMODULE += timex
|
||||||
|
|
||||||
# The MSP-430 toolchain lacks sscanf:
|
# The MSP-430 toolchain lacks sscanf:
|
||||||
|
|||||||
@ -21,6 +21,8 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "thread.h"
|
#include "thread.h"
|
||||||
|
|
||||||
|
#include "test_utils/interactive_sync.h"
|
||||||
|
|
||||||
char t2_stack[THREAD_STACKSIZE_MAIN];
|
char t2_stack[THREAD_STACKSIZE_MAIN];
|
||||||
|
|
||||||
void *second_thread(void *arg)
|
void *second_thread(void *arg)
|
||||||
@ -32,6 +34,8 @@ void *second_thread(void *arg)
|
|||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
|
test_utils_interactive_sync();
|
||||||
|
|
||||||
(void) thread_create(
|
(void) thread_create(
|
||||||
t2_stack, sizeof(t2_stack),
|
t2_stack, sizeof(t2_stack),
|
||||||
THREAD_PRIORITY_MAIN - 1,
|
THREAD_PRIORITY_MAIN - 1,
|
||||||
|
|||||||
@ -25,6 +25,8 @@
|
|||||||
#include "thread.h"
|
#include "thread.h"
|
||||||
#include "mutex.h"
|
#include "mutex.h"
|
||||||
|
|
||||||
|
#include "test_utils/interactive_sync.h"
|
||||||
|
|
||||||
#ifndef PROBLEM
|
#ifndef PROBLEM
|
||||||
#define PROBLEM 12
|
#define PROBLEM 12
|
||||||
#endif
|
#endif
|
||||||
@ -64,6 +66,8 @@ int main(void)
|
|||||||
kernel_pid_t ths;
|
kernel_pid_t ths;
|
||||||
uint32_t factorial = 1;
|
uint32_t factorial = 1;
|
||||||
|
|
||||||
|
test_utils_interactive_sync();
|
||||||
|
|
||||||
printf("[START] compute %d! (factorial).\n", PROBLEM);
|
printf("[START] compute %d! (factorial).\n", PROBLEM);
|
||||||
|
|
||||||
for (int i = 0; i < PROBLEM; ++i) {
|
for (int i = 0; i < PROBLEM; ++i) {
|
||||||
|
|||||||
@ -22,6 +22,8 @@
|
|||||||
|
|
||||||
#include "thread.h"
|
#include "thread.h"
|
||||||
|
|
||||||
|
#include "test_utils/interactive_sync.h"
|
||||||
|
|
||||||
char second_thread_stack[THREAD_STACKSIZE_MAIN];
|
char second_thread_stack[THREAD_STACKSIZE_MAIN];
|
||||||
char third_thread_stack[THREAD_STACKSIZE_MAIN];
|
char third_thread_stack[THREAD_STACKSIZE_MAIN];
|
||||||
|
|
||||||
@ -78,6 +80,7 @@ void *second_thread(void *arg)
|
|||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
|
test_utils_interactive_sync();
|
||||||
puts("main: starting");
|
puts("main: starting");
|
||||||
|
|
||||||
if ((thread_create(
|
if ((thread_create(
|
||||||
|
|||||||
@ -27,6 +27,8 @@
|
|||||||
#include "thread.h"
|
#include "thread.h"
|
||||||
#include "kernel_types.h"
|
#include "kernel_types.h"
|
||||||
|
|
||||||
|
#include "test_utils/interactive_sync.h"
|
||||||
|
|
||||||
/* One stack for all threads. DON'T TRY THIS AT HOME!! */
|
/* One stack for all threads. DON'T TRY THIS AT HOME!! */
|
||||||
static char dummy_stack[THREAD_STACKSIZE_IDLE];
|
static char dummy_stack[THREAD_STACKSIZE_IDLE];
|
||||||
|
|
||||||
@ -37,6 +39,8 @@ static void *thread_func(void *arg)
|
|||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
|
test_utils_interactive_sync();
|
||||||
|
|
||||||
kernel_pid_t thr_id = KERNEL_PID_UNDEF;
|
kernel_pid_t thr_id = KERNEL_PID_UNDEF;
|
||||||
unsigned thr_cnt = 0;
|
unsigned thr_cnt = 0;
|
||||||
|
|
||||||
|
|||||||
@ -24,6 +24,8 @@
|
|||||||
#include "thread.h"
|
#include "thread.h"
|
||||||
#include "msg.h"
|
#include "msg.h"
|
||||||
|
|
||||||
|
#include "test_utils/interactive_sync.h"
|
||||||
|
|
||||||
char t1_stack[THREAD_STACKSIZE_MAIN];
|
char t1_stack[THREAD_STACKSIZE_MAIN];
|
||||||
char t2_stack[THREAD_STACKSIZE_MAIN];
|
char t2_stack[THREAD_STACKSIZE_MAIN];
|
||||||
char t3_stack[THREAD_STACKSIZE_MAIN];
|
char t3_stack[THREAD_STACKSIZE_MAIN];
|
||||||
@ -85,6 +87,8 @@ void *thread3(void *arg)
|
|||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
|
test_utils_interactive_sync();
|
||||||
|
|
||||||
p_main = sched_active_pid;
|
p_main = sched_active_pid;
|
||||||
p1 = thread_create(t1_stack, sizeof(t1_stack), THREAD_PRIORITY_MAIN - 1,
|
p1 = thread_create(t1_stack, sizeof(t1_stack), THREAD_PRIORITY_MAIN - 1,
|
||||||
THREAD_CREATE_WOUT_YIELD | THREAD_CREATE_STACKTEST,
|
THREAD_CREATE_WOUT_YIELD | THREAD_CREATE_STACKTEST,
|
||||||
|
|||||||
@ -27,6 +27,8 @@
|
|||||||
#include "thread.h"
|
#include "thread.h"
|
||||||
#include "msg.h"
|
#include "msg.h"
|
||||||
|
|
||||||
|
#include "test_utils/interactive_sync.h"
|
||||||
|
|
||||||
#define CANARY_TYPE (0x21fd)
|
#define CANARY_TYPE (0x21fd)
|
||||||
|
|
||||||
#define TIMER_FREQ (1000000LU)
|
#define TIMER_FREQ (1000000LU)
|
||||||
@ -79,6 +81,8 @@ static void *_thread(void *arg)
|
|||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
|
test_utils_interactive_sync();
|
||||||
|
|
||||||
kernel_pid_t pid;
|
kernel_pid_t pid;
|
||||||
|
|
||||||
timer_init(TIMER_DEV(0), TIMER_FREQ, _timer, NULL);
|
timer_init(TIMER_DEV(0), TIMER_FREQ, _timer, NULL);
|
||||||
|
|||||||
@ -25,6 +25,8 @@
|
|||||||
#include "thread.h"
|
#include "thread.h"
|
||||||
#include "msg.h"
|
#include "msg.h"
|
||||||
|
|
||||||
|
#include "test_utils/interactive_sync.h"
|
||||||
|
|
||||||
char t1_stack[THREAD_STACKSIZE_MAIN];
|
char t1_stack[THREAD_STACKSIZE_MAIN];
|
||||||
|
|
||||||
kernel_pid_t p_send = KERNEL_PID_UNDEF, p_recv = KERNEL_PID_UNDEF;
|
kernel_pid_t p_send = KERNEL_PID_UNDEF, p_recv = KERNEL_PID_UNDEF;
|
||||||
@ -54,6 +56,8 @@ void *sender_thread(void *arg)
|
|||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
|
test_utils_interactive_sync();
|
||||||
|
|
||||||
msg_t msg;
|
msg_t msg;
|
||||||
p_recv = sched_active_pid;
|
p_recv = sched_active_pid;
|
||||||
|
|
||||||
|
|||||||
@ -25,6 +25,8 @@
|
|||||||
#include "thread.h"
|
#include "thread.h"
|
||||||
#include "msg.h"
|
#include "msg.h"
|
||||||
|
|
||||||
|
#include "test_utils/interactive_sync.h"
|
||||||
|
|
||||||
char t1_stack[THREAD_STACKSIZE_MAIN];
|
char t1_stack[THREAD_STACKSIZE_MAIN];
|
||||||
|
|
||||||
kernel_pid_t p_send = KERNEL_PID_UNDEF, p_recv = KERNEL_PID_UNDEF;
|
kernel_pid_t p_send = KERNEL_PID_UNDEF, p_recv = KERNEL_PID_UNDEF;
|
||||||
@ -54,6 +56,8 @@ void *thread1(void *arg)
|
|||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
|
test_utils_interactive_sync();
|
||||||
|
|
||||||
msg_t msg;
|
msg_t msg;
|
||||||
p_recv = sched_active_pid;
|
p_recv = sched_active_pid;
|
||||||
|
|
||||||
|
|||||||
@ -25,6 +25,8 @@
|
|||||||
#include "thread.h"
|
#include "thread.h"
|
||||||
#include "msg.h"
|
#include "msg.h"
|
||||||
|
|
||||||
|
#include "test_utils/interactive_sync.h"
|
||||||
|
|
||||||
char t1_stack[THREAD_STACKSIZE_MAIN];
|
char t1_stack[THREAD_STACKSIZE_MAIN];
|
||||||
char t2_stack[THREAD_STACKSIZE_MAIN];
|
char t2_stack[THREAD_STACKSIZE_MAIN];
|
||||||
char t3_stack[THREAD_STACKSIZE_MAIN];
|
char t3_stack[THREAD_STACKSIZE_MAIN];
|
||||||
@ -51,6 +53,8 @@ void *sub_thread(void *arg)
|
|||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
|
test_utils_interactive_sync();
|
||||||
|
|
||||||
puts("START");
|
puts("START");
|
||||||
msg_t msg;
|
msg_t msg;
|
||||||
|
|
||||||
|
|||||||
@ -26,6 +26,8 @@
|
|||||||
#include "sched.h"
|
#include "sched.h"
|
||||||
#include "thread.h"
|
#include "thread.h"
|
||||||
|
|
||||||
|
#include "test_utils/interactive_sync.h"
|
||||||
|
|
||||||
char iqr_check_stack[THREAD_STACKSIZE_DEFAULT];
|
char iqr_check_stack[THREAD_STACKSIZE_DEFAULT];
|
||||||
|
|
||||||
static volatile uint8_t irq_occurred;
|
static volatile uint8_t irq_occurred;
|
||||||
@ -65,6 +67,8 @@ static void _spin(void)
|
|||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
|
test_utils_interactive_sync();
|
||||||
|
|
||||||
puts("Context swap race condition test application");
|
puts("Context swap race condition test application");
|
||||||
|
|
||||||
kernel_pid_t pid;
|
kernel_pid_t pid;
|
||||||
|
|||||||
@ -11,6 +11,8 @@
|
|||||||
#include "embUnit.h"
|
#include "embUnit.h"
|
||||||
#include "xtimer.h"
|
#include "xtimer.h"
|
||||||
|
|
||||||
|
#include "test_utils/interactive_sync.h"
|
||||||
|
|
||||||
#define UNCURRY(FUN, ARGS) FUN(ARGS)
|
#define UNCURRY(FUN, ARGS) FUN(ARGS)
|
||||||
#define RUN_TEST_SUITES(...) MAP(RUN_TEST_SUITE, __VA_ARGS__)
|
#define RUN_TEST_SUITES(...) MAP(RUN_TEST_SUITE, __VA_ARGS__)
|
||||||
#define RUN_TEST_SUITE(TEST_SUITE) \
|
#define RUN_TEST_SUITE(TEST_SUITE) \
|
||||||
@ -21,6 +23,8 @@
|
|||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
|
test_utils_interactive_sync();
|
||||||
|
|
||||||
#ifdef MODULE_XTIMER
|
#ifdef MODULE_XTIMER
|
||||||
/* auto_init is disabled, but some modules depends on this module being initialized */
|
/* auto_init is disabled, but some modules depends on this module being initialized */
|
||||||
xtimer_init();
|
xtimer_init();
|
||||||
|
|||||||
@ -5,8 +5,6 @@ USEMODULE += xtimer
|
|||||||
# This test randomly fails on `native` so disable it from CI
|
# This test randomly fails on `native` so disable it from CI
|
||||||
TEST_ON_CI_BLACKLIST += native
|
TEST_ON_CI_BLACKLIST += native
|
||||||
|
|
||||||
USEMODULE += test_utils_interactive_sync
|
|
||||||
|
|
||||||
# Port and pin configuration for probing with oscilloscope
|
# Port and pin configuration for probing with oscilloscope
|
||||||
# Port number should be found in port enum e.g in cpu/include/periph_cpu.h
|
# Port number should be found in port enum e.g in cpu/include/periph_cpu.h
|
||||||
#FEATURES_REQUIRED += periph_gpio
|
#FEATURES_REQUIRED += periph_gpio
|
||||||
|
|||||||
@ -27,7 +27,6 @@
|
|||||||
|
|
||||||
#include "xtimer.h"
|
#include "xtimer.h"
|
||||||
#include "timex.h"
|
#include "timex.h"
|
||||||
#include "test_utils/interactive_sync.h"
|
|
||||||
|
|
||||||
#define RUNS (5U)
|
#define RUNS (5U)
|
||||||
#define SLEEP_TIMES_NUMOF ARRAY_SIZE(sleep_times)
|
#define SLEEP_TIMES_NUMOF ARRAY_SIZE(sleep_times)
|
||||||
@ -62,7 +61,6 @@ int main(void)
|
|||||||
|
|
||||||
printf("Running test %u times with %u distinct sleep times\n", RUNS,
|
printf("Running test %u times with %u distinct sleep times\n", RUNS,
|
||||||
(unsigned)SLEEP_TIMES_NUMOF);
|
(unsigned)SLEEP_TIMES_NUMOF);
|
||||||
test_utils_interactive_sync();
|
|
||||||
start_test = xtimer_now_usec();
|
start_test = xtimer_now_usec();
|
||||||
for (unsigned m = 0; m < RUNS; m++) {
|
for (unsigned m = 0; m < RUNS; m++) {
|
||||||
for (unsigned n = 0;
|
for (unsigned n = 0;
|
||||||
|
|||||||
@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
from testrunner import run, test_utils_interactive_sync
|
from testrunner import run
|
||||||
|
|
||||||
|
|
||||||
US_PER_SEC = 1000000
|
US_PER_SEC = 1000000
|
||||||
@ -28,7 +28,6 @@ def testfunc(child):
|
|||||||
RUNS = int(child.match.group(1))
|
RUNS = int(child.match.group(1))
|
||||||
SLEEP_TIMES_NUMOF = int(child.match.group(2))
|
SLEEP_TIMES_NUMOF = int(child.match.group(2))
|
||||||
try:
|
try:
|
||||||
test_utils_interactive_sync(child)
|
|
||||||
start_test = time.time()
|
start_test = time.time()
|
||||||
for m in range(RUNS):
|
for m in range(RUNS):
|
||||||
for n in range(SLEEP_TIMES_NUMOF):
|
for n in range(SLEEP_TIMES_NUMOF):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user