oh-capi-xts-gen
OfficialGenerate OpenHarmony CAPI N-API XTS tests from headers.
Software Engineering#capi#openharmony#n-api#header parsing#xts test generation#coverage driven testing#ets arkts
Authoropenharmonyinsight
Version1.0.0
Installs0
System Documentation
What problem does it solve?
This Skill removes the repetitive work of writing OpenHarmony CAPI XTS tests by generating N-API (mode 2) wrapper tests and matching ETS/ArkTS test cases directly from C header (.h) definitions, including validation and optional coverage-report-driven incremental generation.
Core Features & Use Cases
- .h 头文件解析:从 C API 声明中提取函数签名、参数与返回信息,形成可用于生成的结构化上下文。
- N-API 封装与 ETS 测试生成(方式2):自动生成 C++ N-API 封装代码和 ETS/ArkTS 测试代码,遵循 hypium/XTS 命名与断言规范。
- 覆盖率驱动的补充测试:当用户提供覆盖率报告或缺失测试项时,按缺失 API/参数组合/测试场景生成补测用例,避免无谓的全量分析。
- 强制 N-API 三重校验 + 可选编译验证:在生成后完成注册一致性、index.d.ts 一致性、ETS 调用一致性校验,并可进一步执行编译验证(Linux/Windows 工作流)。
Quick Start
Use the oh-capi-xts-gen skill to generate CAPI N-API XTS tests for subsystem Hilog and API HiLogPrint by providing the API name and your OpenHarmony root path configured in the skill config.
Dependency Matrix
Required Modules
None requiredComponents
scriptsreferences
💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: oh-capi-xts-gen Download link: https://github.com/openharmonyinsight/openharmony-skills/archive/main.zip#oh-capi-xts-gen Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.