From 9ee360adb8fe805a98389c1036b8c9f6548e997c Mon Sep 17 00:00:00 2001 From: Ronald Cron Date: Wed, 10 Dec 2025 16:49:34 +0100 Subject: [PATCH] test_driver.py: Documentation same header basename limitation Signed-off-by: Ronald Cron --- scripts/mbedtls_framework/test_driver.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/scripts/mbedtls_framework/test_driver.py b/scripts/mbedtls_framework/test_driver.py index 025e04a28..01964fc3c 100644 --- a/scripts/mbedtls_framework/test_driver.py +++ b/scripts/mbedtls_framework/test_driver.py @@ -258,6 +258,27 @@ class TestDriverGenerator: becomes #include "mbedtls/private/libtestdriver1-aes.h" + LIMITATION: + The current implementation does not correctly handle the case + where a built-in header and a non–built-in header share the same + basename. In principle, only inclusions of built-in headers + should be rewritten, while inclusions of non–built-in headers + should be left unchanged. However, the current logic only matches + on the basename, so both are rewritten. + + For example, if both `include/psa/foo.h` (non–built-in) and + `drivers/builtin/include/mbedtls/foo.h` (built-in) exist, then + in the test driver: + + - `#include ` should not be rewritten + - `#include ` should be rewritten to + `#include ` + + With the current basename-only matching, both inclusions are + rewritten, which is incorrect. No practical implications + currently, such same header basename case does not occur in the + code base. + 2. Rename selected identifiers Each identifier in `identifiers_to_prefix` is prefixed with `driver`. Case is preserved: if the identifier is all-uppercase, then the