What problem does it solve?
It solves the time-consuming and error-prone work of writing OpenHarmony testfwk_developer_test-compliant HWTEST/HWTEST_F unit tests for C/C++ code, including correct macro usage, test levels, naming, and BUILD.gn wiring.
Core Features & Use Cases
- Scaffold compliant unit test files: Produces test plans and code that follow OpenHarmony’s HWTEST rules (including mandatory
using namespace testing::ext;, TestSize.Level*, and proper @tc.* annotations).
- Design test cases from source: Helps analyze target source APIs and derive a structured set of scenarios (normal, exception, boundary, state).
- Generate GN build configuration: Guides creation of
ohos_unittest targets (imports, deps, module output path format, and cflags_cc for private/protected access).
- Optional style alignment from existing tests: When there are existing tests, it leverages analysis to match local macro usage, naming, comment style, and Level formatting.
Example use case: You are asked to write new HWTEST/HWTEST_F cases for a subsystem module that has public APIs plus some private logic; you want deterministic, gate-compliant tests and a correct test/unittest/BUILD.gn setup.
Quick Start
Tell the assistant the exact OpenHarmony module/function(s) you need to test and the intended output location under test/unittest/, and ask it to generate HWTEST/HWTEST_F test cases plus the corresponding BUILD.gn target.