jwgrenning / cpputest-starter-project-vs

A cpputest starter project with instructions for visual studio
Other
20 stars 12 forks source link

cpputest-starter-project-vs

A cpputest starter project with instructions for Visual Studio

Create Your First Legacy C/C++ Test Project - Visual Studio

This describes how to integrate CppUTest based testing into your production code base using the Visual Studio environment. I'll assume you are using Visual Studio 2010 in the instructions, but there are other project files. As a reference, here are the other Visual Studio file extensions:

• VC6 file extensions (dsw, dsp)
• VS2008 file extensions (sln, vcproj)
• VS2010 file extensions (sln, vcxproj)
• VS2012 file extensions (sln, vcxproj)
• VS2019 file extensions (sln, vcxproj)

Install and build CppUTest

Unzip and build the starter project

Clone the starter-kit like this:

git clone https://github.com/jwgrenning/cpputest-starter-project-vs.git

How to integrate testing into your source repository.

    ProductSourceRepository
        |-- example-include
        |-- example.h
        |-- io.h
        |-- example-platform
        |-- io.c
        |-- example-src
            |-- example.c
        |-- include
        |-- source
        |-- tests
            |-- AllTests.cpp
        |-- ExampleTest.cpp
            |-- MyFirstTest.cpp
    |-- vs-test-build
            |-- AllTests.vcxproj
        |-- ProductionCodeLib.vcxproj
            |-- TddC-StarterProject.dsw
            |-- TddC-StarterProject_VS2010.sln

Things that can go wrong: