Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
test_sched.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2016 Intel Corporation
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#ifndef __TEST_SCHED_H__
8#define __TEST_SCHED_H__
9
10#include <zephyr.h>
11#include <ztest.h>
12
13#define MAX_NUM_THREAD 10
14#define STACK_SIZE (640 + CONFIG_TEST_EXTRA_STACKSIZE)
15
18extern struct k_thread user_thread;
19extern struct k_sem user_sem;
20
25};
26
27void spin_for_ms(int ticks);
28
32void test_bad_priorities(void);
33void test_yield_cooperative(void);
34void test_sleep_cooperative(void);
40void test_lock_preemptible(void);
44void test_slice_reset(void);
45void test_slice_scheduling(void);
48void test_user_k_wakeup(void);
49void test_user_k_is_preempt(void);
57
58#endif /* __TEST_SCHED_H__ */
void test_k_thread_resume_init_null(void)
Test k_thread_resume() API.
Definition: user_api.c:153
void test_sleep_cooperative(void)
Validate the behavior of cooperative thread when it sleeps.
Definition: test_sched_timeslice_and_lock.c:126
void test_bad_priorities(void)
Definition: test_sched_priority.c:184
void test_sched_is_preempt_thread(void)
Validate the correctness of k_is_preempt_thread()
Definition: test_sched_is_preempt_thread.c:68
void test_sleep_wakeup_preemptible(void)
Validate k_wakeup()
Definition: test_sched_timeslice_and_lock.c:172
void test_yield_cooperative(void)
Validate the behavior of cooperative thread when it yields.
Definition: test_sched_timeslice_and_lock.c:99
void test_k_wakeup_init_null(void)
Test k_wakeup() API.
Definition: user_api.c:342
void test_priority_preemptible_wait_prio(void)
Validate scheduling sequence of preemptive threads with start delay.
Definition: test_sched_priority.c:123
void test_k_thread_priority_get_init_null(void)
Test k_thread_priority_get() API.
Definition: user_api.c:190
void test_time_slicing_preemptible(void)
Validate preemptive thread behavior with time slice.
Definition: test_sched_timeslice_and_lock.c:242
void test_k_thread_priority_set_upgrade(void)
Test k_thread_priority_set() API.
Definition: user_api.c:305
void test_priority_scheduling(void)
Check the behavior of preemptive threads with different priorities.
Definition: test_priority_scheduling.c:68
void test_unlock_nested_sched_lock(void)
Validate nested k_sched_lock() and k_sched_unlock()
Definition: test_sched_timeslice_and_lock.c:385
void test_lock_preemptible(void)
Lock the scheduler when preemptive threads are running.
Definition: test_sched_timeslice_and_lock.c:313
void test_k_thread_suspend_init_null(void)
Test k_thread_suspend() API.
Definition: user_api.c:116
void test_unlock_preemptible(void)
Validate k_sched_lock() and k_sched_unlock()
Definition: test_sched_timeslice_and_lock.c:348
void test_k_thread_priority_set_init_null(void)
Test k_thread_priority_set() API.
Definition: user_api.c:227
void test_wakeup_expired_timer_thread(void)
validate k_wakeup() in some corner scenario
Definition: test_sched_timeslice_and_lock.c:434
void test_time_slicing_disable_preemptible(void)
Check the behavior of preemptive thread with k_busy_wait()
Definition: test_sched_timeslice_and_lock.c:281
void test_priority_preemptible(void)
Validate preemptiveness of preemptive thread.
Definition: test_sched_priority.c:83
void test_k_thread_priority_set_overmax(void)
Test k_thread_priority_set() API.
Definition: user_api.c:265
void test_priority_cooperative(void)
Validate that the cooperative thread will not be preempted.
Definition: test_sched_priority.c:47
void test_pending_thread_wakeup(void)
Verify k_wakeup() behavior on pending thread.
Definition: test_sched_timeslice_and_lock.c:207
struct k_stack tstack
Definition: thread.h:201
Definition: test_sched.h:21
int executed
Definition: test_sched.h:24
int priority
Definition: test_sched.h:23
k_tid_t tid
Definition: test_sched.h:22
#define MAX_NUM_THREAD
Definition: test_sched.h:13
K_THREAD_STACK_EXTERN(tstack)
void test_user_k_is_preempt(void)
Definition: user_api.c:55
void test_busy_wait_cooperative(void)
Definition: test_sched_timeslice_and_lock.c:143
void test_user_k_wakeup(void)
Definition: user_api.c:32
#define STACK_SIZE
Definition: test_sched.h:14
K_THREAD_STACK_ARRAY_EXTERN(tstacks, 10,(640+CONFIG_TEST_EXTRA_STACKSIZE))
struct k_sem user_sem
void test_slice_scheduling(void)
Definition: test_slice_scheduling.c:140
void spin_for_ms(int ticks)
Definition: main.c:16
struct k_thread user_thread
Definition: user_api.c:13
void test_slice_reset(void)
Definition: test_sched_timeslice_reset.c:197
Zephyr Testsuite.