3.1.31. waf_tools.preprocess
Utility functions and waf tasks to generate cleaned header files from preprocessed headers.
This waf tool provides the preprocessing pipeline required by the mock tool.
It takes raw C header files, runs them through the C preprocessor (cc -E),
and then extracts only the lines that belong to the original header - stripping
all content pulled in via transitive #include directives.
The result is a “clean” header suitable for consumption by CMock.
3.1.31.1. Usage
This module is not loaded directly via ctx.load(). Instead it is imported
by the mock tool:
import preprocess
preprocessed_nodes = preprocess.create_preprocessed_files(self, headers, test_file)
for node in preprocessed_nodes:
clean_node = preprocess.create_clean_header(self, node)
3.1.31.2. Dependencies
Host C compiler (
env.CC) capable of-EpreprocessingUsed exclusively by the
mocktool in this toolchain
Functions
|
Normalize a text line to UTF-8, ignoring invalid byte sequences. |
|
Create a clean_header waf task for the given preprocessed node and return its output node. |
|
Create preprocessing tasks for the given nodes, ensuring they run after the appropriate HAL build tasks, and return the resulting preprocessed output nodes. |
|
Extract logical source lines for the given header from a preprocessed file. |
Classes
|
Task that preprocesses header files. |
|
Waf task that creates a cleaned header file from a preprocessed header input. |