Skip to content
This repository has been archived by the owner on Mar 23, 2021. It is now read-only.

Commit

Permalink
add test framework
Browse files Browse the repository at this point in the history
  • Loading branch information
MrSapps committed Feb 17, 2016
1 parent e4485c2 commit 7c202d6
Show file tree
Hide file tree
Showing 13 changed files with 320 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[submodule "3rdParty/Detours"]
path = 3rdParty/Detours
url = https://github.com/paulsapps/Detours.git
[submodule "3rdParty/gmock-1.7.0"]
path = 3rdParty/gmock-1.7.0
url = https://github.com/paulsapps/gmock-1.7.0.git
1 change: 1 addition & 0 deletions 3rdParty/gmock-1.7.0
Submodule gmock-1.7.0 added at 173891
2 changes: 1 addition & 1 deletion Source/MSGI.props
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<Path>$(SolutionDir)..\Output\$(Configuration)\$(ProjectName)\Build.log</Path>
</BuildLog>
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)..\3rdParty\Detours\include;$(SolutionDir)MgsDll;$(SolutionDir)MgsExe;$(SolutionDir)MgsLib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(SolutionDir)..\3rdParty\Detours\include;$(SolutionDir)..\3rdParty\gmock-1.7.0\include;$(SolutionDir)..\3rdParty\gmock-1.7.0\gtest\include;$(SolutionDir)..\3rdParty\gmock-1.7.0\gtest;$(SolutionDir)..\3rdParty\gmock-1.7.0;$(SolutionDir)MgsDll;$(SolutionDir)MgsExe;$(SolutionDir)MgsLib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
Expand Down
20 changes: 19 additions & 1 deletion Source/MSGI.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.40629.0
VisualStudioVersion = 12.0.31101.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DetoursLib", "DetoursLib\DetoursLib.vcxproj", "{849C6CF7-CDEE-40C5-A3AF-F941A8346ADB}"
EndProject
Expand All @@ -11,6 +11,12 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MgsLib", "MgsLib\MgsLib.vcx
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MgsExe", "MgsExe\MgsExe.vcxproj", "{D190DB4A-8B68-4B97-837C-F7E872C20ECB}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gmock", "gmock\gmock.vcxproj", "{C4F72BA1-FA06-48BB-80C7-CFB655B970D7}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "3rdParty", "3rdParty", "{BA8F6519-6E86-4396-AB07-8EC640C1D73C}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Tests", "Tests\Tests.vcxproj", "{85F8859D-EE56-4093-A469-30D0B2D86089}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Expand All @@ -33,8 +39,20 @@ Global
{D190DB4A-8B68-4B97-837C-F7E872C20ECB}.Debug|Win32.Build.0 = Debug|Win32
{D190DB4A-8B68-4B97-837C-F7E872C20ECB}.Release|Win32.ActiveCfg = Release|Win32
{D190DB4A-8B68-4B97-837C-F7E872C20ECB}.Release|Win32.Build.0 = Release|Win32
{C4F72BA1-FA06-48BB-80C7-CFB655B970D7}.Debug|Win32.ActiveCfg = Debug|Win32
{C4F72BA1-FA06-48BB-80C7-CFB655B970D7}.Debug|Win32.Build.0 = Debug|Win32
{C4F72BA1-FA06-48BB-80C7-CFB655B970D7}.Release|Win32.ActiveCfg = Release|Win32
{C4F72BA1-FA06-48BB-80C7-CFB655B970D7}.Release|Win32.Build.0 = Release|Win32
{85F8859D-EE56-4093-A469-30D0B2D86089}.Debug|Win32.ActiveCfg = Debug|Win32
{85F8859D-EE56-4093-A469-30D0B2D86089}.Debug|Win32.Build.0 = Debug|Win32
{85F8859D-EE56-4093-A469-30D0B2D86089}.Release|Win32.ActiveCfg = Release|Win32
{85F8859D-EE56-4093-A469-30D0B2D86089}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{849C6CF7-CDEE-40C5-A3AF-F941A8346ADB} = {BA8F6519-6E86-4396-AB07-8EC640C1D73C}
{C4F72BA1-FA06-48BB-80C7-CFB655B970D7} = {BA8F6519-6E86-4396-AB07-8EC640C1D73C}
EndGlobalSection
EndGlobal
13 changes: 13 additions & 0 deletions Source/Tests/Main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#include "stdafx.h"
#include <gmock/gmock.h>

bool IsMgsi()
{
return false;
}

int main(int argc, char* argv[])
{
::testing::InitGoogleMock(&argc, argv);
return RUN_ALL_TESTS();
}
14 changes: 14 additions & 0 deletions Source/Tests/TestTask.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#include "stdafx.h"
#include <gmock/gmock.h>
#include "Task.hpp"

unsigned int __stdcall TaskThreadProc(void *)
{
return 7;
}

TEST(Task, Init)
{
//Task_Init(30, TaskThreadProc);
}

96 changes: 96 additions & 0 deletions Source/Tests/Tests.vcxproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{85F8859D-EE56-4093-A469-30D0B2D86089}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>Tests</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\MSGI.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\MSGI.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>Use</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="stdafx.h" />
<ClInclude Include="targetver.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="Main.cpp" />
<ClCompile Include="stdafx.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="TestTask.cpp" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\gmock\gmock.vcxproj">
<Project>{c4f72ba1-fa06-48bb-80c7-cfb655b970d7}</Project>
</ProjectReference>
<ProjectReference Include="..\MgsLib\MgsLib.vcxproj">
<Project>{8d2d8161-0574-44e4-ad40-e4e23cd86df1}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
36 changes: 36 additions & 0 deletions Source/Tests/Tests.vcxproj.filters
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="stdafx.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="targetver.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="stdafx.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="TestTask.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Main.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>
8 changes: 8 additions & 0 deletions Source/Tests/stdafx.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// stdafx.cpp : source file that includes just the standard includes
// Tests.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information

#include "stdafx.h"

// TODO: reference any additional headers you need in STDAFX.H
// and not in this file
14 changes: 14 additions & 0 deletions Source/Tests/stdafx.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//

#pragma once

#include "targetver.h"

#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers



// TODO: reference additional headers your program requires here
8 changes: 8 additions & 0 deletions Source/Tests/targetver.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#pragma once

// Including SDKDDKVer.h defines the highest available Windows platform.

// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and
// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h.

#include <SDKDDKVer.h>
82 changes: 82 additions & 0 deletions Source/gmock/gmock.vcxproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\3rdParty\gmock-1.7.0\gtest\src\gtest-all.cc" />
<ClCompile Include="..\..\3rdParty\gmock-1.7.0\src\gmock-all.cc" />
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{C4F72BA1-FA06-48BB-80C7-CFB655B970D7}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>gmock</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\MSGI.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\MSGI.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
25 changes: 25 additions & 0 deletions Source/gmock/gmock.vcxproj.filters
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\3rdParty\gmock-1.7.0\src\gmock-all.cc">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\3rdParty\gmock-1.7.0\gtest\src\gtest-all.cc">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

0 comments on commit 7c202d6

Please sign in to comment.