Back to Home

The Cargo Book

1. Project Structure

2. Testing

Cargo looks for tests in two locations:

  1. Source Files (src/)
    • Unit tests
    • Documentation tests
  2. Tests Directory (tests/)
    • Integration tests
    • Requires importing crates

2.1 Test Features

3. CI/CD

For GitHub Actions CI, workflow is created in .github/workflows/ci.yml

4. Package Management

4.1 Version Control

4.2 Dependencies

Cargo home:

4.3 Cargo.toml Configuration

[dependencies]        # Package library dependencies
[dev-dependencies]   # Dependencies for examples, tests, and benchmarks

4.4 Package Components

Targets correspond to source files compilable into crates

Types of targets:

4.5 Workspace Features