Skip to content

C++ Training Project by devminds GmbH

License

devminds-ch/project-cplusplus

Repository files navigation

C++ Training Project by devminds GmbH

This C++ project is used for DevOps CI/CD trainings.

The project contains an application providing a CLI to calculate the sum of two numbers:

C++ Training Project
Usage: ./cplusplus_training_project [OPTIONS] SUBCOMMAND

Options:
  -h,--help                   Print this help message and exit

Subcommands:
  sum                         Sum two doubles

Toolchain

The C++ application is based on the following toolchain:

Directory structure

├── build       Reserved folder for build artifacts
├── cmake       Custom CMake files
├── docs        Doxygen documentation
├── external    3rdparty libraries as Git submodules
├── src         C++ source code
├── tests       GoogleTest tests
└── tools       Scripts

Build and test instructions

All steps required to build or test the application are wrapped in separate shell scripts.

Check the content of the corresponding scripts for details.

Build documentation

Build the doxygen documentation:

./tools/build-docs.sh

Run clang-format

Run clang-format:

./tools/clang-format.sh

Run static code analysis

The following tools are integrated into CMake and can be enabled by defining a corresponding environment variable:

If Cppcheck should be executed manually, run the following:

cppcheck src/ --xml --xml-version=2 2> cppcheck.xml

Instructions for GCC

Build the application release config:

./tools/build-cmake-target.sh gcc-release cplusplus_training_project

Build the tests for code coverage analysis:

./tools/build-cmake-target.sh gcc-coverage calculate_test

Execute the tests:

./tools/run-test.sh build/gcc-coverage/bin/calculate_test build/gcc

Executing the GCC tests will create the following artifacts:

  • build/gcc/test-report.xml: test results in Junit XML format
  • build/gcc/test-coverage.xml: code coverage report in Cobertura XML format
  • build/gcc/html/index.html: HTML report of code coverage from gcovr

Instructions for Clang

Build the application release config:

./tools/build-cmake-target.sh clang-release cplusplus_training_project

Build the tests for code coverage analysis:

./tools/build-cmake-target.sh clang-coverage calculate_test

Execute the tests:

./tools/run-test.sh build/clang-coverage/bin/calculate_test build/clang

Executing the Clang tests will create the following artifacts:

  • build/clang/test-report.xml: test results in Junit XML format
  • build/clang/test-coverage.xml: code coverage report in Cobertura XML format
  • build/clang/html/index.html: HTML report of code coverage from gcovr

About

C++ Training Project by devminds GmbH

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Contributors 3

  •  
  •  
  •