There is simple example of creating DLL and writing Unit tests for it.
- Download/Clone this repository
- Open solution file
.sln - Build the solution
-
Start project wizard
File->New->Project -
Select Visual C++ Console Application
Visual C++->Win32->Win32 Console Application
and set the checkpoint on Create directory for solution
-
In wizard's
Application Settingstab chooseAppliction type: DLL Additional options: Export symbols; Precompiled header; Security Development Lifecycle (SDL) checks -
Add new project in solution
Solution->Add->New Project -
Select Unit test
Visual C++->Test->Native Unit Test Project -
Go to solution properties
Solution->Properties -
Select
Project Dependenciestab -
Select Unit test project and set checkbox on DLL project
-
Go to Unit test project properties
-
Go to
C/C++->Generaltab -
Add path to DLL project
../ConsoleApplicationintoAdditional Include Directories -
Go to
Linker->Generaltab -
Add
..\$(Configuration)intoAdditional Library Directories -
Go to
Linker->Inputtab -
Add lib name
ConsoleApplication.libintoAdditional Dependencies -
Build solution and run with tests
Test->Run->All tests