con un clic
flutter-test-runner
// Run Sanmill's Flutter test suite, including unit tests, widget tests, and integration tests; use when running tests or checking test coverage.
// Run Sanmill's Flutter test suite, including unit tests, widget tests, and integration tests; use when running tests or checking test coverage.
Batch update ARB translation files across all languages when new translation keys are added to English and Chinese files; use when adding new i18n strings to the Flutter app.
Format C++ code in Sanmill project to ensure consistent code style; use when formatting C++ code or checking code style compliance.
Validates that all necessary code changes are implemented when adding new game rules; use when adding new game rules or variants to ensure no files are missed.
| name | Flutter Test Runner |
| description | Run Sanmill's Flutter test suite, including unit tests, widget tests, and integration tests; use when running tests or checking test coverage. |
This skill helps run and manage Sanmill's Flutter test suite, ensuring code quality and functional correctness.
src/ui/flutter_app/
├── test/ # Unit and widget tests (Dart VM, fast)
├── integration_test/ # Integration tests (real platform + AI engine)
└── test_driver/ # Test drivers
cd src/ui/flutter_app
# Run all tests
flutter test
# Run specific test file
flutter test test/game/position_test.dart
# Run with coverage
flutter test --coverage
# From repository root - use the project script (recommended)
./run-integration-test.sh --full # Complete test suite
./run-integration-test.sh --single # Single test case
./run-integration-test.sh --help # Show options
# Manual execution (from src/ui/flutter_app)
flutter test integration_test/ -d linux # Linux
flutter test integration_test/ -d macos # macOS
flutter test integration_test/ -d windows # Windows
| Type | Environment | Native Code | Speed | Use For |
|---|---|---|---|---|
| Unit/Widget | Dart VM | ❌ No | ⚡ Fast | Pure Dart logic, UI components |
| Integration | Real platform | ✅ Yes | 🐌 Slower | AI behavior, platform features |
Key difference: Integration tests use the real C++ AI engine and must run on actual platforms, not the Dart VM.
# Generate coverage
flutter test --coverage
# View summary (requires lcov)
lcov --summary coverage/lcov.info
# Generate HTML report
genhtml coverage/lcov.info -o coverage/html
# Then open coverage/html/index.html
Coverage targets: Overall ≥80%, Critical logic ≥90%, UI ≥70%
flutter test test/flutter test integration_test/ -d <platform>flutter pub get or flutter clean && flutter pub getmaxWaitTimeMs for AI testssrc/ui/flutter_app/integration_test/AUTOMATED_MOVE_TESTS_README.mdsrc/ui/flutter_app/test/ and src/ui/flutter_app/integration_test/Test results should report: