tools/unittests/test_kdoc_parser.py
Source file repositories/reference/linux-study-clean/tools/unittests/test_kdoc_parser.py
File Facts
- System
- Linux kernel
- Corpus path
tools/unittests/test_kdoc_parser.py- Extension
.py- Size
- 16045 bytes
- Lines
- 561
- Domain
- Support Tooling And Documentation
- Bucket
- tools
- Inferred role
- Support Tooling And Documentation: exported/initcall integration point
- Status
- integration implementation candidate
Why This File Exists
Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
Dependency Surface
- No C-style include directives detected by the generator.
Detected Declarations
function clean_whitespcexport function3
Annotated Snippet
int function3(char *arg1) { return 0; };
EXPORT_SYMBOL(function3);
"""
EXPECTED = [{
'name': 'function3',
'type': 'function',
'declaration_start_line': 2,
'sections_start_lines': {
'Description': 4,
'Return': 7,
},
'sections': {
'Description': 'Does nothing\n\n',
'Return': '\nalways return 0.\n'
},
'sections_start_lines': {
'Description': 4,
'Return': 7,
},
'parameterdescs': {'arg1': '@arg1 does nothing\n'},
'parameterlist': ['arg1'],
'parameterdesc_start_lines': {'arg1': 3},
'parametertypes': {'arg1': 'char *arg1'},
'other_stuff': {
'func_macro': False,
'functiontype': 'int',
'purpose': 'Exported function',
'typedef': False
},
}]
EXPORTS = {"function3"}
def test_parse_pass(self):
"""
Test if export_symbol is properly handled.
"""
self.run_test(self.SOURCE, self.EXPECTED, self.EXPORTS)
@unittest.expectedFailure
def test_no_exports(self):
"""
Test if export_symbol is properly handled.
"""
self.run_test(self.SOURCE, [], {})
@unittest.expectedFailure
def test_with_empty_expected(self):
"""
Test if export_symbol is properly handled.
"""
self.run_test(self.SOURCE, [], self.EXPORTS)
@unittest.expectedFailure
def test_with_unfilled_expected(self):
"""
Test if export_symbol is properly handled.
"""
self.run_test(self.SOURCE, [{}], self.EXPORTS)
@unittest.expectedFailure
def test_with_default_expected(self):
"""
Test if export_symbol is properly handled.
"""
Annotation
- Detected declarations: `function clean_whitespc`, `export function3`.
- Atlas domain: Support Tooling And Documentation / tools.
- Implementation status: integration implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.