fix(hal/test_apps): update sha testcases flow

This commit updates the flow of sha testcases.
Previously, DMA test cases were still executed even after disabling the related feature.
This commit is contained in:
nilesh.kale 2024-02-15 10:41:32 +05:30
parent 0a25176282
commit 7ce39ffa8a

View File

@ -1,5 +1,5 @@
/* /*
* SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD * SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD
* *
* SPDX-License-Identifier: CC0-1.0 * SPDX-License-Identifier: CC0-1.0
*/ */
@ -221,11 +221,12 @@ TEST(sha, test_sha1_block)
test_sha1(0); test_sha1(0);
} }
#if SOC_SHA_SUPPORT_DMA
TEST(sha, test_sha1_dma) TEST(sha, test_sha1_dma)
{ {
test_sha1(1); test_sha1(1);
} }
#endif /* SOC_SHA_SUPPORT_DMA*/
#endif /* SOC_SHA_SUPPORT_SHA1 */ #endif /* SOC_SHA_SUPPORT_SHA1 */
@ -236,11 +237,12 @@ TEST(sha, test_sha224_block)
test_sha224(0); test_sha224(0);
} }
#if SOC_SHA_SUPPORT_DMA
TEST(sha, test_sha224_dma) TEST(sha, test_sha224_dma)
{ {
test_sha224(1); test_sha224(1);
} }
#endif /* SOC_SHA_SUPPORT_DMA*/
#endif /* SOC_SHA_SUPPORT_SHA224 */ #endif /* SOC_SHA_SUPPORT_SHA224 */
@ -251,11 +253,12 @@ TEST(sha, test_sha256_block)
test_sha256(0); test_sha256(0);
} }
#if SOC_SHA_SUPPORT_DMA
TEST(sha, test_sha256_dma) TEST(sha, test_sha256_dma)
{ {
test_sha256(1); test_sha256(1);
} }
#endif /* SOC_SHA_SUPPORT_DMA*/
#endif /* SOC_SHA_SUPPORT_SHA256 */ #endif /* SOC_SHA_SUPPORT_SHA256 */
@ -266,10 +269,12 @@ TEST(sha, test_sha384_block)
test_sha384(0); test_sha384(0);
} }
#if SOC_SHA_SUPPORT_DMA
TEST(sha, test_sha384_dma) TEST(sha, test_sha384_dma)
{ {
test_sha384(1); test_sha384(1);
} }
#endif /* SOC_SHA_SUPPORT_DMA*/
#endif /* SOC_SHA_SUPPORT_SHA384 */ #endif /* SOC_SHA_SUPPORT_SHA384 */
#if SOC_SHA_SUPPORT_SHA512 #if SOC_SHA_SUPPORT_SHA512
@ -279,10 +284,12 @@ TEST(sha, test_sha512_block)
test_sha512(0); test_sha512(0);
} }
#if SOC_SHA_SUPPORT_DMA
TEST(sha, test_sha512_dma) TEST(sha, test_sha512_dma)
{ {
test_sha512(1); test_sha512(1);
} }
#endif /* SOC_SHA_SUPPORT_DMA*/
#endif /* SOC_SHA_SUPPORT_SHA512 */ #endif /* SOC_SHA_SUPPORT_SHA512 */
@ -293,11 +300,12 @@ TEST(sha, test_sha512t_block)
test_sha512t(0); test_sha512t(0);
} }
#if SOC_SHA_SUPPORT_DMA
TEST(sha, test_sha512t_dma) TEST(sha, test_sha512t_dma)
{ {
test_sha512t(1); test_sha512t(1);
} }
#endif /* SOC_SHA_SUPPORT_DMA*/
#endif // SOC_SHA_SUPPORT_SHA512_T #endif // SOC_SHA_SUPPORT_SHA512_T
#endif // SOC_SHA_SUPPORTED #endif // SOC_SHA_SUPPORTED
@ -308,32 +316,44 @@ TEST_GROUP_RUNNER(sha)
#if SOC_SHA_SUPPORT_SHA1 #if SOC_SHA_SUPPORT_SHA1
RUN_TEST_CASE(sha, test_sha1_block); RUN_TEST_CASE(sha, test_sha1_block);
#if SOC_SHA_SUPPORT_DMA
RUN_TEST_CASE(sha, test_sha1_dma); RUN_TEST_CASE(sha, test_sha1_dma);
#endif /* SOC_SHA_SUPPORT_DMA*/
#endif /* SOC_SHA_SUPPORT_SHA1 */ #endif /* SOC_SHA_SUPPORT_SHA1 */
#if SOC_SHA_SUPPORT_SHA224 #if SOC_SHA_SUPPORT_SHA224
RUN_TEST_CASE(sha, test_sha224_block); RUN_TEST_CASE(sha, test_sha224_block);
#if SOC_SHA_SUPPORT_DMA
RUN_TEST_CASE(sha, test_sha224_dma); RUN_TEST_CASE(sha, test_sha224_dma);
#endif /* SOC_SHA_SUPPORT_DMA*/
#endif /* SOC_SHA_SUPPORT_SHA224 */ #endif /* SOC_SHA_SUPPORT_SHA224 */
#if SOC_SHA_SUPPORT_SHA256 #if SOC_SHA_SUPPORT_SHA256
RUN_TEST_CASE(sha, test_sha256_block); RUN_TEST_CASE(sha, test_sha256_block);
#if SOC_SHA_SUPPORT_DMA
RUN_TEST_CASE(sha, test_sha256_dma); RUN_TEST_CASE(sha, test_sha256_dma);
#endif /* SOC_SHA_SUPPORT_DMA*/
#endif /* SOC_SHA_SUPPORT_SHA256 */ #endif /* SOC_SHA_SUPPORT_SHA256 */
#if SOC_SHA_SUPPORT_SHA384 #if SOC_SHA_SUPPORT_SHA384
RUN_TEST_CASE(sha, test_sha384_block); RUN_TEST_CASE(sha, test_sha384_block);
#if SOC_SHA_SUPPORT_DMA
RUN_TEST_CASE(sha, test_sha384_dma); RUN_TEST_CASE(sha, test_sha384_dma);
#endif /* SOC_SHA_SUPPORT_DMA*/
#endif /* SOC_SHA_SUPPORT_SHA384 */ #endif /* SOC_SHA_SUPPORT_SHA384 */
#if SOC_SHA_SUPPORT_SHA512 #if SOC_SHA_SUPPORT_SHA512
RUN_TEST_CASE(sha, test_sha512_block); RUN_TEST_CASE(sha, test_sha512_block);
#if SOC_SHA_SUPPORT_DMA
RUN_TEST_CASE(sha, test_sha512_dma); RUN_TEST_CASE(sha, test_sha512_dma);
#endif /* SOC_SHA_SUPPORT_DMA*/
#endif /* SOC_SHA_SUPPORT_SHA512 */ #endif /* SOC_SHA_SUPPORT_SHA512 */
#if SOC_SHA_SUPPORT_SHA512_T #if SOC_SHA_SUPPORT_SHA512_T
RUN_TEST_CASE(sha, test_sha512t_block); RUN_TEST_CASE(sha, test_sha512t_block);
#if SOC_SHA_SUPPORT_DMA
RUN_TEST_CASE(sha, test_sha512t_dma); RUN_TEST_CASE(sha, test_sha512t_dma);
#endif /* SOC_SHA_SUPPORT_DMA*/
#endif // SOC_SHA_SUPPORT_SHA512_T #endif // SOC_SHA_SUPPORT_SHA512_T
#endif /* SOC_SHA_SUPPORTED */ #endif /* SOC_SHA_SUPPORTED */