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:
Mazen NEIFER 2017-01-31 23:05:18 +01:00 committed by Andrew Boie
commit 4713575cb1
16 changed files with 22 additions and 17 deletions

View file

@ -8,4 +8,9 @@ menu Testing
source "tests/ztest/Kconfig"
config TEST_EXTRA_STACKSIZE
int "Test function thread stack size"
default 0
default 768 if XTENSA
endmenu

View file

@ -30,7 +30,7 @@
#include <board.h>
#endif
#define THREAD_STACKSIZE 384
#define THREAD_STACKSIZE (384 + CONFIG_TEST_EXTRA_STACKSIZE)
#define THREAD_PRIORITY 4
#define THREAD_SELF_CMD 0

View file

@ -18,7 +18,7 @@
#include "test_fifo.h"
#define STACK_SIZE 512
#define STACK_SIZE (512 + CONFIG_TEST_EXTRA_STACKSIZE)
#define LIST_LEN 2
/**TESTPOINT: init via K_FIFO_DEFINE*/
K_FIFO_DEFINE(kfifo);

View file

@ -28,7 +28,7 @@
#include "test_fifo.h"
#define STACK_SIZE 512
#define STACK_SIZE (512 + CONFIG_TEST_EXTRA_STACKSIZE)
#define LIST_LEN 4
#define LOOPS 32

View file

@ -19,7 +19,7 @@
#include "test_lifo.h"
#define STACK_SIZE 512
#define STACK_SIZE (512 + CONFIG_TEST_EXTRA_STACKSIZE)
#define LIST_LEN 2
/**TESTPOINT: init via K_LIFO_DEFINE*/
K_LIFO_DEFINE(klifo);

View file

@ -28,7 +28,7 @@
#include "test_lifo.h"
#define STACK_SIZE 512
#define STACK_SIZE (512 + CONFIG_TEST_EXTRA_STACKSIZE)
#define LIST_LEN 4
#define LOOPS 32

View file

@ -23,7 +23,7 @@
#include <ztest.h>
#define TIMEOUT 100
#define STACK_SIZE 512
#define STACK_SIZE (512 + CONFIG_TEST_EXTRA_STACKSIZE)
#define MAIL_LEN 64

View file

@ -35,7 +35,7 @@
#include <ztest.h>
#include <atomic.h>
#define THREAD_NUM 4
#define STACK_SIZE 512
#define STACK_SIZE (512 + CONFIG_TEST_EXTRA_STACKSIZE)
#define POOL_NUM 2
#define TIMEOUT 200
#define BLK_SIZE_MIN 4

View file

@ -11,7 +11,7 @@
#ifdef CONFIG_RISCV32
#define STACK_SIZE 512
#else
#define STACK_SIZE 256
#define STACK_SIZE (256 + CONFIG_TEST_EXTRA_STACKSIZE)
#endif
/*local variables*/

View file

@ -12,7 +12,7 @@
*/
#include <ztest.h>
#define STACK_SIZE 256
#define STACK_SIZE (256 + CONFIG_TEST_EXTRA_STACKSIZE)
static char __noinit __stack tstack[STACK_SIZE];
static int execute_flag;

View file

@ -14,7 +14,7 @@
#include <ztest.h>
#define STACK_SIZE 256
#define STACK_SIZE (256 + CONFIG_TEST_EXTRA_STACKSIZE)
static char __noinit __stack tstack[STACK_SIZE];
static char tp1[8];

View file

@ -12,7 +12,7 @@
*/
#include <ztest.h>
#define STACK_SIZE 256
#define STACK_SIZE (256 + CONFIG_TEST_EXTRA_STACKSIZE)
static char __noinit __stack tstack[STACK_SIZE];
static int last_prio;

View file

@ -13,7 +13,7 @@
#if defined(CONFIG_RISCV32)
#define STACK_SIZE 512
#else
#define STACK_SIZE 256
#define STACK_SIZE (256 + CONFIG_TEST_EXTRA_STACKSIZE)
#endif
struct thread_data {

View file

@ -31,7 +31,7 @@
#include <board.h>
#endif
#define FIBER_STACKSIZE 384
#define FIBER_STACKSIZE (384 + CONFIG_TEST_EXTRA_STACKSIZE)
#define FIBER_PRIORITY 4
#define THREAD_SELF_CMD 0

View file

@ -37,9 +37,9 @@
#include <util_test_common.h>
#if defined(CONFIG_ASSERT) && defined(CONFIG_DEBUG)
#define FIBER_STACKSIZE 512
#define FIBER_STACKSIZE (512 + CONFIG_TEST_EXTRA_STACKSIZE)
#else
#define FIBER_STACKSIZE 384
#define FIBER_STACKSIZE (384 + CONFIG_TEST_EXTRA_STACKSIZE)
#endif
#define FIBER_PRIORITY 4

View file

@ -25,9 +25,9 @@
#include <util_test_common.h>
#if defined(CONFIG_ASSERT) && defined(CONFIG_DEBUG)
#define FIBER_STACKSIZE 384
#define FIBER_STACKSIZE (384 + CONFIG_TEST_EXTRA_STACKSIZE)
#else
#define FIBER_STACKSIZE 256
#define FIBER_STACKSIZE (256 + CONFIG_TEST_EXTRA_STACKSIZE)
#endif
#define TEST_FIBER_PRIORITY 4