Path: blob/master/tools/unittests/kdoc-test-schema.yaml
170831 views
# SPDX-License-Identifier: GPL-2.01# Copyright(c) 2026: Mauro Carvalho Chehab <[email protected]>.23# KDoc Test File Schema45# This schema contains objects and properties needed to run kernel-doc6# self-tests.78$schema: "http://json-schema.org/draft-07/schema#"910tests:11type: array12minItems: 113description: |14A list of kernel-doc tests.1516properties:17type: object18properties:19name:20type: string21description: |22Test name. Should be an unique identifier within the schema.23Don't prepend it with "test", as the dynamic test creation will24do it.2526description:27type: string28description: |29Test description3031source:32type: string33description: |34C source code that should be parsed by kernel-doc.3536fname:37type: string38description: |39The filename that contains the element.40When placing real testcases, please use here the name of41the C file (or header) from where the source code was picked.4243exports:44type: array45items: { type: string }46description: |47A list of export identifiers that are expected when parsing source.4849expected:50type: array51minItems: 152description: |53A list of expected values. This list consists on objects to check54both kdoc_parser and/or kdoc_output objects.5556items:57type: object58properties:59#60# kdoc_item61#62kdoc_item:63type: object64description: |65Object expected to represent the C source code after parsed66by tools/lib/python/kdoc/kdoc_parser.py KernelDoc class.67See tools/lib/python/kdoc/kdoc_item.py for its contents.6869properties:70name:71type: string72description: |73The name of the identifier (function name, struct name, etc).74type:75type: string76description: |77Type of the object, as filled by kdoc_parser. can be:78- enum79- typedef80- union81- struct82- var83- function84declaration_start_line:85type: integer86description: |87The line number where the kernel-doc markup started.88The first line of the code is line number 1.89sections:90type: object91additionalProperties: { type: string }92description: |93Sections inside the kernel-doc markups:94- "description"95- "return"96- any other part of the markup that starts with "something:"97sections_start_lines:98type: object99additionalProperties: { type: integer }100description: |101a list of section names and the starting line of it.102parameterlist:103type: array104items: { type: string }105description: |106Ordered list of parameter names.107108parameterdesc_start_lines:109type: object110additionalProperties: { type: integer }111description: |112Mapping from parameter name to the line where its113description starts.114parameterdescs:115type: object116additionalProperties: { type: string }117description: |118Mapping from parameter name to its description.119120parametertypes:121type: object122additionalProperties: { type: string }123description: |124Mapping from parameter name to its type.125126other_stuff:127type: object128additionalProperties: {}129description: |130Extra properties that will be stored at the item.131Should match what kdoc_output expects.132133required:134- name135- type136- declaration_start_line137138rst:139type: string140description: |141The expected output for RestOutput class.142143man:144type: string145description: |146The expected output for ManOutput class.147148anyOf:149required: kdoc_item150required: source151152required:153- name154- fname155- expected156157158