Skip to main content

iOS Unit Test Generator

智能 MCP 服务器,自动生成、编译、运行和修复 iOS 单元测试。

🚀 快速开始

无需拉取代码,直接在 VS Code 中配置即可使用!

方式一:VS Code 一键安装(最简单 ⭐)

  1. 打开 VS Code
  2. Cmd+Shift+P → 输入 MCP: Add Server
  3. 选择 "Pip Package"
  4. 输入包名:ios-unittest-generator
  5. 设置环境变量 CHROMIUM_SRC 为你的 Chromium 源码路径
  6. 完成!

方式二:手动编辑配置文件

macOS/Linux - 编辑 ~/.vscode/mcp.json:

{
  "servers": {
    "ios-unittest-generator": {
      "command": "uvx",
      "args": ["ios-unittest-generator"],
      "env": {
        "CHROMIUM_SRC": "/path/to/chromium/src"
      }
    }
  }
}

Windows - 编辑 %APPDATA%\Code\User\mcp.json:

{
  "servers": {
    "ios-unittest-generator": {
      "command": "uvx",
      "args": ["ios-unittest-generator"],
      "env": {
        "CHROMIUM_SRC": "C:\\path\\to\\chromium\\src"
      }
    }
  }
}

📋 核心功能

  • ✅ 自动分析源文件,识别可测试元素
  • ✅ 生成完整的测试文件(包含 fixture、SetUp、测试用例)
  • ✅ 智能检测测试目标(支持 ios/chrome/*、components/*/ios/* 等所有路径)
  • ✅ 自动更新 BUILD.gn 文件(按字母顺序)
  • ✅ 自动编译测试,智能分析编译错误
  • ✅ 自动运行测试,智能分析运行时错误

📖 11 个 MCP 工具

工具 功能
full_test_workflow 完整工作流(分析→生成→增强→编译→运行)
analyze_ios_code_for_testing 分析源文件,提取可测试元素
generate_ios_unittest_file 生成测试文件
check_ios_test_coverage 检查测试覆盖率
verify_test_enhancement_complete 验证测试增强完成(质量门控)
compile_ios_unittest 编译测试(自动错误分析)
run_ios_unittest 运行测试(自动错误分析)
analyze_runtime_errors 分析运行时错误
analyze_compilation_errors 分析编译错误
update_existing_tests 增量更新测试
update_build_file_for_test 自动更新 BUILD 文件

💡 使用示例

# 一键生成完整测试
Use full_test_workflow for ios/chrome/browser/ui/foo.mm

# 单独编译
Use compile_ios_unittest for ios/chrome/browser/ui/foo.mm

# 单独运行
Use run_ios_unittest with filter FooTest.*

🔗 相关链接


版本: v4.19.1
更新日期: 2026-01-22

Metadata

Release files for ios-unittest-generator 4.19.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ios-unittest-generator 4.19.4
File Size Uploaded Provenance Actions
ios_unittest_generator-4.19.4.tar.gz 86.7 kB Without provenance Details for ios_unittest_generator-4.19.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ios-unittest-generator 4.19.4
File Interpreter ABI Platform Actions
ios_unittest_generator-4.19.4-py3-none-any.whl Python 3 none any Details for ios_unittest_generator-4.19.4-py3-none-any.whl

Total release size: 176.6 kB

Release files / ios_unittest_generator-4.19.4.tar.gz

Download URL ios_unittest_generator-4.19.4.tar.gz
Size 86.7 kB
Tags Source
SHA-256 checksum
How to use checksums
f2f88327cac464273a215c18e1e0c5773ef7b47f27f902fbee8592a69a107567
BLAKE2b-256 checksum
How to use checksums
870bd6b86228003a9e6529691290fe339ddd1bd99ebe795c1ab0c7eee727e909
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.11

Release files / ios_unittest_generator-4.19.4-py3-none-any.whl

Download URL ios_unittest_generator-4.19.4-py3-none-any.whl
Size 90.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
670b0fa90ce5b4eb2b32cf3079bc5a69addf965c3ebaca7bf44702418174e6dc
BLAKE2b-256 checksum
How to use checksums
6557ba3ce659979bc8633bd5ec12a0084e1130f7a684a2bdeff78fd9b4fa1e44
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.11

Security for ios-unittest-generator 4.19.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page