Replace all hardcoded "1.1.0" version strings with env!("CARGO_PKG_VERSION")
in src/, so Cargo.toml is the sole source for the built binary. Tests
intentionally use a separate hardcoded constant in tests/common.rs to act
as a canary — they will fail on a version bump until manually updated.
- src/project/mod.rs: add WEEVIL_VERSION const, wire into Tera context,
generated README, and .weevil-version marker
- tests/common.rs: new file, holds EXPECTED_VERSION for all test crates
- tests/{integration,project_lifecycle,unit/config_tests}.rs: pull from
common instead of env! or inline literals
43 lines
1.0 KiB
Rust
43 lines
1.0 KiB
Rust
use assert_cmd::prelude::*;
|
|
use predicates::prelude::*;
|
|
use std::process::Command;
|
|
|
|
#[path = "common.rs"]
|
|
mod common;
|
|
use common::EXPECTED_VERSION;
|
|
|
|
#[path = "integration/environment_tests.rs"]
|
|
mod environment_tests;
|
|
|
|
#[path = "integration/project_lifecycle_tests.rs"]
|
|
mod project_lifecycle_tests;
|
|
|
|
#[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(EXPECTED_VERSION));
|
|
}
|
|
|
|
#[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"));
|
|
} |