From 2c81ccd45e14f8a94906bdf4fbf90411c8432a9c Mon Sep 17 00:00:00 2001 From: Christophe Favergeon Date: Wed, 26 Jun 2024 07:17:24 +0200 Subject: [PATCH] In test mode, cpp github action is using malloc allocator --- dsppp/allocator.cpp | 9 ++++++++- dsppp/allocator.h | 7 ++++++- dsppp/test.csolution.yml | 1 - dsppp/tests/common_tests.h | 8 ++++++++ 4 files changed, 22 insertions(+), 3 deletions(-) diff --git a/dsppp/allocator.cpp b/dsppp/allocator.cpp index aaf61cc5..0027ab7c 100644 --- a/dsppp/allocator.cpp +++ b/dsppp/allocator.cpp @@ -1,5 +1,7 @@ #include "allocator.h" +#if !defined(TESTMODE) + #define ALLOC_POOL(BYTES,NB) \ MemoryPool vecPool_##BYTES(NB); @@ -11,11 +13,13 @@ std::map current_stats; std::map max_stats; std::map current_dyn_stats; +#endif + void print_map(std::string comment) { std::cout << comment << "\r\n"; -#if !defined(POOL_ALLOCATOR) +#if !defined(POOL_ALLOCATOR) && !defined(TESTMODE) std::size_t total_static=0; std::size_t total_dynamic=0; @@ -64,6 +68,8 @@ void print_map(std::string comment) #endif } +#if !defined(TESTMODE) + void reset_current_stats() { #if !defined(POOL_ALLOCATOR) @@ -96,3 +102,4 @@ void check_current_stats() #endif } +#endif diff --git a/dsppp/allocator.h b/dsppp/allocator.h index 05146b62..71772478 100644 --- a/dsppp/allocator.h +++ b/dsppp/allocator.h @@ -60,6 +60,7 @@ struct pool_allocator { }; +#if !defined(TESTMODE) #if defined(POOL_ALLOCATOR) #include "allocation/all.h" #endif @@ -122,6 +123,10 @@ struct stat_allocator { }; -extern void print_map(std::string comment); extern void check_current_stats(); extern void reset_current_stats(); + +#endif + +extern void print_map(std::string comment); + diff --git a/dsppp/test.csolution.yml b/dsppp/test.csolution.yml index 65685fcf..91e7e46b 100644 --- a/dsppp/test.csolution.yml +++ b/dsppp/test.csolution.yml @@ -7,7 +7,6 @@ solution: packs: - pack: ARM::CMSIS@6.0.0 - - pack: ARM::CMSIS-DSP@1.15.0 - pack: ARM::V2M_MPS3_SSE_300_BSP@1.4.0 - pack: ARM::CMSIS-Compiler@2.0.0 - pack: ARM::Cortex_DFP@1.0.0 diff --git a/dsppp/tests/common_tests.h b/dsppp/tests/common_tests.h index 2db59ade..7c6c9d19 100644 --- a/dsppp/tests/common_tests.h +++ b/dsppp/tests/common_tests.h @@ -25,7 +25,14 @@ using namespace arm_cmsis_dsp; * */ +#if defined(TESTMODE) + template + using PVector = Vector; + + template + using PMat = Matrix; +#else #if defined(POOL_ALLOCATOR) template @@ -43,6 +50,7 @@ using namespace arm_cmsis_dsp; using PMat = Matrix; #endif +#endif template using PView = VectorView;