summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAngus Gratton <angus@redyak.com.au>2024-10-16 16:43:13 +1100
committerDamien George <damien@micropython.org>2025-02-03 15:02:02 +1100
commitd642cce27a9a07e043211f099c31fca390f96f1a (patch)
treeac42bd3cc0ac688e50b64176c005b4d2b983096a
parent97f444bfa04408dd510f118baaea5760b93bd892 (diff)
unix: Use the bare metal mbedTLS config in the coverage buiid.
This allows coverage to test MicroPython-specific features such as the tracked alloc cleanups added in the parent commit. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
-rw-r--r--ports/unix/mbedtls/mbedtls_config_port.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/ports/unix/mbedtls/mbedtls_config_port.h b/ports/unix/mbedtls/mbedtls_config_port.h
index c619de9b8..aec65e658 100644
--- a/ports/unix/mbedtls/mbedtls_config_port.h
+++ b/ports/unix/mbedtls/mbedtls_config_port.h
@@ -32,7 +32,18 @@
// Enable mbedtls modules
#define MBEDTLS_TIMING_C
+#if defined(MICROPY_UNIX_COVERAGE)
+// Test the "bare metal" memory management in the coverage build
+#define MICROPY_MBEDTLS_CONFIG_BARE_METAL (1)
+#endif
+
// Include common mbedtls configuration.
#include "extmod/mbedtls/mbedtls_config_common.h"
+#if defined(MICROPY_UNIX_COVERAGE)
+// See comment above, but fall back to the default platform entropy functions
+#undef MBEDTLS_ENTROPY_HARDWARE_ALT
+#undef MBEDTLS_NO_PLATFORM_ENTROPY
+#endif
+
#endif /* MICROPY_INCLUDED_MBEDTLS_CONFIG_H */