tests: Introduced new config option to add extra stack size for tests.
This option is added in order to support Xtensa, which needs more stack than other architecture. This allows having a centralized way to change stack requirements for all tests. This extra stack size is eaqual to 0 for most architectures, except Xtensa which requires additional 768 bytes for each stack. Change-Id: Ie5dcae1dfd29018d36ef35dae22dc4c1a2ecdc14 Signed-off-by: Mazen NEIFER <mazen@nestwave.com>
This commit is contained in:
parent
555c60631a
commit
4713575cb1
16 changed files with 22 additions and 17 deletions
|
@ -8,4 +8,9 @@ menu Testing
|
||||||
|
|
||||||
source "tests/ztest/Kconfig"
|
source "tests/ztest/Kconfig"
|
||||||
|
|
||||||
|
config TEST_EXTRA_STACKSIZE
|
||||||
|
int "Test function thread stack size"
|
||||||
|
default 0
|
||||||
|
default 768 if XTENSA
|
||||||
|
|
||||||
endmenu
|
endmenu
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
#include <board.h>
|
#include <board.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define THREAD_STACKSIZE 384
|
#define THREAD_STACKSIZE (384 + CONFIG_TEST_EXTRA_STACKSIZE)
|
||||||
#define THREAD_PRIORITY 4
|
#define THREAD_PRIORITY 4
|
||||||
|
|
||||||
#define THREAD_SELF_CMD 0
|
#define THREAD_SELF_CMD 0
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
|
|
||||||
#include "test_fifo.h"
|
#include "test_fifo.h"
|
||||||
|
|
||||||
#define STACK_SIZE 512
|
#define STACK_SIZE (512 + CONFIG_TEST_EXTRA_STACKSIZE)
|
||||||
#define LIST_LEN 2
|
#define LIST_LEN 2
|
||||||
/**TESTPOINT: init via K_FIFO_DEFINE*/
|
/**TESTPOINT: init via K_FIFO_DEFINE*/
|
||||||
K_FIFO_DEFINE(kfifo);
|
K_FIFO_DEFINE(kfifo);
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
|
|
||||||
#include "test_fifo.h"
|
#include "test_fifo.h"
|
||||||
|
|
||||||
#define STACK_SIZE 512
|
#define STACK_SIZE (512 + CONFIG_TEST_EXTRA_STACKSIZE)
|
||||||
#define LIST_LEN 4
|
#define LIST_LEN 4
|
||||||
#define LOOPS 32
|
#define LOOPS 32
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
#include "test_lifo.h"
|
#include "test_lifo.h"
|
||||||
|
|
||||||
#define STACK_SIZE 512
|
#define STACK_SIZE (512 + CONFIG_TEST_EXTRA_STACKSIZE)
|
||||||
#define LIST_LEN 2
|
#define LIST_LEN 2
|
||||||
/**TESTPOINT: init via K_LIFO_DEFINE*/
|
/**TESTPOINT: init via K_LIFO_DEFINE*/
|
||||||
K_LIFO_DEFINE(klifo);
|
K_LIFO_DEFINE(klifo);
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
|
|
||||||
#include "test_lifo.h"
|
#include "test_lifo.h"
|
||||||
|
|
||||||
#define STACK_SIZE 512
|
#define STACK_SIZE (512 + CONFIG_TEST_EXTRA_STACKSIZE)
|
||||||
#define LIST_LEN 4
|
#define LIST_LEN 4
|
||||||
#define LOOPS 32
|
#define LOOPS 32
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
#include <ztest.h>
|
#include <ztest.h>
|
||||||
|
|
||||||
#define TIMEOUT 100
|
#define TIMEOUT 100
|
||||||
#define STACK_SIZE 512
|
#define STACK_SIZE (512 + CONFIG_TEST_EXTRA_STACKSIZE)
|
||||||
#define MAIL_LEN 64
|
#define MAIL_LEN 64
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
#include <ztest.h>
|
#include <ztest.h>
|
||||||
#include <atomic.h>
|
#include <atomic.h>
|
||||||
#define THREAD_NUM 4
|
#define THREAD_NUM 4
|
||||||
#define STACK_SIZE 512
|
#define STACK_SIZE (512 + CONFIG_TEST_EXTRA_STACKSIZE)
|
||||||
#define POOL_NUM 2
|
#define POOL_NUM 2
|
||||||
#define TIMEOUT 200
|
#define TIMEOUT 200
|
||||||
#define BLK_SIZE_MIN 4
|
#define BLK_SIZE_MIN 4
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
#ifdef CONFIG_RISCV32
|
#ifdef CONFIG_RISCV32
|
||||||
#define STACK_SIZE 512
|
#define STACK_SIZE 512
|
||||||
#else
|
#else
|
||||||
#define STACK_SIZE 256
|
#define STACK_SIZE (256 + CONFIG_TEST_EXTRA_STACKSIZE)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*local variables*/
|
/*local variables*/
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
*/
|
*/
|
||||||
#include <ztest.h>
|
#include <ztest.h>
|
||||||
|
|
||||||
#define STACK_SIZE 256
|
#define STACK_SIZE (256 + CONFIG_TEST_EXTRA_STACKSIZE)
|
||||||
static char __noinit __stack tstack[STACK_SIZE];
|
static char __noinit __stack tstack[STACK_SIZE];
|
||||||
static int execute_flag;
|
static int execute_flag;
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
|
|
||||||
#include <ztest.h>
|
#include <ztest.h>
|
||||||
|
|
||||||
#define STACK_SIZE 256
|
#define STACK_SIZE (256 + CONFIG_TEST_EXTRA_STACKSIZE)
|
||||||
static char __noinit __stack tstack[STACK_SIZE];
|
static char __noinit __stack tstack[STACK_SIZE];
|
||||||
|
|
||||||
static char tp1[8];
|
static char tp1[8];
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
*/
|
*/
|
||||||
#include <ztest.h>
|
#include <ztest.h>
|
||||||
|
|
||||||
#define STACK_SIZE 256
|
#define STACK_SIZE (256 + CONFIG_TEST_EXTRA_STACKSIZE)
|
||||||
static char __noinit __stack tstack[STACK_SIZE];
|
static char __noinit __stack tstack[STACK_SIZE];
|
||||||
static int last_prio;
|
static int last_prio;
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
#if defined(CONFIG_RISCV32)
|
#if defined(CONFIG_RISCV32)
|
||||||
#define STACK_SIZE 512
|
#define STACK_SIZE 512
|
||||||
#else
|
#else
|
||||||
#define STACK_SIZE 256
|
#define STACK_SIZE (256 + CONFIG_TEST_EXTRA_STACKSIZE)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
struct thread_data {
|
struct thread_data {
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
#include <board.h>
|
#include <board.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define FIBER_STACKSIZE 384
|
#define FIBER_STACKSIZE (384 + CONFIG_TEST_EXTRA_STACKSIZE)
|
||||||
#define FIBER_PRIORITY 4
|
#define FIBER_PRIORITY 4
|
||||||
|
|
||||||
#define THREAD_SELF_CMD 0
|
#define THREAD_SELF_CMD 0
|
||||||
|
|
|
@ -37,9 +37,9 @@
|
||||||
#include <util_test_common.h>
|
#include <util_test_common.h>
|
||||||
|
|
||||||
#if defined(CONFIG_ASSERT) && defined(CONFIG_DEBUG)
|
#if defined(CONFIG_ASSERT) && defined(CONFIG_DEBUG)
|
||||||
#define FIBER_STACKSIZE 512
|
#define FIBER_STACKSIZE (512 + CONFIG_TEST_EXTRA_STACKSIZE)
|
||||||
#else
|
#else
|
||||||
#define FIBER_STACKSIZE 384
|
#define FIBER_STACKSIZE (384 + CONFIG_TEST_EXTRA_STACKSIZE)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define FIBER_PRIORITY 4
|
#define FIBER_PRIORITY 4
|
||||||
|
|
|
@ -25,9 +25,9 @@
|
||||||
#include <util_test_common.h>
|
#include <util_test_common.h>
|
||||||
|
|
||||||
#if defined(CONFIG_ASSERT) && defined(CONFIG_DEBUG)
|
#if defined(CONFIG_ASSERT) && defined(CONFIG_DEBUG)
|
||||||
#define FIBER_STACKSIZE 384
|
#define FIBER_STACKSIZE (384 + CONFIG_TEST_EXTRA_STACKSIZE)
|
||||||
#else
|
#else
|
||||||
#define FIBER_STACKSIZE 256
|
#define FIBER_STACKSIZE (256 + CONFIG_TEST_EXTRA_STACKSIZE)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define TEST_FIBER_PRIORITY 4
|
#define TEST_FIBER_PRIORITY 4
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue