1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
Commit Graph

32 Commits

Author SHA1 Message Date
Francisco Molina
0fa1551500 sys/posix: convert to ztimer64_usec 2022-03-10 14:24:57 +01:00
chrysn
87847b1de4 tests: Fix thread return with local message queue
When a message queue is configured from the stack, that main function
must never return -- otherwise, during sched_task_exit (which the
thread's function "returns" to), message senders might still send
messages into already freed stack space (which would be reused by
sched_task_exit).

Co-authored-by: Marian Buschsieweke <maribu@users.noreply.github.com>
2022-01-11 21:51:09 +01:00
Kees Bakker
8369f42d5e tests/posix_semaphore: better guarantee sequence of output lines
As suggested by @kaspar030 the THREAD_CREATE_WOUT_YIELD flag was removed.
Now the sequence of output lines is identical in two cases: stdio via UART,
and stdio via CDC ACM (which needs a thread for that).

The expects have been changed to match the new situation, which is what
was already given in the CDC ACM case.
2020-06-14 20:03:32 +02:00
Francisco Molina
e0855dedfd
tests: remove uneeded DISABLE_MODULE+=auto_init 2020-02-12 16:51:34 +01:00
Francisco Molina
416c048737 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
2019-11-27 15:07:42 +01:00
a9cd9433f0 tests/posix_semaphore: unify and increase allowed test4 margin
Previously, there was a very tight allowed margin (100us), then some
special cases for platforms for which the test would otherwise fail,
increasing the margin.
This turned out to be a maintanance burden, as each slightly special
board needed a PR adding the special case.

This commit sets a quite large margin (1000us, 0.1% of total delay),
which should be large enough to not trip over platform-induced timer
inaccuracies, but still verify that the module is using timers
correctly.

(This is not a timer accuracy test.)
2019-05-06 14:51:44 +02:00
Gaëtan Harter
732bcc7335
tests/posix_semaphore: sem_timedwait should not return before abstime
Update the test as sem_timedwait is not supposed to return before the
given abstime.

Source: http://pubs.opengroup.org/onlinepubs/9699919799.2016edition/functions/sem_timedwait.html

    The timeout shall expire when the absolute time specified by abstime
    passes, as measured by the clock on which timeouts are based (that is,
    when the value of that clock equals or exceeds abstime), or if the
    absolute time specified by abstime has already been passed at the time
    of the call.
2019-03-20 15:18:25 +01:00
bd77949bc7 tests/posix_semaphore: increase timeout margin
Otherwise it may break on nrf51 boards where the timeout can be slightly above 100. Using 105us margin seems enough
2018-12-14 22:22:36 +01:00
Gaëtan Harter
e6e4072335 tests/posix_semaphore: test4: allow native to take more time
As not real time, native does often not weak up before 100ms.
I observed mostly between 0 and 200 but also got a 250, so I allow 300 more.
2017-10-24 13:38:35 +02:00
Gaëtan Harter
712550987d tests/posix_semaphore: test4: fix timestamp comparison
Only use a 'start' and a 'elapsed' timestamp to compare diff.
And remove the puts from within the measured time.
2017-10-24 13:38:03 +02:00
Gaëtan Harter
ffcdb61211 tests/posix_semaphore: test4: BUG add '\0' after fmt_u64_dec
fmt_u64_dec does not include the terminating null string character.
2017-10-24 13:36:06 +02:00
Gaëtan Harter
fe9c604391 tests/posix_semaphore: test4: only one call to fmt_u64_dec 2017-10-24 13:36:06 +02:00
Gaëtan Harter
14235b57ec tests/posix_semaphore: test4: change msg when waited more than expected 2017-10-24 13:36:06 +02:00
Oleg Hahm
4f4214235b timex: unambiguous time conversion macros 2017-01-19 13:18:08 +01:00
Joakim Nohlgård
7c48c891a0 xtimer: Update xtimer usage to match API changes 2016-11-29 20:44:31 +01:00
Martine Lenders
8136a12d24 tests: fix posix_semaphore output and for timer error 2016-11-08 16:38:04 +01:00
Hauke Petersen
cc23481d55 tests: adapted to renamed THREAD_FLAGS 2015-12-07 22:09:47 +01:00
Martine Lenders
aca1224401 tests: port semaphore tests to xtimer 2015-11-24 14:06:00 +01:00
Martine Lenders
5c2da0e289 tests: adapt posix_semaphores test to correct API 2015-10-28 17:16:23 +01:00
Martine Lenders
45b30a8e91 posix_semaphore: make API POSIX compliant 2015-10-28 17:16:23 +01:00
Martine Lenders
12472a8984 tests: add test for sem_timedwait() 2015-10-19 14:12:31 +02:00
Martine Lenders
4b92961f82 tests: expand semaphore test for multiple semaphores 2015-10-19 14:12:31 +02:00
Martine Lenders
ae65746d59 tests: adapt semaphore test application 2015-10-19 14:12:31 +02:00
Martine Lenders
de421cdf78 posix: use sem module for semaphore implementation 2015-10-19 14:12:31 +02:00
Lucas Jenss
426170b064 Improve naming of thread stacksize/priority constants
As discussed in #2725, this commit renames a number of stacksize constants to
better convey their intended usage. In addition, constants for thread priority
are given a `THREAD_` prefix. Changes are:

* KERNEL_CONF_STACKSIZE_PRINTF renamed to THREAD_EXTRA_STACKSIZE_PRINTF
* KERNEL_CONF_STACKSIZE_DEFAULT renamed to THREAD_STACKSIZE_DEFAULT
* KERNEL_CONF_STACKSIZE_IDLE renamed to THREAD_STACKSIZE_IDLE
* KERNEL_CONF_STACKSIZE_MAIN renamed to THREAD_STACKSIZE_MAIN
* Move thread stacksizes from kernel.h to thread.h, since the prefix changed
* PRIORITY_MIN renamed to THREAD_PRIORITY_MIN
* PRIORITY_IDLE renamed to THREAD_PRIORITY_IDLE
* PRIORITY_MAIN renamed to THREAD_PRIORITY_MAIN
* Move thread priorities from kernel.h to thread.h since the prefix has changed
* MINIMUM_STACK_SIZE renamed to THREAD_STACKSIZE_MINIMUM for consistency
2015-05-21 00:14:23 +02:00
René Kijewski
09b274fef7 tests: fix tests/posix_semaphore 2014-11-21 14:33:28 +01:00
Oleg Hahm
9a61d8cf1c core: move optional tcb members to DEVELHELP 2014-10-30 16:37:10 +01:00
Oleg Hahm
0ad7b170ed make kernel_pid_t comparisons consistent 2014-08-07 16:31:27 +02:00
Oleg Hahm
aa2ecf6216 initialize kernel_pid_t correctly 2014-08-07 16:31:27 +02:00
Oleg Hahm
983d056c75 core: harmonizes the data type for the process ID
Instead of using differing integer types use kernel_pid_t for process
identifier. This type is introduced in a new header file to avoid
circular dependencies.
2014-08-01 12:02:54 +02:00
Ludwig Ortmann
3ca4f18479 doc: use lgplv2.1-short license header instead of lgpl-short-riot 2014-07-31 22:57:20 +02:00
René Kijewski
d46c7e00d4 tests: remove test_ prefix
Closes #1485.
2014-07-31 07:34:11 +02:00