test_driver.py: Documentation same header basename limitation

Signed-off-by: Ronald Cron <[email protected]>
This commit is contained in:
Ronald Cron
2025-12-11 14:40:51 +01:00
parent 47f3c9fe84
commit 9ee360adb8
+21
View File
@@ -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 nonbuilt-in header share the same
basename. In principle, only inclusions of built-in headers
should be rewritten, while inclusions of nonbuilt-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` (nonbuilt-in) and
`drivers/builtin/include/mbedtls/foo.h` (built-in) exist, then
in the test driver:
- `#include <psa/foo.h>` should not be rewritten
- `#include <mbedtls/foo.h>` should be rewritten to
`#include <mbedtls/libtestdriver1-foo.h>`
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