2023-05-11 02:50:27 -04:00
|
|
|
/*
|
|
|
|
* SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Unlicense OR CC0-1.0
|
|
|
|
*/
|
|
|
|
|
2023-05-26 08:45:48 -04:00
|
|
|
#include "freertos/FreeRTOS.h"
|
|
|
|
#include "freertos/task.h"
|
|
|
|
#include "unity.h"
|
2023-05-11 02:50:27 -04:00
|
|
|
#include "unity_fixture.h"
|
|
|
|
#include "unity_fixture_extras.h"
|
|
|
|
|
|
|
|
static void run_all_tests(void)
|
|
|
|
{
|
2023-05-11 05:58:02 -04:00
|
|
|
#if CONFIG_SOC_MPI_SUPPORTED
|
2023-05-11 02:50:27 -04:00
|
|
|
RUN_TEST_GROUP(mpi);
|
2023-05-11 05:58:02 -04:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#if CONFIG_SOC_ECC_SUPPORTED
|
|
|
|
RUN_TEST_GROUP(ecc);
|
|
|
|
#endif
|
2023-05-11 07:01:00 -04:00
|
|
|
|
2023-08-28 06:14:47 -04:00
|
|
|
#if CONFIG_SOC_AES_SUPPORTED
|
|
|
|
RUN_TEST_GROUP(aes);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if CONFIG_SOC_SHA_SUPPORTED
|
|
|
|
#if !CONFIG_SOC_SHA_SUPPORT_PARALLEL_ENG
|
|
|
|
RUN_TEST_GROUP(sha);
|
|
|
|
#endif /* !CONFIG_SOC_SHA_SUPPORT_PARALLEL_ENG*/
|
|
|
|
#endif
|
|
|
|
|
2024-03-13 03:40:47 -04:00
|
|
|
#if CONFIG_SOC_KEY_MANAGER_SUPPORTED
|
|
|
|
RUN_TEST_GROUP(key_manager);
|
|
|
|
#endif
|
|
|
|
|
2023-05-11 07:01:00 -04:00
|
|
|
#if CONFIG_IDF_ENV_FPGA
|
|
|
|
|
2023-08-28 07:21:36 -04:00
|
|
|
#if CONFIG_SOC_HMAC_SUPPORTED && CONFIG_CRYPTO_TEST_APP_ENABLE_HMAC_TESTS
|
2023-05-11 07:01:00 -04:00
|
|
|
RUN_TEST_GROUP(hmac);
|
|
|
|
#endif
|
|
|
|
|
2023-08-28 07:21:36 -04:00
|
|
|
#if CONFIG_SOC_DIG_SIGN_SUPPORTED && CONFIG_CRYPTO_TEST_APP_ENABLE_DS_TESTS
|
2023-05-11 08:34:48 -04:00
|
|
|
RUN_TEST_GROUP(ds);
|
2023-05-11 07:01:00 -04:00
|
|
|
#endif
|
2023-05-11 08:34:48 -04:00
|
|
|
|
2023-08-28 07:21:36 -04:00
|
|
|
#if CONFIG_SOC_ECDSA_SUPPORTED && CONFIG_CRYPTO_TEST_APP_ENABLE_ECDSA_TESTS
|
2023-05-15 02:50:03 -04:00
|
|
|
RUN_TEST_GROUP(ecdsa)
|
|
|
|
#endif
|
|
|
|
|
2023-05-11 08:34:48 -04:00
|
|
|
#endif /* CONFIG_IDF_ENV_FPGA */
|
2023-05-11 02:50:27 -04:00
|
|
|
}
|
|
|
|
|
2023-05-26 08:45:48 -04:00
|
|
|
static void test_task(void *pvParameters)
|
2023-05-11 02:50:27 -04:00
|
|
|
{
|
2023-05-26 08:45:48 -04:00
|
|
|
vTaskDelay(2); /* Delay a bit to let the main task be deleted */
|
2023-05-11 02:50:27 -04:00
|
|
|
UNITY_MAIN_FUNC(run_all_tests);
|
2023-05-26 08:45:48 -04:00
|
|
|
vTaskDelete(NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
void app_main(void)
|
|
|
|
{
|
|
|
|
xTaskCreatePinnedToCore(test_task, "testTask", CONFIG_UNITY_FREERTOS_STACK_SIZE, NULL, CONFIG_UNITY_FREERTOS_PRIORITY, NULL, CONFIG_UNITY_FREERTOS_CPU);
|
2023-05-11 02:50:27 -04:00
|
|
|
}
|