A template for C and CPP programming that makes use of the cmocka unit testing framework in addition to the CMAKE build system. It's focused on wide compatibility with multiple systems and setup for vim usage.
Go to file Use this template
jakeg00dwin 41950059a6 updated to use in place sed editing 2024-03-22 11:35:40 -07:00
.template_files added include for module_name.h and also top comment with info. 2024-03-09 12:17:04 -08:00
build build dir and a placeholder file 2024-02-22 23:14:10 -08:00
cmake/cmocka removed the cmocka repo dir, added a cmocka dir with cmake files 2024-03-08 10:28:47 -08:00
docs added as placeholder for dir 2024-03-02 10:26:55 -08:00
inc example code and tests 2024-02-22 23:15:42 -08:00
src added some basic code to the files 2024-03-08 10:42:40 -08:00
tests added baisc test code 2024-03-08 10:43:44 -08:00
toolchains added basic parts of the avr toolchain file 2024-03-22 11:35:30 -07:00
.gitignore added the clangd index to ignored stuff. 2024-03-08 10:42:31 -08:00
CMakeLists.txt changed the targeted standard to C18 and CXX18 2024-03-09 12:16:48 -08:00
Doxyfile updated the Doxygen configuration file and readme 2024-03-02 10:25:36 -08:00
LICENSE Initial commit 2024-02-23 05:14:20 +00:00
README.md updated the Doxygen configuration file and readme 2024-03-02 10:25:36 -08:00
otto.sh updated to use in place sed editing 2024-03-22 11:35:40 -07:00
setup.sh added a simple echo command to the shell function 2024-02-29 22:25:06 -08:00

README.md

cmake-cmocka-template

A template for C and CPP programming that makes use of the cmocka unit testing framework in addition to the CMAKE build system.

Requirements

Resources

Documentation

Documentation genreation is handled with Doxygen.

Building documentation

doxygen ./Doxyfile
# Magic happens
ls ./docs

And that's it.

Contributions

Directory Overview

It's focused on wide compatibility with multiple systems and setup for vim usage..

tree -L 2 ./
├── build
├── CMakeLists.txt
├── docs
├── inc
├── LICENSE
├── README.md
├── setup.sh
├── src
│   ├── CMakeLists.txt
│   └── main.c
├── otto.sh
└── tests
    └── CMakeLists.txt

5 directories, 8 files

Scripts

There are two scripts setup inside the project directory:

otto.sh Uesd to preform the needed commands to build, test and debug the project.

Adding a new module

To add a new section of code:

  1. run the otto.sh script: ./otto.sh
  2. Select option 5
  3. Enter the modules name.

To remove a module:

  1. run the otto.sh script: ./otto.sh
  2. Select option 6
  3. Enter the modules name.

setup.sh Used to install the projects dependencies and automate needed setup. Also removes example code when requested.