unity: allow test task stack size to be configured

This commit is contained in:
Ivan Grokhotkov 2018-05-02 15:39:39 +08:00
parent b2f498f7da
commit 7663782e8d
4 changed files with 21 additions and 3 deletions

View file

@ -0,0 +1,15 @@
menu "Unity test framework"
config UNITY_FREERTOS_PRIORITY
int "Priority of Unity test task"
default 5
config UNITY_FREERTOS_CPU
int "CPU to run Unity test task on"
default 0
config UNITY_FREERTOS_STACK_SIZE
int "Stack size of Unity test task, in bytes"
default 8192
endmenu

View file

@ -8,10 +8,12 @@
// Adapt Unity to our environment, disable FP support
#include <esp_err.h>
#include <sdkconfig.h>
/* Some definitions applicable to Unity running in FreeRTOS */
#define UNITY_FREERTOS_PRIORITY 5
#define UNITY_FREERTOS_CPU 0
#define UNITY_FREERTOS_PRIORITY CONFIG_UNITY_FREERTOS_PRIORITY
#define UNITY_FREERTOS_CPU CONFIG_UNITY_FREERTOS_CPU
#define UNITY_FREERTOS_STACK_SIZE CONFIG_UNITY_FREERTOS_STACK_SIZE
#define UNITY_EXCLUDE_FLOAT
#define UNITY_EXCLUDE_DOUBLE

View file

@ -1 +1,2 @@
TEST_COMPONENTS=libsodium
CONFIG_UNITY_FREERTOS_STACK_SIZE=12288

View file

@ -19,6 +19,6 @@ void app_main()
// Note: if unpinning this task, change the way run times are calculated in
// unity_platform
xTaskCreatePinnedToCore(unityTask, "unityTask", 8192, NULL,
xTaskCreatePinnedToCore(unityTask, "unityTask", UNITY_FREERTOS_STACK_SIZE, NULL,
UNITY_FREERTOS_PRIORITY, NULL, UNITY_FREERTOS_CPU);
}