codex-memory 3.0.15

A simple memory storage service with MCP interface for Claude Desktop
Documentation
use std::fs;
use std::path::Path;
use std::process::Command;

/// Build System Verification Tests
///
/// These tests verify that the build pipeline correctly handles feature flags
/// and produces appropriate build artifacts for different configurations.

#[test]
fn test_basic_build_succeeds() {
    let output = Command::new("cargo")
        .args(["build", "--release"])
        .output()
        .expect("Failed to execute cargo build");

    assert!(
        output.status.success(),
        "Basic build should succeed. stderr: {}",
        String::from_utf8_lossy(&output.stderr)
    );

    // Verify binary exists
    let binary_path = "target/release/codex-memory";
    assert!(
        Path::new(binary_path).exists(),
        "Binary should exist at {}",
        binary_path
    );
}

#[test]
fn test_build_with_no_default_features() {
    let output = Command::new("cargo")
        .args(["build", "--release", "--no-default-features"])
        .output()
        .expect("Failed to execute cargo build with no default features");

    assert!(
        output.status.success(),
        "Build with no default features should succeed. stderr: {}",
        String::from_utf8_lossy(&output.stderr)
    );
}

#[test]
fn test_check_passes_without_features() {
    let output = Command::new("cargo")
        .args(["check"])
        .output()
        .expect("Failed to execute cargo check");

    assert!(
        output.status.success(),
        "Cargo check without features should pass. stderr: {}",
        String::from_utf8_lossy(&output.stderr)
    );
}

#[test]
fn test_installation() {
    // Test that the installation command works
    let output = Command::new("cargo")
        .args(["install", "--path", ".", "--force"])
        .output()
        .expect("Failed to execute cargo install");

    assert!(
        output.status.success(),
        "Installation should succeed. stderr: {}",
        String::from_utf8_lossy(&output.stderr)
    );
}

#[test]
fn test_binary_name_consistency() {
    // Verify the binary name matches expectations
    let cargo_toml = fs::read_to_string("Cargo.toml").expect("Should be able to read Cargo.toml");

    assert!(
        cargo_toml.contains("name = \"codex-memory\""),
        "Package name should be codex-memory"
    );

    // After build, binary should exist with correct name
    let binary_path = "target/release/codex-memory";
    assert!(
        Path::new(binary_path).exists(),
        "Binary should be named codex-memory"
    );
}