dart-test

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
<!-- AUTO-GENERATED FILE - DO NOT EDIT MANUALLY --> <!-- Source: .claude/skills/dart-test/SKILL.md --> <!-- Sync script: scripts/sync_ai_commands.py --> <!-- Run `pixi run sync-ai-commands` to update -->
<!-- 自动生成文件 - 请勿手动编辑 --> <!-- 来源:.claude/skills/dart-test/SKILL.md --> <!-- 同步脚本:scripts/sync_ai_commands.py --> <!-- 运行`pixi run sync-ai-commands`进行更新 -->

DART Testing

DART测试

Load this skill when writing or debugging tests.
编写或调试测试时加载此skill。

Quick Commands

快速命令

bash
pixi run test         # Quick test run
pixi run test-all     # Full validation
ctest -R <pattern>    # Run specific tests
ctest -V              # Verbose output
bash
pixi run test         # 快速测试运行
pixi run test-all     # 完整验证
ctest -R <pattern>    # 运行特定测试
ctest -V              # 详细输出

Full Documentation

完整文档

For complete testing guide:
docs/onboarding/testing.md
For CI/CD troubleshooting:
docs/onboarding/ci-cd.md
如需完整测试指南:
docs/onboarding/testing.md
如需CI/CD故障排查:
docs/onboarding/ci-cd.md

Test Organization

测试组织架构

  • Unit tests:
    tests/unit/
  • Integration tests:
    tests/integration/
  • Regression tests: Near the code they test
  • 单元测试:
    tests/unit/
  • 集成测试:
    tests/integration/
  • 回归测试:紧邻其测试的代码

Writing Tests

编写测试

  1. Follow existing patterns in the test directory
  2. Use GoogleTest framework
  3. Name tests descriptively:
    TEST(ClassName, MethodName_Condition_ExpectedResult)
  1. 遵循测试目录中的现有模式
  2. 使用GoogleTest框架
  3. 为测试命名时需具备描述性:
    TEST(ClassName, MethodName_Condition_ExpectedResult)

CI Validation

CI验证

Before submitting PR:
bash
pixi run lint         # Must pass
pixi run test-all     # Must pass
提交PR前:
bash
pixi run lint         # 必须通过
pixi run test-all     # 必须通过

Debugging Test Failures

调试测试失败

bash
undefined
bash
undefined

Run single test with verbose output

运行单个测试并显示详细输出

ctest -R TestName -V
ctest -R TestName -V

Get CI logs

获取CI日志

gh run view <RUN_ID> --log-failed
undefined
gh run view <RUN_ID> --log-failed
undefined