
Calculator - C/C++ CMake + CTest course project template¶
A complete C/C++ template: CMake + CTest + googletest, every check reported twice (ReportGenerator and the native tool) on Windows and on Linux, Doxygen API docs, and this site tying it all together - a best-practice example for RTEU course projects.
Download the latest release Use this template View on GitHub
New here? Install -> Use the template -> From a topic to your project. The site is bilingual: use the language switcher in the header (English / Türkçe).
What is in this template¶
-
CMake + CTest + googletest
A
utilitylibrary, acalculatorlibrary (unit-tested infix/postfix parsing) and acalculatorappcommand-line demo. Builds on Windows (Visual Studio or Ninja + MinGW) and Linux / WSL (Ninja + GCC). -
Every report, two ways, per platform
Unit tests, code coverage and documentation coverage - each with ReportGenerator and with the native tool (OpenCppCoverage, lcov
genhtml, gcovr) - built separately on Windows and Linux. -
API docs (Doxygen)
Libraries and test sources, for Windows and for Linux, with call and include graphs.
-
One numbered script set
6-build-and-test,7-build-all,9-open-site,10-release... the same number is the same job, with-windows.bat/-linux.shas suffix. Oneproject.envnames the project. -
Show it without GitHub Pages
A private repository on GitHub Free has no Pages.
7-build-all+9-open-siteshow the full site on http://localhost, andrelease/holds every output. A checklist for the demo. -
Releases with every output
release/= the GitHub Release, one to one: app, libraries, every report, API docs,site.zip, source,ASSETS.mdandSHA256SUMS.txt. -
From topic to your own project
A worked walkthrough: rename the sample in one place, add your modules, write the tests first.
-
Troubleshooting, from real errors
Real error messages met while building this template, and the exact fix for each.
Reports, live¶
Each report has its own page in this site (a framed standalone HTML report with "Open in a new tab" and "Download (zip)"). Jump straight to one, or open the Reports tab:
-
Windows
Unit test results · Code coverage - ReportGenerator · Code coverage - OpenCppCoverage · Doc. coverage - ReportGenerator · Doc. coverage - lcov · API docs - Doxygen
-
Linux
Unit test results · Code coverage - ReportGenerator · Code coverage - lcov · Code coverage - gcovr · Doc. coverage - ReportGenerator · Doc. coverage - lcov · API docs - Doxygen
Coverage ratios¶
| Coverage type | Windows | Linux (WSL / CI Ubuntu) |
|---|---|---|
| Line | ||
| Branch | ||
| Method | ||
| Documentation |
Build it yourself¶
# Windows (cmd.exe) # Linux / WSL
7-build-all-windows.bat ./7-build-all-linux.sh
9-open-site-windows.bat ./9-open-site-linux.sh # serves the site on http://localhost:8000
Each full build takes roughly 10-20 minutes and produces reports/<platform>/, site/ and release/.
Use 6-build-and-test-* for the fast build + unit test loop.