fix wolfssl unit test on ESP-IDF

This commit is contained in:
Hideki Miyazaki
2020-12-15 16:35:04 +09:00
parent 54f072fd8d
commit 99d4a7417a
3 changed files with 6 additions and 22 deletions

View File

@@ -1,6 +1,6 @@
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DNO_MAIN_DRIVER -DWOLFSSL_USER_SETTINGS") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DNO_MAIN_DRIVER -DWOLFSSL_USER_SETTINGS")
set(COMPONENT_SRCDIRS ".") set(COMPONENT_SRCS "test_wolfssl.c")
set(COMPONENT_ADD_INCLUDEDIRS ".") set(COMPONENT_ADD_INCLUDEDIRS ".")
set(COMPONENT_REQUIRES unity test_utils wolfssl) set(COMPONENT_REQUIRES unity test_utils wolfssl)

View File

@@ -3,9 +3,8 @@
The test contains of wolfSSL unit-test app on Unity. The test contains of wolfSSL unit-test app on Unity.
When you want to run the app When you want to run the app
1. Copy *test.c* file at /path/to/esp-idf/components/wolfssl/wolfcrypt/test/ folder to the wolfssl/test folder 1. Go to /esp-idf/tools/unit-test-app/ folder
2. Go to /esp-idf/tools/unit-test-app/ folder 2. "idf.py menuconfig" to configure unit test app.
3. "idf.py menuconfig" to configure unit test app. 3. "idf.py -T wolfssl build" to build wolfssl unit test app.
4. "idf.py -T wolfssl build" to build wolfssl unit test app.
See [https://docs.espressif.com/projects/esp-idf/en/latest/api-guides/unit-tests.html] for more information about unit test app. See [https://docs.espressif.com/projects/esp-idf/en/latest/api-guides/unit-tests.html] for more information about unit test app.

View File

@@ -34,23 +34,12 @@ static xSemaphoreHandle exit_semaph;
static volatile bool exit_loop=false; static volatile bool exit_loop=false;
static uint64_t startTime = 0; static uint64_t startTime = 0;
#include "../wolfcrypt/test/test.c"
#define SHA_STACK_SIZE (20*1024) #define SHA_STACK_SIZE (20*1024)
#define TIMES_SHA 500 #define TIMES_SHA 500
#define TIMES_AES 100 #define TIMES_AES 100
#ifndef NO_SHA
int sha_test();
#endif
#ifndef NO_SHA256
int sha256_test();
#endif
#ifdef WOLFSSL_SHA384
int sha384_test(void);
#endif
#ifdef WOLFSSL_SHA512
int sha512_test(void);
#endif
static uint64_t rsa_elapsedTime = 0; static uint64_t rsa_elapsedTime = 0;
static void esp32TimerStart() static void esp32TimerStart()
{ {
@@ -64,7 +53,6 @@ static uint64_t esp32elapsedTime()
} }
#ifndef NO_RSA #ifndef NO_RSA
int rsa_test(void);
static void tskRsa_Test(void *pvParam) static void tskRsa_Test(void *pvParam)
{ {
int ret = 0; int ret = 0;
@@ -89,7 +77,6 @@ static void tskRsa_Test(void *pvParam)
#endif #endif
#ifndef NO_AES #ifndef NO_AES
int aes_test(void);
static void tskAes_Test(void *pvParam) static void tskAes_Test(void *pvParam)
{ {
int ret = 0; int ret = 0;
@@ -131,7 +118,6 @@ static void tskAesGcm_Test(void *pvParam)
} }
#ifdef WOLFSSL_AES_192 #ifdef WOLFSSL_AES_192
int aes192_test(void);
static void tskAes192_Test(void *pvParam) static void tskAes192_Test(void *pvParam)
{ {
int ret = 0; int ret = 0;
@@ -151,7 +137,6 @@ static void tskAes192_Test(void *pvParam)
} }
#endif #endif
#ifdef WOLFSSL_AES_256 #ifdef WOLFSSL_AES_256
int aes256_test(void);
static void tskAes256_Test(void *pvParam) static void tskAes256_Test(void *pvParam)
{ {
int ret = 0; int ret = 0;