C/C++ embedded project template with a focus on code quality, testing, and portability. Suitable for host-based development (Linux) and extendable to ARM Cortex-M targets.
- CMake-based build system with Makefile wrapper
- Unity test framework integration for C
- Strict compiler warnings and hardened build flags
- Static analysis with clang-tidy and cppcheck on core library
- Code formatting with clang-format
- Code coverage with gcov/lcov and HTML report generation
- GitHub Actions CI for build, test, analysis, and coverage
- C++ test framework integration (CppUTest)
- Cross-compilation support for ARM Cortex-M (toolchains + firmware dir)
- Linux or WSL environment
- CMake 3.20+
- GCC or Clang toolchain
- Tools: clang-tidy, clang-format, cppcheck, lcov, git
-
Clone and enter the project:
git clone https://github.com/brahimab8/embedded-c-cpp-template cd embedded-c-cpp-template -
Build and run tests:
make make test -
Optional targets:
make analyze→ static analysis (clang-tidy, cppcheck)make coverage-html→ coverage report (coverage/index.html)make format→ format sourcesmake clean→ remove build artifacts
├── include/ # Public headers
├── src/ # Source files
├── tests/c/ # Unity-based tests (host)
├── third_party/unity # External dependency (submodule)
└── .github/workflows # CI configuration
MIT License. See LICENSE.