Module Template Documentation#
This documentation describes the structure, usage and configuration of the Bazel-based C++/Rust module template.
Overview#
This repository provides a standardized setup for projects using C++ or Rust and Bazel as a build system. It integrates best practices for build, test, CI/CD and documentation. It also provides Assumption of Use requirement snippets in AoU Requirements Template. It also provides an example of modeling architecture in Sphinx Needs in Example model of architectural design. It also provides the component architecture template snippets in Component Architecture Template. It also provides an example of documenting detailed design in Example: Detailed Design. It also provides the stakeholder requirements template snippet in Stakeholder Requirements Template.
Requirements#
Example Functional Requirement
|
status: valid
security: YES
safety: QM
|
||||
Project Layout#
The module template includes the following top-level structure:
src/: Main C++/Rust sources with Unit Tests
tests/: Component and Feature Integration Tests
examples/: Usage examples
docs/: Documentation using docs-as-code
.github/workflows/: CI/CD pipelines
Quick Start#
To build the module:
bazel build //src/...
To run all tests:
bazel test //...
To run Unit Tests:
bazel test //src/...
To run Component / Feature Integration Tests:
bazel test //tests/...
Configuration#
The project_config.bzl file defines metadata used by Bazel macros.
Example:
PROJECT_CONFIG = {
"asil_level": "QM",
"source_code": ["cpp", "rust"]
}
This enables conditional behavior (e.g., choosing clang-tidy for C++ or clippy for Rust).