Cross-platform tool for generating clean, testable FTC robot projects without editing the SDK installation. Features: - Standalone project generation with proper separation from SDK - Per-project SDK configuration via .weevil.toml - Local unit testing support (no robot required) - Cross-platform build/deploy scripts (Linux/macOS/Windows) - Project upgrade system preserving user code - Configuration management commands - Comprehensive test suite (11 passing tests) - Zero-warning builds Architecture: - Pure Rust implementation with embedded Gradle wrapper - Projects use deployToSDK task to copy code to FTC SDK TeamCode - Git-ready projects with automatic initialization - USB and WiFi deployment with auto-detection Commands: - weevil new <name> - Create new project - weevil upgrade <path> - Update project infrastructure - weevil config <path> - View/modify project configuration - weevil sdk status/install/update - Manage SDKs Addresses the core problem: FTC's SDK structure forces students to edit framework internals instead of separating concerns like industry standard practices. Weevil enables proper software engineering workflows for robotics education.
55 lines
1.5 KiB
Rust
55 lines
1.5 KiB
Rust
use assert_cmd::prelude::*;
|
|
use predicates::prelude::*;
|
|
use tempfile::TempDir;
|
|
use std::process::Command;
|
|
|
|
#[test]
|
|
fn test_help_command() {
|
|
let mut cmd = Command::new(assert_cmd::cargo::cargo_bin!("weevil"));
|
|
cmd.arg("--help");
|
|
|
|
cmd.assert()
|
|
.success()
|
|
.stdout(predicate::str::contains("FTC robotics project generator"));
|
|
}
|
|
|
|
#[test]
|
|
fn test_version_command() {
|
|
let mut cmd = Command::new(assert_cmd::cargo::cargo_bin!("weevil"));
|
|
cmd.arg("--version");
|
|
|
|
cmd.assert()
|
|
.success()
|
|
.stdout(predicate::str::contains("1.0.0"));
|
|
}
|
|
|
|
#[test]
|
|
fn test_sdk_status_command() {
|
|
let mut cmd = Command::new(assert_cmd::cargo::cargo_bin!("weevil"));
|
|
cmd.arg("sdk").arg("status");
|
|
|
|
cmd.assert()
|
|
.success()
|
|
.stdout(predicate::str::contains("SDK Configuration"));
|
|
}
|
|
|
|
// Project creation test - will need mock SDKs
|
|
#[test]
|
|
#[ignore] // Ignore until we have mock SDKs set up
|
|
fn test_project_creation() {
|
|
let temp = TempDir::new().unwrap();
|
|
|
|
let mut cmd = Command::new(assert_cmd::cargo::cargo_bin!("weevil"));
|
|
cmd.current_dir(&temp)
|
|
.arg("new")
|
|
.arg("test-robot");
|
|
|
|
cmd.assert()
|
|
.success()
|
|
.stdout(predicate::str::contains("Project Created"));
|
|
|
|
// Verify project structure
|
|
assert!(temp.path().join("test-robot/README.md").exists());
|
|
assert!(temp.path().join("test-robot/build.gradle.kts").exists());
|
|
assert!(temp.path().join("test-robot/gradlew").exists());
|
|
} |