]> granicus.if.org Git - esp-idf/commitdiff
unity: allow test task stack size to be configured
authorIvan Grokhotkov <ivan@espressif.com>
Wed, 2 May 2018 07:39:39 +0000 (15:39 +0800)
committerIvan Grokhotkov <ivan@espressif.com>
Mon, 11 Jun 2018 15:26:56 +0000 (23:26 +0800)
tools/unit-test-app/components/unity/Kconfig [new file with mode: 0644]
tools/unit-test-app/components/unity/include/unity_config.h
tools/unit-test-app/configs/libsodium
tools/unit-test-app/main/app_main.c

diff --git a/tools/unit-test-app/components/unity/Kconfig b/tools/unit-test-app/components/unity/Kconfig
new file mode 100644 (file)
index 0000000..642d76f
--- /dev/null
@@ -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
index bb672ccc959eba51fbf08559473a6bc3ac7ebcc7..19f73b1cee2580c33e0eb4caed3a8a3952208b66 100644 (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
index fa3c2d5eee20182790176652f43f3adb6c410ce1..f43b22a4c7f53e24f836d6f830f8c362e3b6e87f 100644 (file)
@@ -1 +1,2 @@
 TEST_COMPONENTS=libsodium
+CONFIG_UNITY_FREERTOS_STACK_SIZE=12288
index f1c18fcbfb0c1979338c20418f2e9ac63c183c0b..1dbcdd3b0c9ac1924ae162e326f605ce79f8a44f 100644 (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);
 }