C++ project template
Go to file Use this template
2024-05-26 17:59:17 +02:00
.vscode first prototype 2024-05-26 17:59:17 +02:00
addressbook first prototype 2024-05-26 17:59:17 +02:00
denv first prototype 2024-05-26 17:59:17 +02:00
.gitignore first prototype 2024-05-26 17:59:17 +02:00
CMakeLists.txt first prototype 2024-05-26 17:59:17 +02:00
LICENSE first prototype 2024-05-26 17:59:17 +02:00
reader.cpp first prototype 2024-05-26 17:59:17 +02:00
README.md first prototype 2024-05-26 17:59:17 +02:00
writer.cpp first prototype 2024-05-26 17:59:17 +02:00

Template for C++ based projects

  • environment: Docker container
  • IDE: VsCode
  • build system: CMake
  • 3rd party libraries: vcpkg
  • testing: Catch2

Development Environment

./denv/build.sh    # create denv image
./denv/run-vsc.sh  # run container & attach VsCode instance to it

CMake and CTests

CTest integration within VsCode is limited - it does not provide link between test case source and test shown in TestExplorer view.

Solution

  1. Disable (CMake > CTest: Test Explorer Integration Enabled)
  2. Install TestMate extension It scans the build tree for xxx_test binaries and has neat integration with Catch2.
  3. You need to enable rebuild on save in order for tests in TestExplorer to automatically reflect changes in the code. If none - use F7 to rebuild project.