GithubHelp home page GithubHelp logo

docker-gtest-valgrind's Introduction

C++ Memory Leak Detection Template using Valgrind and Google Test

This is a template repository for setting up a Docker container to test C++ code for memory leaks using Valgrind and Google Test. The repository provides a Dockerfile and necessary configuration to build and run the tests in an isolated environment.

Prerequisites

  • Docker must be installed on your system to use this template.

Contents

  • Dockerfile: Defines the Docker image with necessary dependencies.
  • Makefile: Contains commands to build and test the code within the Docker container.
  • valgrind.suppressions: Optional Valgrind suppressions file for suppressing known issues.
  • src/: Directory containing your C++ source code and test files.
  • test/: Directory containing your Google Test files.

Setup and Usage

  1. Clone this repository to your local machine:

    git clone https://github.com/yourusername/your-repo.git
    cd your-repo
  2. Add your C++ source code to the src/ directory.

  3. Modify the Makefile to include the necessary compilation and linking commands for your code and tests.

  4. Build the Docker image:

    make docker_build
  5. Run the Valgrind memory leak check:

    make docker_start
  6. The test output and Valgrind analysis will be displayed on the terminal. Memory leak information will be saved in valgrind.txt.

Notes

  • Modify the commands in the Makefile according to your specific project's requirements.
  • If you have known Valgrind issues that you want to suppress, you can add them to valgrind.suppressions.
  • This template assumes that your project is structured in a certain way. You might need to adapt it to your project's layout and build system.

License

MIT License

docker-gtest-valgrind's People

Contributors

lufaque avatar

Watchers

 avatar

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.