tools/unittests/kdoc-test-schema.yaml

Source file repositories/reference/linux-study-clean/tools/unittests/kdoc-test-schema.yaml

File Facts

System
Linux kernel
Corpus path
tools/unittests/kdoc-test-schema.yaml
Extension
.yaml
Size
4898 bytes
Lines
157
Domain
Support Tooling And Documentation
Bucket
tools
Inferred role
Support Tooling And Documentation: configuration, schema, or hardware description
Status
atlas-only

Why This File Exists

Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.

Dependency Surface

Detected Declarations

Annotated Snippet

# SPDX-License-Identifier: GPL-2.0
# Copyright(c) 2026: Mauro Carvalho Chehab <mchehab@kernel.org>.

# KDoc Test File Schema

# This schema contains objects and properties needed to run kernel-doc
# self-tests.

$schema: "http://json-schema.org/draft-07/schema#"

tests:
  type: array
  minItems: 1
  description: |
    A list of kernel-doc tests.

  properties:
    type: object
    properties:
      name:
        type: string
        description: |
          Test name. Should be an unique identifier within the schema.
          Don't prepend it with "test", as the dynamic test creation will
          do it.

      description:
        type: string
        description: |
          Test description

      source:
        type: string
        description: |
          C source code that should be parsed by kernel-doc.

      fname:
        type: string
        description: |
          The filename that contains the element.
          When placing real testcases, please use here the name of
          the C file (or header) from where the source code was picked.

      exports:
        type: array
        items: { type: string }
        description: |
          A list of export identifiers that are expected when parsing source.

      expected:
        type: array
        minItems: 1
        description: |
          A list of expected values. This list consists on objects to check
          both kdoc_parser and/or kdoc_output objects.

        items:
          type: object
          properties:
            #
            #  kdoc_item
            #
            kdoc_item:
              type: object
              description: |
                Object expected to represent the C source code after parsed
                by tools/lib/python/kdoc/kdoc_parser.py KernelDoc class.
                See tools/lib/python/kdoc/kdoc_item.py for its contents.

              properties:

Annotation

Implementation Notes