요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
.. SPDX-License-Identifier: GPL-2.0
============
Resource API
============
This file documents the KUnit resource API.
Most users won't need to use this API directly, power users can use it to store
state on a per-test basis, register custom cleanup actions, and more.
.. kernel-doc:: include/kunit/resource.h
:internal:
Managed Devices
---------------
Functions for using KUnit-managed struct device and struct device_driver.
Include ``kunit/device.h`` to use these.
.. kernel-doc:: include/kunit/device.h
:internal:
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
KUnit Resource API
1-14SPDX 라이선스 식별자: GPL-2.0
Resource API
이 문서는 KUnit resource API를 설명합니다.
대부분의 사용자는 이 API를 직접 사용할 필요가 없습니다. 고급 사용자는 test별 state를 저장하고 custom cleanup action을 등록하는 등의 작업에 사용할 수 있습니다.
다음 kernel-doc 지시문은 `include/kunit/resource.h`의 internal API를 포함합니다.
.. kernel-doc:: include/kunit/resource.h
:internal:
KUnit managed device
15-22Managed Device
KUnit이 관리하는 struct device와 struct device_driver를 사용하는 함수입니다. 이 기능을 쓰려면 `kunit/device.h`를 include하십시오.
다음 kernel-doc 지시문은 `include/kunit/device.h`의 internal API를 포함합니다.
.. kernel-doc:: include/kunit/device.h
:internal:
요약과 해설
resource.rst:1-22KUnit resource는 test lifetime에 맞춘 state와 cleanup을 제공하며 managed device helper는 struct device와 driver도 같은 방식으로 관리할 수 있게 합니다.