Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
yangql
googletest
Commits
fa673010
Unverified
Commit
fa673010
authored
Jan 02, 2018
by
Gennadiy Civil
Committed by
GitHub
Jan 02, 2018
Browse files
Merge branch 'master' into uintptr
parents
ca6a70c6
1c2f1907
Changes
177
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
213 additions
and
845 deletions
+213
-845
googletest/msvc/gtest_main.vcproj
googletest/msvc/gtest_main.vcproj
+0
-129
googletest/msvc/gtest_prod_test-md.vcproj
googletest/msvc/gtest_prod_test-md.vcproj
+0
-164
googletest/msvc/gtest_prod_test.vcproj
googletest/msvc/gtest_prod_test.vcproj
+0
-164
googletest/msvc/gtest_unittest-md.vcproj
googletest/msvc/gtest_unittest-md.vcproj
+0
-147
googletest/msvc/gtest_unittest.vcproj
googletest/msvc/gtest_unittest.vcproj
+0
-147
googletest/samples/sample10_unittest.cc
googletest/samples/sample10_unittest.cc
+0
-4
googletest/samples/sample1_unittest.cc
googletest/samples/sample1_unittest.cc
+2
-1
googletest/samples/sample2_unittest.cc
googletest/samples/sample2_unittest.cc
+2
-1
googletest/samples/sample3_unittest.cc
googletest/samples/sample3_unittest.cc
+6
-5
googletest/samples/sample4_unittest.cc
googletest/samples/sample4_unittest.cc
+2
-1
googletest/samples/sample5_unittest.cc
googletest/samples/sample5_unittest.cc
+2
-2
googletest/samples/sample6_unittest.cc
googletest/samples/sample6_unittest.cc
+2
-1
googletest/samples/sample7_unittest.cc
googletest/samples/sample7_unittest.cc
+10
-22
googletest/samples/sample8_unittest.cc
googletest/samples/sample8_unittest.cc
+2
-1
googletest/samples/sample9_unittest.cc
googletest/samples/sample9_unittest.cc
+0
-3
googletest/scripts/fuse_gtest_files.py
googletest/scripts/fuse_gtest_files.py
+1
-1
googletest/src/gtest-internal-inl.h
googletest/src/gtest-internal-inl.h
+0
-4
googletest/src/gtest-printers.cc
googletest/src/gtest-printers.cc
+4
-1
googletest/src/gtest.cc
googletest/src/gtest.cc
+62
-47
googletest/test/BUILD.bazel
googletest/test/BUILD.bazel
+118
-0
No files found.
googletest/msvc/gtest_main.vcproj
deleted
100644 → 0
View file @
ca6a70c6
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType=
"Visual C++"
Version=
"7.10"
Name=
"gtest_main"
ProjectGUID=
"{3AF54C8A-10BF-4332-9147-F68ED9862032}"
Keyword=
"Win32Proj"
>
<Platforms>
<Platform
Name=
"Win32"
/>
</Platforms>
<Configurations>
<Configuration
Name=
"Debug|Win32"
OutputDirectory=
"$(SolutionName)/$(ConfigurationName)"
IntermediateDirectory=
"$(OutDir)/$(ProjectName)"
ConfigurationType=
"4"
CharacterSet=
"2"
ReferencesPath=
""
>
<Tool
Name=
"VCCLCompilerTool"
Optimization=
"0"
PreprocessorDefinitions=
"WIN32;_DEBUG;_LIB"
MinimalRebuild=
"TRUE"
BasicRuntimeChecks=
"3"
RuntimeLibrary=
"5"
UsePrecompiledHeader=
"0"
WarningLevel=
"3"
Detect64BitPortabilityProblems=
"FALSE"
DebugInformationFormat=
"4"
/>
<Tool
Name=
"VCCustomBuildTool"
/>
<Tool
Name=
"VCLibrarianTool"
OutputFile=
"$(OutDir)/$(ProjectName)d.lib"
/>
<Tool
Name=
"VCMIDLTool"
/>
<Tool
Name=
"VCPostBuildEventTool"
/>
<Tool
Name=
"VCPreBuildEventTool"
/>
<Tool
Name=
"VCPreLinkEventTool"
/>
<Tool
Name=
"VCResourceCompilerTool"
/>
<Tool
Name=
"VCWebServiceProxyGeneratorTool"
/>
<Tool
Name=
"VCXMLDataGeneratorTool"
/>
<Tool
Name=
"VCManagedWrapperGeneratorTool"
/>
<Tool
Name=
"VCAuxiliaryManagedWrapperGeneratorTool"
/>
</Configuration>
<Configuration
Name=
"Release|Win32"
OutputDirectory=
"$(SolutionName)/$(ConfigurationName)"
IntermediateDirectory=
"$(OutDir)/$(ProjectName)"
ConfigurationType=
"4"
CharacterSet=
"2"
ReferencesPath=
""..\include";"..""
>
<Tool
Name=
"VCCLCompilerTool"
PreprocessorDefinitions=
"WIN32;NDEBUG;_LIB"
RuntimeLibrary=
"4"
UsePrecompiledHeader=
"0"
WarningLevel=
"3"
Detect64BitPortabilityProblems=
"FALSE"
DebugInformationFormat=
"3"
/>
<Tool
Name=
"VCCustomBuildTool"
/>
<Tool
Name=
"VCLibrarianTool"
OutputFile=
"$(OutDir)/$(ProjectName).lib"
/>
<Tool
Name=
"VCMIDLTool"
/>
<Tool
Name=
"VCPostBuildEventTool"
/>
<Tool
Name=
"VCPreBuildEventTool"
/>
<Tool
Name=
"VCPreLinkEventTool"
/>
<Tool
Name=
"VCResourceCompilerTool"
/>
<Tool
Name=
"VCWebServiceProxyGeneratorTool"
/>
<Tool
Name=
"VCXMLDataGeneratorTool"
/>
<Tool
Name=
"VCManagedWrapperGeneratorTool"
/>
<Tool
Name=
"VCAuxiliaryManagedWrapperGeneratorTool"
/>
</Configuration>
</Configurations>
<References>
<ProjectReference
ReferencedProjectIdentifier=
"{C8F6C172-56F2-4E76-B5FA-C3B423B31BE7}"
Name=
"gtest"
/>
</References>
<Files>
<Filter
Name=
"Source Files"
Filter=
"cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier=
"{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath=
"..\src\gtest_main.cc"
>
<FileConfiguration
Name=
"Debug|Win32"
>
<Tool
Name=
"VCCLCompilerTool"
AdditionalIncludeDirectories=
""..";"..\include""
/>
</FileConfiguration>
<FileConfiguration
Name=
"Release|Win32"
>
<Tool
Name=
"VCCLCompilerTool"
AdditionalIncludeDirectories=
""..";"..\include""
/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name=
"Header Files"
Filter=
"h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier=
"{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>
googletest/msvc/gtest_prod_test-md.vcproj
deleted
100644 → 0
View file @
ca6a70c6
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType=
"Visual C++"
Version=
"7.10"
Name=
"gtest_prod_test-md"
ProjectGUID=
"{24848551-EF4F-47E8-9A9D-EA4D49BC3ECB}"
Keyword=
"Win32Proj"
>
<Platforms>
<Platform
Name=
"Win32"
/>
</Platforms>
<Configurations>
<Configuration
Name=
"Debug|Win32"
OutputDirectory=
"$(SolutionName)/$(ConfigurationName)"
IntermediateDirectory=
"$(OutDir)/$(ProjectName)"
ConfigurationType=
"1"
CharacterSet=
"2"
>
<Tool
Name=
"VCCLCompilerTool"
Optimization=
"0"
PreprocessorDefinitions=
"WIN32;_DEBUG;_CONSOLE"
MinimalRebuild=
"TRUE"
BasicRuntimeChecks=
"3"
RuntimeLibrary=
"3"
UsePrecompiledHeader=
"3"
WarningLevel=
"3"
Detect64BitPortabilityProblems=
"FALSE"
DebugInformationFormat=
"4"
/>
<Tool
Name=
"VCCustomBuildTool"
/>
<Tool
Name=
"VCLinkerTool"
OutputFile=
"$(OutDir)/gtest_prod_test.exe"
LinkIncremental=
"2"
GenerateDebugInformation=
"TRUE"
ProgramDatabaseFile=
"$(OutDir)/gtest_prod_test.pdb"
SubSystem=
"1"
TargetMachine=
"1"
/>
<Tool
Name=
"VCMIDLTool"
/>
<Tool
Name=
"VCPostBuildEventTool"
/>
<Tool
Name=
"VCPreBuildEventTool"
/>
<Tool
Name=
"VCPreLinkEventTool"
/>
<Tool
Name=
"VCResourceCompilerTool"
/>
<Tool
Name=
"VCWebServiceProxyGeneratorTool"
/>
<Tool
Name=
"VCXMLDataGeneratorTool"
/>
<Tool
Name=
"VCWebDeploymentTool"
/>
<Tool
Name=
"VCManagedWrapperGeneratorTool"
/>
<Tool
Name=
"VCAuxiliaryManagedWrapperGeneratorTool"
/>
</Configuration>
<Configuration
Name=
"Release|Win32"
OutputDirectory=
"$(SolutionName)/$(ConfigurationName)"
IntermediateDirectory=
"$(OutDir)/$(ProjectName)"
ConfigurationType=
"1"
CharacterSet=
"2"
>
<Tool
Name=
"VCCLCompilerTool"
PreprocessorDefinitions=
"WIN32;NDEBUG;_CONSOLE"
RuntimeLibrary=
"2"
UsePrecompiledHeader=
"3"
WarningLevel=
"3"
Detect64BitPortabilityProblems=
"FALSE"
DebugInformationFormat=
"3"
/>
<Tool
Name=
"VCCustomBuildTool"
/>
<Tool
Name=
"VCLinkerTool"
OutputFile=
"$(OutDir)/gtest_prod_test.exe"
LinkIncremental=
"1"
GenerateDebugInformation=
"TRUE"
SubSystem=
"1"
OptimizeReferences=
"2"
EnableCOMDATFolding=
"2"
TargetMachine=
"1"
/>
<Tool
Name=
"VCMIDLTool"
/>
<Tool
Name=
"VCPostBuildEventTool"
/>
<Tool
Name=
"VCPreBuildEventTool"
/>
<Tool
Name=
"VCPreLinkEventTool"
/>
<Tool
Name=
"VCResourceCompilerTool"
/>
<Tool
Name=
"VCWebServiceProxyGeneratorTool"
/>
<Tool
Name=
"VCXMLDataGeneratorTool"
/>
<Tool
Name=
"VCWebDeploymentTool"
/>
<Tool
Name=
"VCManagedWrapperGeneratorTool"
/>
<Tool
Name=
"VCAuxiliaryManagedWrapperGeneratorTool"
/>
</Configuration>
</Configurations>
<References>
<ProjectReference
ReferencedProjectIdentifier=
"{3AF54C8A-10BF-4332-9147-F68ED9862033}"
Name=
"gtest_main-md"
/>
</References>
<Files>
<Filter
Name=
"Source Files"
Filter=
"cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier=
"{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath=
"..\test\gtest_prod_test.cc"
>
<FileConfiguration
Name=
"Debug|Win32"
>
<Tool
Name=
"VCCLCompilerTool"
AdditionalIncludeDirectories=
""..";"..\include""
UsePrecompiledHeader=
"0"
/>
</FileConfiguration>
<FileConfiguration
Name=
"Release|Win32"
>
<Tool
Name=
"VCCLCompilerTool"
AdditionalIncludeDirectories=
""..";"..\include""
UsePrecompiledHeader=
"0"
/>
</FileConfiguration>
</File>
<File
RelativePath=
"..\test\production.cc"
>
<FileConfiguration
Name=
"Debug|Win32"
>
<Tool
Name=
"VCCLCompilerTool"
AdditionalIncludeDirectories=
""..";"..\include""
UsePrecompiledHeader=
"0"
/>
</FileConfiguration>
<FileConfiguration
Name=
"Release|Win32"
>
<Tool
Name=
"VCCLCompilerTool"
AdditionalIncludeDirectories=
""..";"..\include""
UsePrecompiledHeader=
"0"
/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name=
"Header Files"
Filter=
"h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier=
"{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath=
"..\test\production.h"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>
googletest/msvc/gtest_prod_test.vcproj
deleted
100644 → 0
View file @
ca6a70c6
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType=
"Visual C++"
Version=
"7.10"
Name=
"gtest_prod_test"
ProjectGUID=
"{24848551-EF4F-47E8-9A9D-EA4D49BC3ECA}"
Keyword=
"Win32Proj"
>
<Platforms>
<Platform
Name=
"Win32"
/>
</Platforms>
<Configurations>
<Configuration
Name=
"Debug|Win32"
OutputDirectory=
"$(SolutionName)/$(ConfigurationName)"
IntermediateDirectory=
"$(OutDir)/$(ProjectName)"
ConfigurationType=
"1"
CharacterSet=
"2"
>
<Tool
Name=
"VCCLCompilerTool"
Optimization=
"0"
PreprocessorDefinitions=
"WIN32;_DEBUG;_CONSOLE"
MinimalRebuild=
"TRUE"
BasicRuntimeChecks=
"3"
RuntimeLibrary=
"5"
UsePrecompiledHeader=
"3"
WarningLevel=
"3"
Detect64BitPortabilityProblems=
"FALSE"
DebugInformationFormat=
"4"
/>
<Tool
Name=
"VCCustomBuildTool"
/>
<Tool
Name=
"VCLinkerTool"
OutputFile=
"$(OutDir)/gtest_prod_test.exe"
LinkIncremental=
"2"
GenerateDebugInformation=
"TRUE"
ProgramDatabaseFile=
"$(OutDir)/gtest_prod_test.pdb"
SubSystem=
"1"
TargetMachine=
"1"
/>
<Tool
Name=
"VCMIDLTool"
/>
<Tool
Name=
"VCPostBuildEventTool"
/>
<Tool
Name=
"VCPreBuildEventTool"
/>
<Tool
Name=
"VCPreLinkEventTool"
/>
<Tool
Name=
"VCResourceCompilerTool"
/>
<Tool
Name=
"VCWebServiceProxyGeneratorTool"
/>
<Tool
Name=
"VCXMLDataGeneratorTool"
/>
<Tool
Name=
"VCWebDeploymentTool"
/>
<Tool
Name=
"VCManagedWrapperGeneratorTool"
/>
<Tool
Name=
"VCAuxiliaryManagedWrapperGeneratorTool"
/>
</Configuration>
<Configuration
Name=
"Release|Win32"
OutputDirectory=
"$(SolutionName)/$(ConfigurationName)"
IntermediateDirectory=
"$(OutDir)/$(ProjectName)"
ConfigurationType=
"1"
CharacterSet=
"2"
>
<Tool
Name=
"VCCLCompilerTool"
PreprocessorDefinitions=
"WIN32;NDEBUG;_CONSOLE"
RuntimeLibrary=
"4"
UsePrecompiledHeader=
"3"
WarningLevel=
"3"
Detect64BitPortabilityProblems=
"FALSE"
DebugInformationFormat=
"3"
/>
<Tool
Name=
"VCCustomBuildTool"
/>
<Tool
Name=
"VCLinkerTool"
OutputFile=
"$(OutDir)/gtest_prod_test.exe"
LinkIncremental=
"1"
GenerateDebugInformation=
"TRUE"
SubSystem=
"1"
OptimizeReferences=
"2"
EnableCOMDATFolding=
"2"
TargetMachine=
"1"
/>
<Tool
Name=
"VCMIDLTool"
/>
<Tool
Name=
"VCPostBuildEventTool"
/>
<Tool
Name=
"VCPreBuildEventTool"
/>
<Tool
Name=
"VCPreLinkEventTool"
/>
<Tool
Name=
"VCResourceCompilerTool"
/>
<Tool
Name=
"VCWebServiceProxyGeneratorTool"
/>
<Tool
Name=
"VCXMLDataGeneratorTool"
/>
<Tool
Name=
"VCWebDeploymentTool"
/>
<Tool
Name=
"VCManagedWrapperGeneratorTool"
/>
<Tool
Name=
"VCAuxiliaryManagedWrapperGeneratorTool"
/>
</Configuration>
</Configurations>
<References>
<ProjectReference
ReferencedProjectIdentifier=
"{3AF54C8A-10BF-4332-9147-F68ED9862032}"
Name=
"gtest_main"
/>
</References>
<Files>
<Filter
Name=
"Source Files"
Filter=
"cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier=
"{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath=
"..\test\gtest_prod_test.cc"
>
<FileConfiguration
Name=
"Debug|Win32"
>
<Tool
Name=
"VCCLCompilerTool"
AdditionalIncludeDirectories=
""..";"..\include""
UsePrecompiledHeader=
"0"
/>
</FileConfiguration>
<FileConfiguration
Name=
"Release|Win32"
>
<Tool
Name=
"VCCLCompilerTool"
AdditionalIncludeDirectories=
""..";"..\include""
UsePrecompiledHeader=
"0"
/>
</FileConfiguration>
</File>
<File
RelativePath=
"..\test\production.cc"
>
<FileConfiguration
Name=
"Debug|Win32"
>
<Tool
Name=
"VCCLCompilerTool"
AdditionalIncludeDirectories=
""..";"..\include""
UsePrecompiledHeader=
"0"
/>
</FileConfiguration>
<FileConfiguration
Name=
"Release|Win32"
>
<Tool
Name=
"VCCLCompilerTool"
AdditionalIncludeDirectories=
""..";"..\include""
UsePrecompiledHeader=
"0"
/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name=
"Header Files"
Filter=
"h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier=
"{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath=
"..\test\production.h"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>
googletest/msvc/gtest_unittest-md.vcproj
deleted
100644 → 0
View file @
ca6a70c6
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType=
"Visual C++"
Version=
"7.10"
Name=
"gtest_unittest-md"
ProjectGUID=
"{4D9FDFB5-986A-4139-823C-F4EE0ED481A2}"
Keyword=
"Win32Proj"
>
<Platforms>
<Platform
Name=
"Win32"
/>
</Platforms>
<Configurations>
<Configuration
Name=
"Debug|Win32"
OutputDirectory=
"$(SolutionName)/$(ConfigurationName)"
IntermediateDirectory=
"$(OutDir)/$(ProjectName)"
ConfigurationType=
"1"
CharacterSet=
"2"
>
<Tool
Name=
"VCCLCompilerTool"
Optimization=
"0"
PreprocessorDefinitions=
"WIN32;_DEBUG;_CONSOLE"
MinimalRebuild=
"TRUE"
BasicRuntimeChecks=
"3"
RuntimeLibrary=
"3"
UsePrecompiledHeader=
"3"
WarningLevel=
"3"
Detect64BitPortabilityProblems=
"FALSE"
DebugInformationFormat=
"4"
/>
<Tool
Name=
"VCCustomBuildTool"
/>
<Tool
Name=
"VCLinkerTool"
OutputFile=
"$(OutDir)/gtest_unittest.exe"
LinkIncremental=
"2"
GenerateDebugInformation=
"TRUE"
ProgramDatabaseFile=
"$(OutDir)/gtest_unittest.pdb"
SubSystem=
"1"
TargetMachine=
"1"
/>
<Tool
Name=
"VCMIDLTool"
/>
<Tool
Name=
"VCPostBuildEventTool"
/>
<Tool
Name=
"VCPreBuildEventTool"
/>
<Tool
Name=
"VCPreLinkEventTool"
/>
<Tool
Name=
"VCResourceCompilerTool"
/>
<Tool
Name=
"VCWebServiceProxyGeneratorTool"
/>
<Tool
Name=
"VCXMLDataGeneratorTool"
/>
<Tool
Name=
"VCWebDeploymentTool"
/>
<Tool
Name=
"VCManagedWrapperGeneratorTool"
/>
<Tool
Name=
"VCAuxiliaryManagedWrapperGeneratorTool"
/>
</Configuration>
<Configuration
Name=
"Release|Win32"
OutputDirectory=
"$(SolutionName)/$(ConfigurationName)"
IntermediateDirectory=
"$(OutDir)/$(ProjectName)"
ConfigurationType=
"1"
CharacterSet=
"2"
>
<Tool
Name=
"VCCLCompilerTool"
PreprocessorDefinitions=
"WIN32;NDEBUG;_CONSOLE"
RuntimeLibrary=
"2"
UsePrecompiledHeader=
"3"
WarningLevel=
"3"
Detect64BitPortabilityProblems=
"FALSE"
DebugInformationFormat=
"3"
/>
<Tool
Name=
"VCCustomBuildTool"
/>
<Tool
Name=
"VCLinkerTool"
OutputFile=
"$(OutDir)/gtest_unittest.exe"
LinkIncremental=
"1"
GenerateDebugInformation=
"TRUE"
SubSystem=
"1"
OptimizeReferences=
"2"
EnableCOMDATFolding=
"2"
TargetMachine=
"1"
/>
<Tool
Name=
"VCMIDLTool"
/>
<Tool
Name=
"VCPostBuildEventTool"
/>
<Tool
Name=
"VCPreBuildEventTool"
/>
<Tool
Name=
"VCPreLinkEventTool"
/>
<Tool
Name=
"VCResourceCompilerTool"
/>
<Tool
Name=
"VCWebServiceProxyGeneratorTool"
/>
<Tool
Name=
"VCXMLDataGeneratorTool"
/>
<Tool
Name=
"VCWebDeploymentTool"
/>
<Tool
Name=
"VCManagedWrapperGeneratorTool"
/>
<Tool
Name=
"VCAuxiliaryManagedWrapperGeneratorTool"
/>
</Configuration>
</Configurations>
<References>
<ProjectReference
ReferencedProjectIdentifier=
"{3AF54C8A-10BF-4332-9147-F68ED9862033}"
Name=
"gtest_main-md"
/>
</References>
<Files>
<Filter
Name=
"Source Files"
Filter=
"cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier=
"{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath=
"..\test\gtest_unittest.cc"
>
<FileConfiguration
Name=
"Debug|Win32"
>
<Tool
Name=
"VCCLCompilerTool"
Optimization=
"1"
AdditionalIncludeDirectories=
""..";"..\include""
BasicRuntimeChecks=
"0"
UsePrecompiledHeader=
"0"
DebugInformationFormat=
"3"
/>
</FileConfiguration>
<FileConfiguration
Name=
"Release|Win32"
>
<Tool
Name=
"VCCLCompilerTool"
AdditionalIncludeDirectories=
""..";"..\include""
UsePrecompiledHeader=
"0"
/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name=
"Header Files"
Filter=
"h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier=
"{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>
googletest/msvc/gtest_unittest.vcproj
deleted
100644 → 0
View file @
ca6a70c6
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType=
"Visual C++"
Version=
"7.10"
Name=
"gtest_unittest"
ProjectGUID=
"{4D9FDFB5-986A-4139-823C-F4EE0ED481A1}"
Keyword=
"Win32Proj"
>
<Platforms>
<Platform
Name=
"Win32"
/>
</Platforms>
<Configurations>
<Configuration
Name=
"Debug|Win32"
OutputDirectory=
"$(SolutionName)/$(ConfigurationName)"
IntermediateDirectory=
"$(OutDir)/$(ProjectName)"
ConfigurationType=
"1"
CharacterSet=
"2"
>
<Tool
Name=
"VCCLCompilerTool"
Optimization=
"0"
PreprocessorDefinitions=
"WIN32;_DEBUG;_CONSOLE"
MinimalRebuild=
"TRUE"
BasicRuntimeChecks=
"3"
RuntimeLibrary=
"5"
UsePrecompiledHeader=
"3"
WarningLevel=
"3"
Detect64BitPortabilityProblems=
"FALSE"
DebugInformationFormat=
"4"
/>
<Tool
Name=
"VCCustomBuildTool"
/>
<Tool
Name=
"VCLinkerTool"
OutputFile=
"$(OutDir)/gtest_unittest.exe"
LinkIncremental=
"2"
GenerateDebugInformation=
"TRUE"
ProgramDatabaseFile=
"$(OutDir)/gtest_unittest.pdb"
SubSystem=
"1"
TargetMachine=
"1"
/>
<Tool
Name=
"VCMIDLTool"
/>
<Tool
Name=
"VCPostBuildEventTool"
/>
<Tool
Name=
"VCPreBuildEventTool"
/>
<Tool
Name=
"VCPreLinkEventTool"
/>
<Tool
Name=
"VCResourceCompilerTool"
/>
<Tool
Name=
"VCWebServiceProxyGeneratorTool"
/>
<Tool
Name=
"VCXMLDataGeneratorTool"
/>
<Tool
Name=
"VCWebDeploymentTool"
/>
<Tool
Name=
"VCManagedWrapperGeneratorTool"
/>
<Tool
Name=
"VCAuxiliaryManagedWrapperGeneratorTool"
/>
</Configuration>
<Configuration
Name=
"Release|Win32"
OutputDirectory=
"$(SolutionName)/$(ConfigurationName)"
IntermediateDirectory=
"$(OutDir)/$(ProjectName)"
ConfigurationType=
"1"
CharacterSet=
"2"
>
<Tool
Name=
"VCCLCompilerTool"
PreprocessorDefinitions=
"WIN32;NDEBUG;_CONSOLE"
RuntimeLibrary=
"4"
UsePrecompiledHeader=
"3"
WarningLevel=
"3"
Detect64BitPortabilityProblems=
"FALSE"
DebugInformationFormat=
"3"
/>
<Tool
Name=
"VCCustomBuildTool"
/>
<Tool
Name=
"VCLinkerTool"
OutputFile=
"$(OutDir)/gtest_unittest.exe"
LinkIncremental=
"1"
GenerateDebugInformation=
"TRUE"
SubSystem=
"1"
OptimizeReferences=
"2"
EnableCOMDATFolding=
"2"
TargetMachine=
"1"
/>
<Tool
Name=
"VCMIDLTool"
/>
<Tool
Name=
"VCPostBuildEventTool"
/>
<Tool
Name=
"VCPreBuildEventTool"
/>
<Tool
Name=
"VCPreLinkEventTool"
/>
<Tool
Name=
"VCResourceCompilerTool"
/>
<Tool
Name=
"VCWebServiceProxyGeneratorTool"
/>
<Tool
Name=
"VCXMLDataGeneratorTool"
/>
<Tool
Name=
"VCWebDeploymentTool"
/>
<Tool
Name=
"VCManagedWrapperGeneratorTool"
/>
<Tool
Name=
"VCAuxiliaryManagedWrapperGeneratorTool"
/>
</Configuration>
</Configurations>
<References>
<ProjectReference
ReferencedProjectIdentifier=
"{3AF54C8A-10BF-4332-9147-F68ED9862032}"
Name=
"gtest_main"
/>
</References>
<Files>
<Filter
Name=
"Source Files"
Filter=
"cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier=
"{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath=
"..\test\gtest_unittest.cc"
>
<FileConfiguration
Name=
"Debug|Win32"
>
<Tool
Name=
"VCCLCompilerTool"
Optimization=
"1"
AdditionalIncludeDirectories=
""..";"..\include""
BasicRuntimeChecks=
"0"
UsePrecompiledHeader=
"0"
DebugInformationFormat=
"3"
/>
</FileConfiguration>
<FileConfiguration
Name=
"Release|Win32"
>
<Tool
Name=
"VCCLCompilerTool"
AdditionalIncludeDirectories=
""..";"..\include""
UsePrecompiledHeader=
"0"
/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name=
"Header Files"
Filter=
"h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier=
"{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>
googletest/samples/sample10_unittest.cc
View file @
fa673010
...
@@ -35,18 +35,15 @@
...
@@ -35,18 +35,15 @@
#include <stdlib.h>
#include <stdlib.h>
#include "gtest/gtest.h"
#include "gtest/gtest.h"
using
::
testing
::
EmptyTestEventListener
;
using
::
testing
::
EmptyTestEventListener
;
using
::
testing
::
InitGoogleTest
;
using
::
testing
::
InitGoogleTest
;
using
::
testing
::
Test
;
using
::
testing
::
Test
;
using
::
testing
::
TestCase
;
using
::
testing
::
TestEventListeners
;
using
::
testing
::
TestEventListeners
;
using
::
testing
::
TestInfo
;
using
::
testing
::
TestInfo
;
using
::
testing
::
TestPartResult
;
using
::
testing
::
TestPartResult
;
using
::
testing
::
UnitTest
;
using
::
testing
::
UnitTest
;
namespace
{
namespace
{
// We will track memory used by this class.
// We will track memory used by this class.
class
Water
{
class
Water
{
public:
public:
...
@@ -106,7 +103,6 @@ TEST(ListenersTest, LeaksWater) {
...
@@ -106,7 +103,6 @@ TEST(ListenersTest, LeaksWater) {
Water
*
water
=
new
Water
;
Water
*
water
=
new
Water
;
EXPECT_TRUE
(
water
!=
NULL
);
EXPECT_TRUE
(
water
!=
NULL
);
}
}
}
// namespace
}
// namespace
int
main
(
int
argc
,
char
**
argv
)
{
int
main
(
int
argc
,
char
**
argv
)
{
...
...
googletest/samples/sample1_unittest.cc
View file @
fa673010
...
@@ -46,7 +46,7 @@
...
@@ -46,7 +46,7 @@
#include <limits.h>
#include <limits.h>
#include "sample1.h"
#include "sample1.h"
#include "gtest/gtest.h"
#include "gtest/gtest.h"
namespace
{
// Step 2. Use the TEST macro to define your tests.
// Step 2. Use the TEST macro to define your tests.
//
//
...
@@ -139,6 +139,7 @@ TEST(IsPrimeTest, Positive) {
...
@@ -139,6 +139,7 @@ TEST(IsPrimeTest, Positive) {
EXPECT_FALSE
(
IsPrime
(
6
));
EXPECT_FALSE
(
IsPrime
(
6
));
EXPECT_TRUE
(
IsPrime
(
23
));
EXPECT_TRUE
(
IsPrime
(
23
));
}
}
}
// namespace
// Step 3. Call RUN_ALL_TESTS() in main().
// Step 3. Call RUN_ALL_TESTS() in main().
//
//
...
...
googletest/samples/sample2_unittest.cc
View file @
fa673010
...
@@ -42,7 +42,7 @@
...
@@ -42,7 +42,7 @@
#include "sample2.h"
#include "sample2.h"
#include "gtest/gtest.h"
#include "gtest/gtest.h"
namespace
{
// In this example, we test the MyString class (a simple string).
// In this example, we test the MyString class (a simple string).
// Tests the default c'tor.
// Tests the default c'tor.
...
@@ -107,3 +107,4 @@ TEST(MyString, Set) {
...
@@ -107,3 +107,4 @@ TEST(MyString, Set) {
s
.
Set
(
NULL
);
s
.
Set
(
NULL
);
EXPECT_STREQ
(
NULL
,
s
.
c_string
());
EXPECT_STREQ
(
NULL
,
s
.
c_string
());
}
}
}
// namespace
googletest/samples/sample3_unittest.cc
View file @
fa673010
...
@@ -65,9 +65,9 @@
...
@@ -65,9 +65,9 @@
#include "sample3-inl.h"
#include "sample3-inl.h"
#include "gtest/gtest.h"
#include "gtest/gtest.h"
namespace
{
// To use a test fixture, derive a class from testing::Test.
// To use a test fixture, derive a class from testing::Test.
class
QueueTest
:
public
testing
::
Test
{
class
QueueTest
Smpl3
:
public
testing
::
Test
{
protected:
// You should make the members protected s.t. they can be
protected:
// You should make the members protected s.t. they can be
// accessed from sub-classes.
// accessed from sub-classes.
...
@@ -120,13 +120,13 @@ class QueueTest : public testing::Test {
...
@@ -120,13 +120,13 @@ class QueueTest : public testing::Test {
// instead of TEST.
// instead of TEST.
// Tests the default c'tor.
// Tests the default c'tor.
TEST_F
(
QueueTest
,
DefaultConstructor
)
{
TEST_F
(
QueueTest
Smpl3
,
DefaultConstructor
)
{
// You can access data in the test fixture here.
// You can access data in the test fixture here.
EXPECT_EQ
(
0u
,
q0_
.
Size
());
EXPECT_EQ
(
0u
,
q0_
.
Size
());
}
}
// Tests Dequeue().
// Tests Dequeue().
TEST_F
(
QueueTest
,
Dequeue
)
{
TEST_F
(
QueueTest
Smpl3
,
Dequeue
)
{
int
*
n
=
q0_
.
Dequeue
();
int
*
n
=
q0_
.
Dequeue
();
EXPECT_TRUE
(
n
==
NULL
);
EXPECT_TRUE
(
n
==
NULL
);
...
@@ -144,8 +144,9 @@ TEST_F(QueueTest, Dequeue) {
...
@@ -144,8 +144,9 @@ TEST_F(QueueTest, Dequeue) {
}
}
// Tests the Queue::Map() function.
// Tests the Queue::Map() function.
TEST_F
(
QueueTest
,
Map
)
{
TEST_F
(
QueueTest
Smpl3
,
Map
)
{
MapTester
(
&
q0_
);
MapTester
(
&
q0_
);
MapTester
(
&
q1_
);
MapTester
(
&
q1_
);
MapTester
(
&
q2_
);
MapTester
(
&
q2_
);
}
}
}
// namespace
googletest/samples/sample4_unittest.cc
View file @
fa673010
...
@@ -31,7 +31,7 @@
...
@@ -31,7 +31,7 @@
#include "gtest/gtest.h"
#include "gtest/gtest.h"
#include "sample4.h"
#include "sample4.h"
namespace
{
// Tests the Increment() method.
// Tests the Increment() method.
TEST
(
Counter
,
Increment
)
{
TEST
(
Counter
,
Increment
)
{
Counter
c
;
Counter
c
;
...
@@ -43,3 +43,4 @@ TEST(Counter, Increment) {
...
@@ -43,3 +43,4 @@ TEST(Counter, Increment) {
EXPECT_EQ
(
1
,
c
.
Increment
());
EXPECT_EQ
(
1
,
c
.
Increment
());
EXPECT_EQ
(
2
,
c
.
Increment
());
EXPECT_EQ
(
2
,
c
.
Increment
());
}
}
}
// namespace
googletest/samples/sample5_unittest.cc
View file @
fa673010
...
@@ -49,7 +49,7 @@
...
@@ -49,7 +49,7 @@
#include "sample3-inl.h"
#include "sample3-inl.h"
#include "gtest/gtest.h"
#include "gtest/gtest.h"
#include "sample1.h"
#include "sample1.h"
namespace
{
// In this sample, we want to ensure that every test finishes within
// In this sample, we want to ensure that every test finishes within
// ~5 seconds. If a test takes longer to run, we consider it a
// ~5 seconds. If a test takes longer to run, we consider it a
// failure.
// failure.
...
@@ -191,7 +191,7 @@ TEST_F(QueueTest, Dequeue) {
...
@@ -191,7 +191,7 @@ TEST_F(QueueTest, Dequeue) {
EXPECT_EQ
(
1u
,
q2_
.
Size
());
EXPECT_EQ
(
1u
,
q2_
.
Size
());
delete
n
;
delete
n
;
}
}
}
// namespace
// If necessary, you can derive further test fixtures from a derived
// If necessary, you can derive further test fixtures from a derived
// fixture itself. For example, you can derive another fixture from
// fixture itself. For example, you can derive another fixture from
// QueueTest. Google Test imposes no limit on how deep the hierarchy
// QueueTest. Google Test imposes no limit on how deep the hierarchy
...
...
googletest/samples/sample6_unittest.cc
View file @
fa673010
...
@@ -36,7 +36,7 @@
...
@@ -36,7 +36,7 @@
#include "prime_tables.h"
#include "prime_tables.h"
#include "gtest/gtest.h"
#include "gtest/gtest.h"
namespace
{
// First, we define some factory functions for creating instances of
// First, we define some factory functions for creating instances of
// the implementations. You may be able to skip this step if all your
// the implementations. You may be able to skip this step if all your
// implementations can be constructed the same way.
// implementations can be constructed the same way.
...
@@ -222,3 +222,4 @@ INSTANTIATE_TYPED_TEST_CASE_P(OnTheFlyAndPreCalculated, // Instance name
...
@@ -222,3 +222,4 @@ INSTANTIATE_TYPED_TEST_CASE_P(OnTheFlyAndPreCalculated, // Instance name
PrimeTableImplementations
);
// Type list
PrimeTableImplementations
);
// Type list
#endif // GTEST_HAS_TYPED_TEST_P
#endif // GTEST_HAS_TYPED_TEST_P
}
// namespace
googletest/samples/sample7_unittest.cc
View file @
fa673010
...
@@ -39,8 +39,7 @@
...
@@ -39,8 +39,7 @@
#include "prime_tables.h"
#include "prime_tables.h"
#include "gtest/gtest.h"
#include "gtest/gtest.h"
namespace
{
#if GTEST_HAS_PARAM_TEST
using
::
testing
::
TestWithParam
;
using
::
testing
::
TestWithParam
;
using
::
testing
::
Values
;
using
::
testing
::
Values
;
...
@@ -65,9 +64,9 @@ PrimeTable* CreatePreCalculatedPrimeTable() {
...
@@ -65,9 +64,9 @@ PrimeTable* CreatePreCalculatedPrimeTable() {
// can refer to the test parameter by GetParam(). In this case, the test
// can refer to the test parameter by GetParam(). In this case, the test
// parameter is a factory function which we call in fixture's SetUp() to
// parameter is a factory function which we call in fixture's SetUp() to
// create and store an instance of PrimeTable.
// create and store an instance of PrimeTable.
class
PrimeTableTest
:
public
TestWithParam
<
CreatePrimeTableFunc
*>
{
class
PrimeTableTest
Smpl7
:
public
TestWithParam
<
CreatePrimeTableFunc
*>
{
public:
public:
virtual
~
PrimeTableTest
()
{
delete
table_
;
}
virtual
~
PrimeTableTest
Smpl7
()
{
delete
table_
;
}
virtual
void
SetUp
()
{
table_
=
(
*
GetParam
())();
}
virtual
void
SetUp
()
{
table_
=
(
*
GetParam
())();
}
virtual
void
TearDown
()
{
virtual
void
TearDown
()
{
delete
table_
;
delete
table_
;
...
@@ -78,7 +77,7 @@ class PrimeTableTest : public TestWithParam<CreatePrimeTableFunc*> {
...
@@ -78,7 +77,7 @@ class PrimeTableTest : public TestWithParam<CreatePrimeTableFunc*> {
PrimeTable
*
table_
;
PrimeTable
*
table_
;
};
};
TEST_P
(
PrimeTableTest
,
ReturnsFalseForNonPrimes
)
{
TEST_P
(
PrimeTableTest
Smpl7
,
ReturnsFalseForNonPrimes
)
{
EXPECT_FALSE
(
table_
->
IsPrime
(
-
5
));
EXPECT_FALSE
(
table_
->
IsPrime
(
-
5
));
EXPECT_FALSE
(
table_
->
IsPrime
(
0
));
EXPECT_FALSE
(
table_
->
IsPrime
(
0
));
EXPECT_FALSE
(
table_
->
IsPrime
(
1
));
EXPECT_FALSE
(
table_
->
IsPrime
(
1
));
...
@@ -87,7 +86,7 @@ TEST_P(PrimeTableTest, ReturnsFalseForNonPrimes) {
...
@@ -87,7 +86,7 @@ TEST_P(PrimeTableTest, ReturnsFalseForNonPrimes) {
EXPECT_FALSE
(
table_
->
IsPrime
(
100
));
EXPECT_FALSE
(
table_
->
IsPrime
(
100
));
}
}
TEST_P
(
PrimeTableTest
,
ReturnsTrueForPrimes
)
{
TEST_P
(
PrimeTableTest
Smpl7
,
ReturnsTrueForPrimes
)
{
EXPECT_TRUE
(
table_
->
IsPrime
(
2
));
EXPECT_TRUE
(
table_
->
IsPrime
(
2
));
EXPECT_TRUE
(
table_
->
IsPrime
(
3
));
EXPECT_TRUE
(
table_
->
IsPrime
(
3
));
EXPECT_TRUE
(
table_
->
IsPrime
(
5
));
EXPECT_TRUE
(
table_
->
IsPrime
(
5
));
...
@@ -96,7 +95,7 @@ TEST_P(PrimeTableTest, ReturnsTrueForPrimes) {
...
@@ -96,7 +95,7 @@ TEST_P(PrimeTableTest, ReturnsTrueForPrimes) {
EXPECT_TRUE
(
table_
->
IsPrime
(
131
));
EXPECT_TRUE
(
table_
->
IsPrime
(
131
));
}
}
TEST_P
(
PrimeTableTest
,
CanGetNextPrime
)
{
TEST_P
(
PrimeTableTest
Smpl7
,
CanGetNextPrime
)
{
EXPECT_EQ
(
2
,
table_
->
GetNextPrime
(
0
));
EXPECT_EQ
(
2
,
table_
->
GetNextPrime
(
0
));
EXPECT_EQ
(
3
,
table_
->
GetNextPrime
(
2
));
EXPECT_EQ
(
3
,
table_
->
GetNextPrime
(
2
));
EXPECT_EQ
(
5
,
table_
->
GetNextPrime
(
3
));
EXPECT_EQ
(
5
,
table_
->
GetNextPrime
(
3
));
...
@@ -112,19 +111,8 @@ TEST_P(PrimeTableTest, CanGetNextPrime) {
...
@@ -112,19 +111,8 @@ TEST_P(PrimeTableTest, CanGetNextPrime) {
//
//
// Here, we instantiate our tests with a list of two PrimeTable object
// Here, we instantiate our tests with a list of two PrimeTable object
// factory functions:
// factory functions:
INSTANTIATE_TEST_CASE_P
(
INSTANTIATE_TEST_CASE_P
(
OnTheFlyAndPreCalculated
,
PrimeTableTestSmpl7
,
OnTheFlyAndPreCalculated
,
Values
(
&
CreateOnTheFlyPrimeTable
,
PrimeTableTest
,
&
CreatePreCalculatedPrimeTable
<
1000
>
));
Values
(
&
CreateOnTheFlyPrimeTable
,
&
CreatePreCalculatedPrimeTable
<
1000
>
));
#else
// Google Test may not support value-parameterized tests with some
// compilers. If we use conditional compilation to compile out all
// code referring to the gtest_main library, MSVC linker will not link
// that library at all and consequently complain about missing entry
// point defined in that library (fatal error LNK1561: entry point
// must be defined). This dummy test keeps gtest_main linked in.
TEST
(
DummyTest
,
ValueParameterizedTestsAreNotSupportedOnThisPlatform
)
{}
#endif // GTEST_HAS_PARAM_TEST
}
// namespace
googletest/samples/sample8_unittest.cc
View file @
fa673010
...
@@ -37,7 +37,7 @@
...
@@ -37,7 +37,7 @@
#include "prime_tables.h"
#include "prime_tables.h"
#include "gtest/gtest.h"
#include "gtest/gtest.h"
namespace
{
#if GTEST_HAS_COMBINE
#if GTEST_HAS_COMBINE
// Suppose we want to introduce a new, improved implementation of PrimeTable
// Suppose we want to introduce a new, improved implementation of PrimeTable
...
@@ -171,3 +171,4 @@ INSTANTIATE_TEST_CASE_P(MeaningfulTestParameters,
...
@@ -171,3 +171,4 @@ INSTANTIATE_TEST_CASE_P(MeaningfulTestParameters,
TEST
(
DummyTest
,
CombineIsNotSupportedOnThisPlatform
)
{}
TEST
(
DummyTest
,
CombineIsNotSupportedOnThisPlatform
)
{}
#endif // GTEST_HAS_COMBINE
#endif // GTEST_HAS_COMBINE
}
// namespace
googletest/samples/sample9_unittest.cc
View file @
fa673010
...
@@ -44,9 +44,7 @@ using ::testing::TestEventListeners;
...
@@ -44,9 +44,7 @@ using ::testing::TestEventListeners;
using
::
testing
::
TestInfo
;
using
::
testing
::
TestInfo
;
using
::
testing
::
TestPartResult
;
using
::
testing
::
TestPartResult
;
using
::
testing
::
UnitTest
;
using
::
testing
::
UnitTest
;
namespace
{
namespace
{
// Provides alternative output mode which produces minimal amount of
// Provides alternative output mode which produces minimal amount of
// information about tests.
// information about tests.
class
TersePrinter
:
public
EmptyTestEventListener
{
class
TersePrinter
:
public
EmptyTestEventListener
{
...
@@ -102,7 +100,6 @@ TEST(CustomOutputTest, Fails) {
...
@@ -102,7 +100,6 @@ TEST(CustomOutputTest, Fails) {
EXPECT_EQ
(
1
,
2
)
EXPECT_EQ
(
1
,
2
)
<<
"This test fails in order to demonstrate alternative failure messages"
;
<<
"This test fails in order to demonstrate alternative failure messages"
;
}
}
}
// namespace
}
// namespace
int
main
(
int
argc
,
char
**
argv
)
{
int
main
(
int
argc
,
char
**
argv
)
{
...
...
googletest/scripts/fuse_gtest_files.py
View file @
fa673010
...
@@ -52,7 +52,7 @@ EXAMPLES
...
@@ -52,7 +52,7 @@ EXAMPLES
This tool is experimental. In particular, it assumes that there is no
This tool is experimental. In particular, it assumes that there is no
conditional inclusion of Google Test headers. Please report any
conditional inclusion of Google Test headers. Please report any
problems to googletestframework@googlegroups.com. You can read
problems to googletestframework@googlegroups.com. You can read
http://
code.google.com/p/googletest/wiki/G
oogle
T
estAdvancedGuide for
http
s
://
github.com/google/googletest/blob/master/g
oogle
t
est
/docs/
AdvancedGuide
.md
for
more information.
more information.
"""
"""
...
...
googletest/src/gtest-internal-inl.h
View file @
fa673010
...
@@ -664,13 +664,11 @@ class GTEST_API_ UnitTestImpl {
...
@@ -664,13 +664,11 @@ class GTEST_API_ UnitTestImpl {
tear_down_tc
)
->
AddTestInfo
(
test_info
);
tear_down_tc
)
->
AddTestInfo
(
test_info
);
}
}
#if GTEST_HAS_PARAM_TEST
// Returns ParameterizedTestCaseRegistry object used to keep track of
// Returns ParameterizedTestCaseRegistry object used to keep track of
// value-parameterized tests and instantiate and register them.
// value-parameterized tests and instantiate and register them.
internal
::
ParameterizedTestCaseRegistry
&
parameterized_test_registry
()
{
internal
::
ParameterizedTestCaseRegistry
&
parameterized_test_registry
()
{
return
parameterized_test_registry_
;
return
parameterized_test_registry_
;
}
}
#endif // GTEST_HAS_PARAM_TEST
// Sets the TestCase object for the test that's currently running.
// Sets the TestCase object for the test that's currently running.
void
set_current_test_case
(
TestCase
*
a_current_test_case
)
{
void
set_current_test_case
(
TestCase
*
a_current_test_case
)
{
...
@@ -845,14 +843,12 @@ class GTEST_API_ UnitTestImpl {
...
@@ -845,14 +843,12 @@ class GTEST_API_ UnitTestImpl {
// shuffled order.
// shuffled order.
std
::
vector
<
int
>
test_case_indices_
;
std
::
vector
<
int
>
test_case_indices_
;
#if GTEST_HAS_PARAM_TEST
// ParameterizedTestRegistry object used to register value-parameterized
// ParameterizedTestRegistry object used to register value-parameterized
// tests.
// tests.
internal
::
ParameterizedTestCaseRegistry
parameterized_test_registry_
;
internal
::
ParameterizedTestCaseRegistry
parameterized_test_registry_
;
// Indicates whether RegisterParameterizedTests() has been called already.
// Indicates whether RegisterParameterizedTests() has been called already.
bool
parameterized_tests_registered_
;
bool
parameterized_tests_registered_
;
#endif // GTEST_HAS_PARAM_TEST
// Index of the last death test case registered. Initially -1.
// Index of the last death test case registered. Initially -1.
int
last_death_test_case_
;
int
last_death_test_case_
;
...
...
googletest/src/gtest-printers.cc
View file @
fa673010
...
@@ -180,7 +180,10 @@ static CharFormat PrintAsCharLiteralTo(Char c, ostream* os) {
...
@@ -180,7 +180,10 @@ static CharFormat PrintAsCharLiteralTo(Char c, ostream* os) {
*
os
<<
static_cast
<
char
>
(
c
);
*
os
<<
static_cast
<
char
>
(
c
);
return
kAsIs
;
return
kAsIs
;
}
else
{
}
else
{
*
os
<<
"
\\
x"
+
String
::
FormatHexInt
(
static_cast
<
UnsignedChar
>
(
c
));
ostream
::
fmtflags
flags
=
os
->
flags
();
*
os
<<
"
\\
x"
<<
std
::
hex
<<
std
::
uppercase
<<
static_cast
<
int
>
(
static_cast
<
UnsignedChar
>
(
c
));
os
->
flags
(
flags
);
return
kHexEscape
;
return
kHexEscape
;
}
}
}
}
...
...
googletest/src/gtest.cc
View file @
fa673010
...
@@ -137,7 +137,7 @@
...
@@ -137,7 +137,7 @@
// implementation. It must come before gtest-internal-inl.h is
// implementation. It must come before gtest-internal-inl.h is
// included, or there will be a compiler error. This trick is to
// included, or there will be a compiler error. This trick is to
// prevent a user from accidentally including gtest-internal-inl.h in
// prevent a user from accidentally including gtest-internal-inl.h in
//
his
code.
//
their
code.
#define GTEST_IMPLEMENTATION_ 1
#define GTEST_IMPLEMENTATION_ 1
#include "src/gtest-internal-inl.h"
#include "src/gtest-internal-inl.h"
#undef GTEST_IMPLEMENTATION_
#undef GTEST_IMPLEMENTATION_
...
@@ -310,7 +310,8 @@ namespace internal {
...
@@ -310,7 +310,8 @@ namespace internal {
// than kMaxRange.
// than kMaxRange.
UInt32
Random
::
Generate
(
UInt32
range
)
{
UInt32
Random
::
Generate
(
UInt32
range
)
{
// These constants are the same as are used in glibc's rand(3).
// These constants are the same as are used in glibc's rand(3).
state_
=
(
1103515245U
*
state_
+
12345U
)
%
kMaxRange
;
// Use wider types than necessary to prevent unsigned overflow diagnostics.
state_
=
static_cast
<
UInt32
>
(
1103515245ULL
*
state_
+
12345U
)
%
kMaxRange
;
GTEST_CHECK_
(
range
>
0
)
GTEST_CHECK_
(
range
>
0
)
<<
"Cannot generate a number in the range [0, 0)."
;
<<
"Cannot generate a number in the range [0, 0)."
;
...
@@ -1312,13 +1313,14 @@ AssertionResult EqFailure(const char* lhs_expression,
...
@@ -1312,13 +1313,14 @@ AssertionResult EqFailure(const char* lhs_expression,
const
std
::
string
&
rhs_value
,
const
std
::
string
&
rhs_value
,
bool
ignoring_case
)
{
bool
ignoring_case
)
{
Message
msg
;
Message
msg
;
msg
<<
" Expected: "
<<
lhs_expression
;
msg
<<
"Expected equality of these values:"
;
msg
<<
"
\n
"
<<
lhs_expression
;
if
(
lhs_value
!=
lhs_expression
)
{
if
(
lhs_value
!=
lhs_expression
)
{
msg
<<
"
\n
Which is: "
<<
lhs_value
;
msg
<<
"
\n
Which is: "
<<
lhs_value
;
}
}
msg
<<
"
\n
To be equal to:
"
<<
rhs_expression
;
msg
<<
"
\n
"
<<
rhs_expression
;
if
(
rhs_value
!=
rhs_expression
)
{
if
(
rhs_value
!=
rhs_expression
)
{
msg
<<
"
\n
Which is: "
<<
rhs_value
;
msg
<<
"
\n
Which is: "
<<
rhs_value
;
}
}
if
(
ignoring_case
)
{
if
(
ignoring_case
)
{
...
@@ -2554,7 +2556,6 @@ TestInfo* MakeAndRegisterTestInfo(
...
@@ -2554,7 +2556,6 @@ TestInfo* MakeAndRegisterTestInfo(
return
test_info
;
return
test_info
;
}
}
#if GTEST_HAS_PARAM_TEST
void
ReportInvalidTestCaseType
(
const
char
*
test_case_name
,
void
ReportInvalidTestCaseType
(
const
char
*
test_case_name
,
CodeLocation
code_location
)
{
CodeLocation
code_location
)
{
Message
errors
;
Message
errors
;
...
@@ -2568,12 +2569,11 @@ void ReportInvalidTestCaseType(const char* test_case_name,
...
@@ -2568,12 +2569,11 @@ void ReportInvalidTestCaseType(const char* test_case_name,
<<
"probably rename one of the classes to put the tests into different
\n
"
<<
"probably rename one of the classes to put the tests into different
\n
"
<<
"test cases."
;
<<
"test cases."
;
fprintf
(
stderr
,
"%s %s"
,
GTEST_LOG_
(
ERROR
)
FormatFileLocation
(
code_location
.
file
.
c_str
(),
<<
FormatFileLocation
(
code_location
.
file
.
c_str
(),
code_location
.
line
)
.
c_str
(),
code_location
.
line
)
errors
.
GetString
()
.
c_str
())
;
<<
" "
<<
errors
.
GetString
();
}
}
#endif // GTEST_HAS_PARAM_TEST
}
// namespace internal
}
// namespace internal
...
@@ -2612,12 +2612,10 @@ namespace internal {
...
@@ -2612,12 +2612,10 @@ namespace internal {
// and INSTANTIATE_TEST_CASE_P into regular tests and registers those.
// and INSTANTIATE_TEST_CASE_P into regular tests and registers those.
// This will be done just once during the program runtime.
// This will be done just once during the program runtime.
void
UnitTestImpl
::
RegisterParameterizedTests
()
{
void
UnitTestImpl
::
RegisterParameterizedTests
()
{
#if GTEST_HAS_PARAM_TEST
if
(
!
parameterized_tests_registered_
)
{
if
(
!
parameterized_tests_registered_
)
{
parameterized_test_registry_
.
RegisterTests
();
parameterized_test_registry_
.
RegisterTests
();
parameterized_tests_registered_
=
true
;
parameterized_tests_registered_
=
true
;
}
}
#endif
}
}
}
// namespace internal
}
// namespace internal
...
@@ -2882,7 +2880,7 @@ enum GTestColor {
...
@@ -2882,7 +2880,7 @@ enum GTestColor {
};
};
#if GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MOBILE && \
#if GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MOBILE && \
!GTEST_OS_WINDOWS_PHONE && !GTEST_OS_WINDOWS_RT
!GTEST_OS_WINDOWS_PHONE && !GTEST_OS_WINDOWS_RT
&& !GTEST_OS_WINDOWS_MINGW
// Returns the character attribute for the given color.
// Returns the character attribute for the given color.
WORD
GetColorAttribute
(
GTestColor
color
)
{
WORD
GetColorAttribute
(
GTestColor
color
)
{
...
@@ -2894,6 +2892,33 @@ WORD GetColorAttribute(GTestColor color) {
...
@@ -2894,6 +2892,33 @@ WORD GetColorAttribute(GTestColor color) {
}
}
}
}
int
GetBitOffset
(
WORD
color_mask
)
{
if
(
color_mask
==
0
)
return
0
;
int
bitOffset
=
0
;
while
((
color_mask
&
1
)
==
0
)
{
color_mask
>>=
1
;
++
bitOffset
;
}
return
bitOffset
;
}
WORD
GetNewColor
(
GTestColor
color
,
WORD
old_color_attrs
)
{
// Let's reuse the BG
static
const
WORD
background_mask
=
BACKGROUND_BLUE
|
BACKGROUND_GREEN
|
BACKGROUND_RED
|
BACKGROUND_INTENSITY
;
static
const
WORD
foreground_mask
=
FOREGROUND_BLUE
|
FOREGROUND_GREEN
|
FOREGROUND_RED
|
FOREGROUND_INTENSITY
;
const
WORD
existing_bg
=
old_color_attrs
&
background_mask
;
WORD
new_color
=
GetColorAttribute
(
color
)
|
existing_bg
|
FOREGROUND_INTENSITY
;
static
const
int
bg_bitOffset
=
GetBitOffset
(
background_mask
);
static
const
int
fg_bitOffset
=
GetBitOffset
(
foreground_mask
);
if
(((
new_color
&
background_mask
)
>>
bg_bitOffset
)
==
((
new_color
&
foreground_mask
)
>>
fg_bitOffset
))
{
new_color
^=
FOREGROUND_INTENSITY
;
//invert intensity
}
return
new_color
;
}
#else
#else
// Returns the ANSI color code for the given color. COLOR_DEFAULT is
// Returns the ANSI color code for the given color. COLOR_DEFAULT is
...
@@ -2914,7 +2939,7 @@ bool ShouldUseColor(bool stdout_is_tty) {
...
@@ -2914,7 +2939,7 @@ bool ShouldUseColor(bool stdout_is_tty) {
const
char
*
const
gtest_color
=
GTEST_FLAG
(
color
).
c_str
();
const
char
*
const
gtest_color
=
GTEST_FLAG
(
color
).
c_str
();
if
(
String
::
CaseInsensitiveCStringEquals
(
gtest_color
,
"auto"
))
{
if
(
String
::
CaseInsensitiveCStringEquals
(
gtest_color
,
"auto"
))
{
#if GTEST_OS_WINDOWS
#if GTEST_OS_WINDOWS
&& !GTEST_OS_WINDOWS_MINGW
// On Windows the TERM variable is usually not set, but the
// On Windows the TERM variable is usually not set, but the
// console there does support colors.
// console there does support colors.
return
stdout_is_tty
;
return
stdout_is_tty
;
...
@@ -2972,20 +2997,21 @@ void ColoredPrintf(GTestColor color, const char* fmt, ...) {
...
@@ -2972,20 +2997,21 @@ void ColoredPrintf(GTestColor color, const char* fmt, ...) {
}
}
#if GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MOBILE && \
#if GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MOBILE && \
!GTEST_OS_WINDOWS_PHONE && !GTEST_OS_WINDOWS_RT
!GTEST_OS_WINDOWS_PHONE && !GTEST_OS_WINDOWS_RT
&& !GTEST_OS_WINDOWS_MINGW
const
HANDLE
stdout_handle
=
GetStdHandle
(
STD_OUTPUT_HANDLE
);
const
HANDLE
stdout_handle
=
GetStdHandle
(
STD_OUTPUT_HANDLE
);
// Gets the current text color.
// Gets the current text color.
CONSOLE_SCREEN_BUFFER_INFO
buffer_info
;
CONSOLE_SCREEN_BUFFER_INFO
buffer_info
;
GetConsoleScreenBufferInfo
(
stdout_handle
,
&
buffer_info
);
GetConsoleScreenBufferInfo
(
stdout_handle
,
&
buffer_info
);
const
WORD
old_color_attrs
=
buffer_info
.
wAttributes
;
const
WORD
old_color_attrs
=
buffer_info
.
wAttributes
;
const
WORD
new_color
=
GetNewColor
(
color
,
old_color_attrs
);
// We need to flush the stream buffers into the console before each
// We need to flush the stream buffers into the console before each
// SetConsoleTextAttribute call lest it affect the text that is already
// SetConsoleTextAttribute call lest it affect the text that is already
// printed but has not yet reached the console.
// printed but has not yet reached the console.
fflush
(
stdout
);
fflush
(
stdout
);
SetConsoleTextAttribute
(
stdout_handle
,
SetConsoleTextAttribute
(
stdout_handle
,
new_color
);
GetColorAttribute
(
color
)
|
FOREGROUND_INTENSITY
);
vprintf
(
fmt
,
args
);
vprintf
(
fmt
,
args
);
fflush
(
stdout
);
fflush
(
stdout
);
...
@@ -3420,9 +3446,7 @@ class XmlUnitTestResultPrinter : public EmptyTestEventListener {
...
@@ -3420,9 +3446,7 @@ class XmlUnitTestResultPrinter : public EmptyTestEventListener {
XmlUnitTestResultPrinter
::
XmlUnitTestResultPrinter
(
const
char
*
output_file
)
XmlUnitTestResultPrinter
::
XmlUnitTestResultPrinter
(
const
char
*
output_file
)
:
output_file_
(
output_file
)
{
:
output_file_
(
output_file
)
{
if
(
output_file_
.
c_str
()
==
NULL
||
output_file_
.
empty
())
{
if
(
output_file_
.
c_str
()
==
NULL
||
output_file_
.
empty
())
{
fprintf
(
stderr
,
"XML output file may not be null
\n
"
);
GTEST_LOG_
(
FATAL
)
<<
"XML output file may not be null"
;
fflush
(
stderr
);
exit
(
EXIT_FAILURE
);
}
}
}
}
...
@@ -3447,11 +3471,8 @@ void XmlUnitTestResultPrinter::OnTestIterationEnd(const UnitTest& unit_test,
...
@@ -3447,11 +3471,8 @@ void XmlUnitTestResultPrinter::OnTestIterationEnd(const UnitTest& unit_test,
// 3. To interpret the meaning of errno in a thread-safe way,
// 3. To interpret the meaning of errno in a thread-safe way,
// we need the strerror_r() function, which is not available on
// we need the strerror_r() function, which is not available on
// Windows.
// Windows.
fprintf
(
stderr
,
GTEST_LOG_
(
FATAL
)
<<
"Unable to open file
\"
"
"Unable to open file
\"
%s
\"\n
"
,
<<
output_file_
<<
"
\"
"
;
output_file_
.
c_str
());
fflush
(
stderr
);
exit
(
EXIT_FAILURE
);
}
}
std
::
stringstream
stream
;
std
::
stringstream
stream
;
PrintXmlUnitTest
(
&
stream
,
unit_test
);
PrintXmlUnitTest
(
&
stream
,
unit_test
);
...
@@ -4284,7 +4305,6 @@ const TestInfo* UnitTest::current_test_info() const
...
@@ -4284,7 +4305,6 @@ const TestInfo* UnitTest::current_test_info() const
// Returns the random seed used at the start of the current test run.
// Returns the random seed used at the start of the current test run.
int
UnitTest
::
random_seed
()
const
{
return
impl_
->
random_seed
();
}
int
UnitTest
::
random_seed
()
const
{
return
impl_
->
random_seed
();
}
#if GTEST_HAS_PARAM_TEST
// Returns ParameterizedTestCaseRegistry object used to keep track of
// Returns ParameterizedTestCaseRegistry object used to keep track of
// value-parameterized tests and instantiate and register them.
// value-parameterized tests and instantiate and register them.
internal
::
ParameterizedTestCaseRegistry
&
internal
::
ParameterizedTestCaseRegistry
&
...
@@ -4292,7 +4312,6 @@ internal::ParameterizedTestCaseRegistry&
...
@@ -4292,7 +4312,6 @@ internal::ParameterizedTestCaseRegistry&
GTEST_LOCK_EXCLUDED_
(
mutex_
)
{
GTEST_LOCK_EXCLUDED_
(
mutex_
)
{
return
impl_
->
parameterized_test_registry
();
return
impl_
->
parameterized_test_registry
();
}
}
#endif // GTEST_HAS_PARAM_TEST
// Creates an empty UnitTest.
// Creates an empty UnitTest.
UnitTest
::
UnitTest
()
{
UnitTest
::
UnitTest
()
{
...
@@ -4331,10 +4350,8 @@ UnitTestImpl::UnitTestImpl(UnitTest* parent)
...
@@ -4331,10 +4350,8 @@ UnitTestImpl::UnitTestImpl(UnitTest* parent)
&
default_global_test_part_result_reporter_
),
&
default_global_test_part_result_reporter_
),
per_thread_test_part_result_reporter_
(
per_thread_test_part_result_reporter_
(
&
default_per_thread_test_part_result_reporter_
),
&
default_per_thread_test_part_result_reporter_
),
#if GTEST_HAS_PARAM_TEST
parameterized_test_registry_
(),
parameterized_test_registry_
(),
parameterized_tests_registered_
(
false
),
parameterized_tests_registered_
(
false
),
#endif // GTEST_HAS_PARAM_TEST
last_death_test_case_
(
-
1
),
last_death_test_case_
(
-
1
),
current_test_case_
(
NULL
),
current_test_case_
(
NULL
),
current_test_info_
(
NULL
),
current_test_info_
(
NULL
),
...
@@ -4402,9 +4419,9 @@ void UnitTestImpl::ConfigureXmlOutput() {
...
@@ -4402,9 +4419,9 @@ void UnitTestImpl::ConfigureXmlOutput() {
listeners
()
->
SetDefaultXmlGenerator
(
new
XmlUnitTestResultPrinter
(
listeners
()
->
SetDefaultXmlGenerator
(
new
XmlUnitTestResultPrinter
(
UnitTestOptions
::
GetAbsolutePathToOutputFile
().
c_str
()));
UnitTestOptions
::
GetAbsolutePathToOutputFile
().
c_str
()));
}
else
if
(
output_format
!=
""
)
{
}
else
if
(
output_format
!=
""
)
{
printf
(
"WARNING: unrecognized output format
\"
%s
\"
ignored.
\n
"
,
GTEST_LOG_
(
WARNING
)
<<
"WARNING: unrecognized output format
\"
"
output_format
.
c_str
());
<<
output_format
fflush
(
stdout
)
;
<<
"
\"
ignored."
;
}
}
}
}
...
@@ -4419,9 +4436,9 @@ void UnitTestImpl::ConfigureStreamingOutput() {
...
@@ -4419,9 +4436,9 @@ void UnitTestImpl::ConfigureStreamingOutput() {
listeners
()
->
Append
(
new
StreamingListener
(
target
.
substr
(
0
,
pos
),
listeners
()
->
Append
(
new
StreamingListener
(
target
.
substr
(
0
,
pos
),
target
.
substr
(
pos
+
1
)));
target
.
substr
(
pos
+
1
)));
}
else
{
}
else
{
printf
(
"
WARNING
:
unrecognized streaming target
\"
%s
\"
ignored.
\n
"
,
GTEST_LOG_
(
WARNING
)
<<
"
unrecognized streaming target
\"
"
target
.
c_str
());
<<
target
fflush
(
stdout
)
;
<<
"
\"
ignored."
;
}
}
}
}
}
}
...
@@ -4550,9 +4567,9 @@ static void TearDownEnvironment(Environment* env) { env->TearDown(); }
...
@@ -4550,9 +4567,9 @@ static void TearDownEnvironment(Environment* env) { env->TearDown(); }
bool
UnitTestImpl
::
RunAllTests
()
{
bool
UnitTestImpl
::
RunAllTests
()
{
// Makes sure InitGoogleTest() was called.
// Makes sure InitGoogleTest() was called.
if
(
!
GTestIsInitialized
())
{
if
(
!
GTestIsInitialized
())
{
printf
(
"%s"
,
GTEST_LOG_
(
ERROR
)
<<
"
\n
This test program did NOT call ::testing::InitGoogleTest "
"
\n
This test program did NOT call ::testing::InitGoogleTest "
"before calling RUN_ALL_TESTS(). Please fix it.
\n
"
)
;
"before calling RUN_ALL_TESTS(). Please fix it.
"
;
return
false
;
return
false
;
}
}
...
@@ -4783,7 +4800,7 @@ bool ShouldRunTestOnShard(int total_shards, int shard_index, int test_id) {
...
@@ -4783,7 +4800,7 @@ bool ShouldRunTestOnShard(int total_shards, int shard_index, int test_id) {
// each TestCase and TestInfo object.
// each TestCase and TestInfo object.
// If shard_tests == true, further filters tests based on sharding
// If shard_tests == true, further filters tests based on sharding
// variables in the environment - see
// variables in the environment - see
// http://
code.google.com/p/googletest/wiki/G
oogle
T
estAdvancedGuide.
// http
s
://
github.com/google/googletest/blob/master/g
oogle
t
est
/docs/
AdvancedGuide.
md .
// Returns the number of tests that should run.
// Returns the number of tests that should run.
int
UnitTestImpl
::
FilterTests
(
ReactionToSharding
shard_tests
)
{
int
UnitTestImpl
::
FilterTests
(
ReactionToSharding
shard_tests
)
{
const
Int32
total_shards
=
shard_tests
==
HONOR_SHARDING_PROTOCOL
?
const
Int32
total_shards
=
shard_tests
==
HONOR_SHARDING_PROTOCOL
?
...
@@ -5252,11 +5269,9 @@ bool ParseGoogleTestFlag(const char* const arg) {
...
@@ -5252,11 +5269,9 @@ bool ParseGoogleTestFlag(const char* const arg) {
void
LoadFlagsFromFile
(
const
std
::
string
&
path
)
{
void
LoadFlagsFromFile
(
const
std
::
string
&
path
)
{
FILE
*
flagfile
=
posix
::
FOpen
(
path
.
c_str
(),
"r"
);
FILE
*
flagfile
=
posix
::
FOpen
(
path
.
c_str
(),
"r"
);
if
(
!
flagfile
)
{
if
(
!
flagfile
)
{
fprintf
(
stderr
,
GTEST_LOG_
(
FATAL
)
<<
"Unable to open file
\"
"
"Unable to open file
\"
%s
\"\n
"
,
<<
GTEST_FLAG
(
flagfile
)
GTEST_FLAG
(
flagfile
).
c_str
());
<<
"
\"
"
;
fflush
(
stderr
);
exit
(
EXIT_FAILURE
);
}
}
std
::
string
contents
(
ReadEntireFile
(
flagfile
));
std
::
string
contents
(
ReadEntireFile
(
flagfile
));
posix
::
FClose
(
flagfile
);
posix
::
FClose
(
flagfile
);
...
...
googletest/test/BUILD.bazel
0 → 100644
View file @
fa673010
# Copyright 2017 Google Inc.
# All Rights Reserved.
#
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following disclaimer
# in the documentation and/or other materials provided with the
# distribution.
# * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# Author: misterg@google.com (Gennadiy Civil)
#
# Bazel BUILD for The Google C++ Testing Framework (Google Test)
licenses
([
"notice"
])
""" gtest own tests """
#on windows exclude gtest-tuple.h and gtest-tuple_test.cc
cc_test
(
name
=
"gtest_all_test"
,
size
=
"small"
,
srcs
=
glob
(
include
=
[
"gtest-*.cc"
,
"*.h"
,
"googletest/include/gtest/**/*.h"
,
],
exclude
=
[
"gtest-unittest-api_test.cc"
,
"gtest-tuple_test.cc"
,
"googletest/src/gtest-all.cc"
,
"gtest_all_test.cc"
,
"gtest-death-test_ex_test.cc"
,
"gtest-listener_test.cc"
,
"gtest-unittest-api_test.cc"
,
"gtest-param-test_test.cc"
,
],
)
+
select
({
"//:win"
:
[],
"//conditions:default"
:
[
"gtest-tuple_test.cc"
,
],
}),
copts
=
select
({
"//:win"
:
[
"-DGTEST_USE_OWN_TR1_TUPLE=0"
],
"//conditions:default"
:
[
"-DGTEST_USE_OWN_TR1_TUPLE=1"
],
}),
includes
=
[
"googletest"
,
"googletest/include"
,
"googletest/include/internal"
,
"googletest/test"
,
],
linkopts
=
select
({
"//:win"
:
[],
"//conditions:default"
:
[
"-pthread"
,
],
}),
deps
=
[
"//:gtest_main"
],
)
#These googletest tests have their own main()
cc_test
(
name
=
"gtest-listener_test"
,
size
=
"small"
,
srcs
=
[
"gtest-listener_test.cc"
,
],
deps
=
[
"//:gtest"
,
],
)
cc_test
(
name
=
"gtest-unittest-api_test"
,
size
=
"small"
,
srcs
=
[
"gtest-unittest-api_test.cc"
,
],
deps
=
[
"//:gtest"
,
],
)
cc_test
(
name
=
"gtest-param-test_test"
,
size
=
"small"
,
srcs
=
[
"gtest-param-test2_test.cc"
,
"gtest-param-test_test.cc"
,
"gtest-param-test_test.h"
,
],
deps
=
[
"//:gtest"
,
],
)
Prev
1
…
4
5
6
7
8
9
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment