Skip to content

Commit

Permalink
update r729
Browse files Browse the repository at this point in the history
  • Loading branch information
srz-zumix committed Oct 21, 2014
1 parent 05f1a43 commit 5e228a4
Show file tree
Hide file tree
Showing 31 changed files with 817 additions and 77 deletions.
2 changes: 1 addition & 1 deletion doc/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ PROJECT_NAME = iutest
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER = 1.10.99.26
PROJECT_NUMBER = 1.10.99.28

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
Expand Down
13 changes: 7 additions & 6 deletions include/gtest/iutest_switch.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@
#include "switch/iutest_switch_port.hpp"
#include "switch/iutest_switch_core.hpp"

#include "switch/iutest_switch_gmock.hpp"

#include "switch/iutest_switch_assert.hpp"
#include "switch/iutest_switch_expect.hpp"
#include "switch/iutest_switch_inform.hpp"
Expand Down Expand Up @@ -167,6 +169,9 @@ namespace tr1
// include
#include "../iutest_ver.hpp"
#include <gtest/gtest.h>
#if defined(IUTEST_USE_GMOCK)
#include <gmock/gmock.h>
#endif
#include "iutest_gtest_ver.hpp"
#include "../internal/iutest_pragma.hpp"

Expand All @@ -192,9 +197,6 @@ namespace tr1
#undef IUTEST_HAS_TYPED_TEST_P
#undef IUTEST_TYPED_TEST_P_STRICT

#undef IUTEST_HAS_MATCHERS
#undef IUTEST_HAS_MATCHER_ALLOF_AND_ANYOF
#undef IUTEST_HAS_MATCHER_ELEMENTSARE
#undef IUTEST_HAS_ARITHMETIC_EXPRESSION_DECOMPOSE
#undef IUTEST_HAS_BITWISE_EXPRESSION_DECOMPOSE

Expand Down Expand Up @@ -251,9 +253,6 @@ namespace tr1
#define IUTEST_HAS_TYPED_TEST_P GTEST_HAS_TYPED_TEST_P
#define IUTEST_TYPED_TEST_P_STRICT 1

#define IUTEST_HAS_MATCHERS 0
#define IUTEST_HAS_MATCHER_ALLOF_AND_ANYOF 0
#define IUTEST_HAS_MATCHER_ELEMENTSARE 0
#define IUTEST_HAS_ARITHMETIC_EXPRESSION_DECOMPOSE 0
#define IUTEST_HAS_BITWISE_EXPRESSION_DECOMPOSE 1

Expand All @@ -280,6 +279,8 @@ namespace tr1
#include "switch/iutest_switch_port.hpp"
#include "switch/iutest_switch_core.hpp"

#include "switch/iutest_switch_gmock.hpp"

#include "switch/iutest_switch_assert.hpp"
#include "switch/iutest_switch_expect.hpp"
#include "switch/iutest_switch_inform.hpp"
Expand Down
127 changes: 127 additions & 0 deletions include/gtest/switch/iutest_switch_gmock.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
//======================================================================
//-----------------------------------------------------------------------
/**
* @file iutest_switch_skip.hpp
* @brief IUTEST_SKIP 切り替え定義 ファイル
*
* @author t.shirayanagi
* @par copyright
* Copyright (C) 2012-2014, Takazumi Shirayanagi\n
* This software is released under the new BSD License,
* see LICENSE
*/
//-----------------------------------------------------------------------
//======================================================================
#ifndef INCG_IRIS_IUTEST_SWITCH_GMOCK_HPP_4212321D_F709_4904_AAF7_5E1BE18C0947_
#define INCG_IRIS_IUTEST_SWITCH_GMOCK_HPP_4212321D_F709_4904_AAF7_5E1BE18C0947_

#if !defined(IUTEST_USE_GTEST)

//======================================================================
// define

#else // !defined(IUTEST_USE_GTEST)

//======================================================================
// undef
#if defined(INCG_IRIS_IUTEST_HPP_)

#undef IUTEST_ASSERT_THAT
#undef IUTEST_EXPECT_THAT
#undef IUTEST_INFORM_THAT
#undef IUTEST_ASSUME_THAT

#undef IUTEST_HAS_MATCHERS
#undef IUTEST_HAS_MATCHER_ALLOF_AND_ANYOF
#undef IUTEST_HAS_MATCHER_ELEMENTSARE

#endif

//======================================================================
// define

#if defined(IUTEST_USE_GMOCK)

#define IUTEST_HAS_MATCHERS 1
#define IUTEST_HAS_MATCHER_ALLOF_AND_ANYOF 1
#define IUTEST_HAS_MATCHER_ELEMENTSARE 1

#define IUTEST_ASSERT_THAT ASSERT_THAT
#define IUTEST_EXPECT_THAT EXPECT_THAT
#define IUTEST_INFORM_THAT INFORM_THAT
#define IUTEST_ASSUME_THAT ASSUME_THAT

#define INFORM_THAT(value, matcher) \
INFORM_PRED_FORMAT1(::testing::internal::MakePredicateFormatterFromMatcher(matcher), value)
#define ASSUME_THAT(value, matcher) \
ASSUME_PRED_FORMAT1(::testing::internal::MakePredicateFormatterFromMatcher(matcher), value)

#else

#define IUTEST_HAS_MATCHERS 0
#define IUTEST_HAS_MATCHER_ALLOF_AND_ANYOF 0
#define IUTEST_HAS_MATCHER_ELEMENTSARE 0

#endif

//======================================================================
// using
#if defined(IUTEST_USE_GMOCK)

namespace testing {
namespace matchers
{

using ::testing::Not;
using ::testing::Eq;
using ::testing::Ne;
using ::testing::Lt;
using ::testing::Le;
using ::testing::Gt;
using ::testing::Ge;
using ::testing::IsNull;
using ::testing::NotNull;
using ::testing::DoubleEq;
using ::testing::FloatEq;

using ::testing::NanSensitiveDoubleEq;
using ::testing::NanSensitiveFloatEq;

using ::testing::StrEq;
using ::testing::StrNe;
using ::testing::StrCaseEq;
using ::testing::StrCaseNe;
using ::testing::HasSubstr;
using ::testing::StartsWith;
using ::testing::EndsWith;

using ::testing::Contains;
using ::testing::Each;
using ::testing::Key;
using ::testing::Pair;
using ::testing::Field;
using ::testing::Property;

using ::testing::ResultOf;
using ::testing::Pointee;

using ::testing::ElementsAre;
using ::testing::ElementsAreArray;

using ::testing::AllOf;
using ::testing::AnyOf;

using ::testing::A;
using ::testing::_;

template<typename T>
inline internal::EqMatcher<T> Equals(T x) { return Eq(x); }

} // end of namespace matcher
} // end of namespace testing

#endif

#endif // !defined(IUTEST_USE_GTEST)

#endif // INCG_IRIS_IUTEST_SWITCH_SKIP_HPP_3CFB2B8D_9C8D_4B4F_9843_2FE38126BB31_
4 changes: 2 additions & 2 deletions include/iutest_ver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@

//======================================================================
// define
#define IUTEST_VER 0x01109927u //!< iutest version 1.10.99.27
#define IUTEST_VER 0x01109928u //!< iutest version 1.10.99.28
#define IUTEST_MAJORVER 0x01u //!< Major Version
#define IUTEST_MINORVER 0x10u //!< Minor Version
#define IUTEST_BUILD 0x99u //!< Build
#define IUTEST_REVISION 0x27u //!< Revision
#define IUTEST_REVISION 0x28u //!< Revision

/**
* @mainpage
Expand Down
1 change: 1 addition & 0 deletions projects/msvc10/iutest.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@
<ClInclude Include="..\..\include\gtest\switch\iutest_switch_assertion_return.hpp" />
<ClInclude Include="..\..\include\gtest\switch\iutest_switch_assume.hpp" />
<ClInclude Include="..\..\include\gtest\switch\iutest_switch_filepath.hpp" />
<ClInclude Include="..\..\include\gtest\switch\iutest_switch_gmock.hpp" />
<ClInclude Include="..\..\include\gtest\switch\iutest_switch_no_failure.hpp" />
<ClInclude Include="..\..\include\gtest\switch\iutest_switch_pred.hpp" />
<ClInclude Include="..\..\include\internal\iutest_default_main.hpp" />
Expand Down
3 changes: 3 additions & 0 deletions projects/msvc10/iutest.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,9 @@
<ClInclude Include="..\..\include\listener\iutest_junit_xml_generator.hpp">
<Filter>iutest\listener</Filter>
</ClInclude>
<ClInclude Include="..\..\include\gtest\switch\iutest_switch_gmock.hpp">
<Filter>iutest\gtest\switch</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="..\..\include\impl\iutest_body.ipp">
Expand Down
1 change: 1 addition & 0 deletions projects/msvc11/iutest.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@
<ClInclude Include="..\..\include\gtest\switch\iutest_switch_assertion_return.hpp" />
<ClInclude Include="..\..\include\gtest\switch\iutest_switch_assume.hpp" />
<ClInclude Include="..\..\include\gtest\switch\iutest_switch_filepath.hpp" />
<ClInclude Include="..\..\include\gtest\switch\iutest_switch_gmock.hpp" />
<ClInclude Include="..\..\include\gtest\switch\iutest_switch_no_failure.hpp" />
<ClInclude Include="..\..\include\gtest\switch\iutest_switch_pred.hpp" />
<ClInclude Include="..\..\include\internal\iutest_default_main.hpp" />
Expand Down
3 changes: 3 additions & 0 deletions projects/msvc11/iutest.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,9 @@
<ClInclude Include="..\..\include\listener\iutest_junit_xml_generator.hpp">
<Filter>iutest\listener</Filter>
</ClInclude>
<ClInclude Include="..\..\include\gtest\switch\iutest_switch_gmock.hpp">
<Filter>iutest\gtest\switch</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="..\..\include\impl\iutest_body.ipp">
Expand Down
40 changes: 40 additions & 0 deletions projects/msvc12/gmock/gmock1/gmock1.vcxproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
<?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_gmock|Win32">
<Configuration>Debug_gmock</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug_gtest|Win32">
<Configuration>Debug_gtest</Configuration>
<Platform>Win32</Platform>
Expand All @@ -25,6 +29,11 @@
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_gmock|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
Expand All @@ -42,6 +51,9 @@
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug_gtest|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug_gmock|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
Expand All @@ -58,13 +70,20 @@
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug_gtest|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug_gmock|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug_gtest|Win32'">$(Configuration)\</IntDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug_gmock|Win32'">$(Configuration)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug_gtest|Win32'">true</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug_gmock|Win32'">true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_gtest|Win32'">
<LibraryWPath>$(LibraryWPath)</LibraryWPath>
<LibraryPath>$(GMOCK_ROOT)\msvc\2013\Debug;$(LibraryPath)</LibraryPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_gmock|Win32'">
<LibraryWPath>$(LibraryWPath)</LibraryWPath>
<LibraryPath>$(GMOCK_ROOT)\msvc\2013\Debug;$(LibraryPath)</LibraryPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LibraryWPath>$(LibraryWPath)</LibraryWPath>
<LibraryPath>$(GMOCK_ROOT)\msvc\2013\Debug;$(LibraryPath)</LibraryPath>
Expand Down Expand Up @@ -138,6 +157,27 @@
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug_gmock|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(IUTEST_ROOT)\include;$(GMOCK_ROOT)\include;$(GMOCK_ROOT)\gtest\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;IUTEST_USE_GTEST;IUTEST_USE_GMOCK;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalDependencies>gmock.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\..\..\..\samples\gmock\main.cpp" />
</ItemGroup>
Expand Down
38 changes: 38 additions & 0 deletions projects/msvc12/gtest/gtest1/gtest1.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
<Configuration>Debug_CTP</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug_gmock|Win32">
<Configuration>Debug_gmock</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug_gtest|Win32">
<Configuration>Debug_gtest</Configuration>
<Platform>Win32</Platform>
Expand Down Expand Up @@ -46,6 +50,11 @@
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_gmock|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
Expand Down Expand Up @@ -78,6 +87,9 @@
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug_gtest|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug_gmock|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
Expand Down Expand Up @@ -112,10 +124,15 @@
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug_gtest|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug_gmock|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug_gtest|Win32'">$(Configuration)\</IntDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug_gmock|Win32'">$(Configuration)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug_gtest|Win32'">true</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug_gmock|Win32'">true</LinkIncremental>
<IncludePath Condition="'$(Configuration)|$(Platform)'=='Debug_gtest|Win32'">$(GTEST_ROOT)\include;$(IncludePath)</IncludePath>
<IncludePath Condition="'$(Configuration)|$(Platform)'=='Debug_gmock|Win32'">$(GTEST_ROOT)\include;$(IncludePath)</IncludePath>
<LibraryPath Condition="'$(Configuration)|$(Platform)'=='Debug_gtest|Win32'">$(GTEST_VC12_LIB)\gtest\Debug;$(GTEST_ROOT)\msvc\gtest\Debug;$(LibraryPath)</LibraryPath>
<LibraryPath Condition="'$(Configuration)|$(Platform)'=='Debug_gmock|Win32'">$(GTEST_VC12_LIB)\gtest\Debug;$(GTEST_ROOT)\msvc\gtest\Debug;$(LibraryPath)</LibraryPath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
Expand Down Expand Up @@ -242,6 +259,27 @@
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug_gmock|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(ProjectDir)\..\..\..\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;IUTEST_USE_GTEST;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalDependencies>gtestd.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Console</SubSystem>
<TargetMachine>MachineX86</TargetMachine>
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
</Link>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
Expand Down

0 comments on commit 5e228a4

Please sign in to comment.