hmos-instrument-test

Installation
SKILL.md

参考文档

本技能涉及的操作细节可参考以下文档(位于 references/ 文件夹内):

  • references/instrument_test_doc.md:包含 HarmonyOS Instrument Test 的完整使用指南,包括测试用例创建、运行模式(普通/调试/覆盖率)、C++ 测试、ASan 检测、命令行执行等详细说明。

使用场景

  • AI 代理根据用户需求(如“运行 entry 模块的所有测试用例”或“对 ability.test.ets 中的测试套件 ActsAbilityTest 执行覆盖率统计”)自动调用该技能。
  • 持续集成/自动化测试流水线中集成。

测试文件到参数的推断

当用户指定一个或多个测试文件(如 Ability.test.ets)为测试范围时,需按以下规则推断 --module--scope 参数。

推断 module

从测试文件路径中提取模块名。Instrument Test 的测试文件位于 <module>/ohosTest/ets/test/ 目录下,ohosTest 的父目录即为模块名。

例如:

  • entry/ohosTest/ets/test/Ability.test.ets → module = entry
  • feature/ohosTest/ets/test/Login.test.ets → module = feature
Installs
3
First Seen
Jun 22, 2026
hmos-instrument-test — iskenkenya/skills