zephyr/tests/kernel/pipe/deprecated/pipe_api/src/main.c
Måns Ansgariusson 6782c5381d tests: kernel: pipe: Add new test cases for pipe API rework
This commit adds new test cases for the pipe API rework.
* basic.c: Sanity check for pipe operations.
* concurrency.c: Test pipe operations with multiple threads.
* stress.c: Test pipe operations under stress conditions.

And moves the old pipe test cases to the deprecated folder.

Signed-off-by: Måns Ansgariusson <Mansgariusson@gmail.com>
2025-01-17 19:43:44 +01:00

38 lines
804 B
C

/*
* Copyright (c) 2016 Intel Corporation
*
* SPDX-License-Identifier: Apache-2.0
*/
/**
* @defgroup kernel_pipe_tests PIPEs
* @ingroup all_tests
* @{
* @}
*/
#include <zephyr/ztest.h>
/* k objects */
extern struct k_pipe pipe, kpipe, khalfpipe, put_get_pipe;
extern struct k_sem end_sema;
extern struct k_stack tstack;
extern struct k_thread tdata;
extern struct k_heap test_pool;
static void *pipe_api_setup(void)
{
k_thread_access_grant(k_current_get(), &pipe,
&kpipe, &end_sema, &tdata, &tstack,
&khalfpipe, &put_get_pipe);
k_thread_heap_assign(k_current_get(), &test_pool);
return NULL;
}
ZTEST_SUITE(pipe_api, NULL, pipe_api_setup, NULL, NULL, NULL);
ZTEST_SUITE(pipe_api_1cpu, NULL, pipe_api_setup,
ztest_simple_1cpu_before, ztest_simple_1cpu_after, NULL);