diff --git a/.gitmodules b/.gitmodules index c69794f..2aa3bdc 100644 --- a/.gitmodules +++ b/.gitmodules @@ -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 diff --git a/3rdParty/gmock-1.7.0 b/3rdParty/gmock-1.7.0 new file mode 160000 index 0000000..1738916 --- /dev/null +++ b/3rdParty/gmock-1.7.0 @@ -0,0 +1 @@ +Subproject commit 173891616007a21ad1efef558a7cd4540e3f88ba diff --git a/Source/MSGI.props b/Source/MSGI.props index 17875d7..e319874 100644 --- a/Source/MSGI.props +++ b/Source/MSGI.props @@ -11,7 +11,7 @@ $(SolutionDir)..\Output\$(Configuration)\$(ProjectName)\Build.log - $(SolutionDir)..\3rdParty\Detours\include;$(SolutionDir)MgsDll;$(SolutionDir)MgsExe;$(SolutionDir)MgsLib;%(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) _CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) diff --git a/Source/MSGI.sln b/Source/MSGI.sln index bcbfec1..07cb967 100644 --- a/Source/MSGI.sln +++ b/Source/MSGI.sln @@ -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 @@ -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 @@ -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 diff --git a/Source/Tests/Main.cpp b/Source/Tests/Main.cpp new file mode 100644 index 0000000..6cd0def --- /dev/null +++ b/Source/Tests/Main.cpp @@ -0,0 +1,13 @@ +#include "stdafx.h" +#include + +bool IsMgsi() +{ + return false; +} + +int main(int argc, char* argv[]) +{ + ::testing::InitGoogleMock(&argc, argv); + return RUN_ALL_TESTS(); +} diff --git a/Source/Tests/TestTask.cpp b/Source/Tests/TestTask.cpp new file mode 100644 index 0000000..11cf683 --- /dev/null +++ b/Source/Tests/TestTask.cpp @@ -0,0 +1,14 @@ +#include "stdafx.h" +#include +#include "Task.hpp" + +unsigned int __stdcall TaskThreadProc(void *) +{ + return 7; +} + +TEST(Task, Init) +{ + //Task_Init(30, TaskThreadProc); +} + diff --git a/Source/Tests/Tests.vcxproj b/Source/Tests/Tests.vcxproj new file mode 100644 index 0000000..bef2042 --- /dev/null +++ b/Source/Tests/Tests.vcxproj @@ -0,0 +1,96 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + {85F8859D-EE56-4093-A469-30D0B2D86089} + Win32Proj + Tests + + + + Application + true + v120 + Unicode + + + Application + false + v120 + true + Unicode + + + + + + + + + + + + + + + + + Use + Level3 + Disabled + WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) + + + Console + true + + + + + Level3 + Use + MaxSpeed + true + true + WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) + + + Console + true + true + true + + + + + + + + + + Create + Create + + + + + + {c4f72ba1-fa06-48bb-80c7-cfb655b970d7} + + + {8d2d8161-0574-44e4-ad40-e4e23cd86df1} + + + + + + \ No newline at end of file diff --git a/Source/Tests/Tests.vcxproj.filters b/Source/Tests/Tests.vcxproj.filters new file mode 100644 index 0000000..07f2ea2 --- /dev/null +++ b/Source/Tests/Tests.vcxproj.filters @@ -0,0 +1,36 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Header Files + + + Header Files + + + + + Source Files + + + Source Files + + + Source Files + + + \ No newline at end of file diff --git a/Source/Tests/stdafx.cpp b/Source/Tests/stdafx.cpp new file mode 100644 index 0000000..fbf88f7 --- /dev/null +++ b/Source/Tests/stdafx.cpp @@ -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 diff --git a/Source/Tests/stdafx.h b/Source/Tests/stdafx.h new file mode 100644 index 0000000..5459378 --- /dev/null +++ b/Source/Tests/stdafx.h @@ -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 diff --git a/Source/Tests/targetver.h b/Source/Tests/targetver.h new file mode 100644 index 0000000..87c0086 --- /dev/null +++ b/Source/Tests/targetver.h @@ -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 diff --git a/Source/gmock/gmock.vcxproj b/Source/gmock/gmock.vcxproj new file mode 100644 index 0000000..acccdea --- /dev/null +++ b/Source/gmock/gmock.vcxproj @@ -0,0 +1,82 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + + + + + {C4F72BA1-FA06-48BB-80C7-CFB655B970D7} + Win32Proj + gmock + + + + StaticLibrary + true + v120 + Unicode + + + StaticLibrary + false + v120 + true + Unicode + + + + + + + + + + + + + + + + + + + Level3 + Disabled + WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) + + + Windows + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) + + + Windows + true + true + true + + + + + + \ No newline at end of file diff --git a/Source/gmock/gmock.vcxproj.filters b/Source/gmock/gmock.vcxproj.filters new file mode 100644 index 0000000..9ac7f7c --- /dev/null +++ b/Source/gmock/gmock.vcxproj.filters @@ -0,0 +1,25 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Source Files + + + Source Files + + + \ No newline at end of file