/cpp-base

C++ template base structure to use on any project. Great for language tests, experiments, testing...

Primary LanguageCMake

Cpp base: template project

This is a C++ base template structure to use in any vanilla/base project. This is great for testing and experiments.

This project use VSCode as a cross-platform editor.

Reference: VSCode: Introductory Videos for C++

Built With

Linux / Mac

Windows

Any platform

Getting Started

  1. Clone this repo

  2. Open this project using VSCode

    PS: Additionally, check the official tutorials of C++ integration with VSCode (e.g Using C++ on Linux in VS Code )

  3. Install recommended extensions such as Microsoft C/C++ extensions

  4. Run build task and/or debug on VSCode :)

    PS: To build/debug with CMake, see this link here: vscode-cmake-linux/Build hello world

Running tests

This project use GoogleTest + CMake. You can use VSCode tasks or execute CMake: [action] from CMake Tools VSCode extension:

Example: Running tests from Cmake Tools extension

  1. Open the Comand Palette (Ctrl+Shift+P) and execute the command Cmake: Run Tests

    VSCode image here!

  2. Alternatively, Open the Comand Palette (Ctrl+Shift+P), but this time run the VSCode Task on: Run Task => CMake: run tests

    VSCode image here!

    VSCode image here!

  3. See the result output on VSCode terminal

    VSCode image here!

Optionally, you can use the VSCode extension vscode-catch2-test-adapter to see all tests in a panel on the left side of the editor.

VSCode image here!

PS: For now, is necessary build the code before run tests on this panel (e.g using Cmake: Build command). There is a github issue with alternatives to solve this: vscode-catch2-test-adapter#127