Giter VIP home page Giter VIP logo

cpp-vscode-guide's People

Contributors

fbaeuerlein avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cpp-vscode-guide's Issues

Create coverage workflow

Create workflow for coverage

  • build and run tests
  • run lcov accordingly (maybe via extension)

Example for task:

{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
        {
            "label": "Run lcov",
            "type": "shell",
            "command": "lcov --capture --directory .. --output-file lcov.info && lcov --remove lcov.info '/usr/*' '*/googletest/*' --output-file lcov.info", 
            "options": {
                "cwd": "${workspaceFolder}/build" }
        }, 
        
        {
            "label": "Run genhtml",
            "type": "shell",
            "command": "genhtml lcov.info --output-directory coverage", 
            "options": {
                "cwd": "${workspaceFolder}/build" }
        }
    ]
}

Together with TaskRunner extension a nice idea ...

https://code.visualstudio.com/docs/editor/tasks#_next-steps

Replace clang-format, clang-tidy, etc. with clangd

Possible settings.json configuration

"clangd.semanticHighlighting": true,
"clangd.checkUpdates": true,
"clangd.arguments": [
    "-clang-tidy",
    "--compile-commands-dir=${workspaceFolder}/build",        
    "--header-insertion=iwyu",
    // "--suggest-missing-includes", 
    "-log=verbose"
]

Seems not to work currently together with clang-tidy. No errors are displayed (e.g. nullptr deref). Maybe wait for update of ext or vscode.

COV + ASan cmake-variants.yaml

Choosing two variants that define the same compiler flags are overwriting each other so that only one is used. Mention that in the documentation.

Extensions to evaluate

Add working sample cmake-variants.yaml to .vscode

Some sample:


buildType:
  default: debug
  choices:
    debug:
      short: Debug
      long: Emit debug information
      buildType: Debug
    release:
      short: Release
      long: Optimize generated code
      buildType: Release


instrumentation:

  default: NoInstrumentation # no sanitizer/no instrumentation
  choices:

    NoSan:
      short: NoInstrumentation
      long: build without any instrumentation

    Coverage:
      short: Coverage
      long: build with coverage instrumentation
      settings:
        CMAKE_CXX_FLAGS: "-fprofile-arcs -ftest-coverage "
        CMAKE_C_FLAGS: "-fprofile-arcs -ftest-coverage"
        CMAKE_EXE_LINKER_FLAGS: "--coverage"

    ASan:
      short: ASan
      long: build with adresss sanitizer instrumentation
      settings:
        CMAKE_CXX_FLAGS: "-fsanitize=address -fno-omit-frame-pointer -fsanitize-address-use-after-scope"
        CMAKE_C_FLAGS: "-fsanitize=address -fno-omit-frame-pointer -fsanitize-address-use-after-scope"
        CMAKE_EXE_LINKER_FLAGS: "-fsanitize=address"

    TSan:
      short: TSan
      long: build with thread sanitizer instrumentation
      settings:
        CMAKE_CXX_FLAGS: "-fsanitize=thread"
        CMAKE_C_FLAGS: "-fsanitize=thread"
        CMAKE_EXE_LINKER_FLAGS: "-fsanitize=thread"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.