Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mockingbirdnest/benchmark
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: dae39c16560a^
Choose a base ref
...
head repository: mockingbirdnest/benchmark
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 9496c9c48099
Choose a head ref
  • 10 commits
  • 27 files changed
  • 3 contributors

Commits on May 24, 2021

  1. Copy the full SHA
    dae39c1 View commit details
  2. Change the test files to avoid multiple mains and to run more tests. …

    …Ultimately this should really use gtest.
    pleroy authored and eggrobin committed May 24, 2021
    Copy the full SHA
    1f6010e View commit details
  3. Change a check in DenseRange: on the one hand, going from -5 to 3 wit…

    …h step of 1 makes perfect sense, on the other hand a negative step would cause trouble.
    pleroy authored and eggrobin committed May 24, 2021
    Copy the full SHA
    9c63e84 View commit details
  4. Copy the full SHA
    a9a471a View commit details
  5. vectorcall

    eggrobin committed May 24, 2021
    Copy the full SHA
    82bc77a View commit details
  6. principia_make

    eggrobin committed May 24, 2021
    Copy the full SHA
    d5e93a8 View commit details
  7. A script to generate project files.

    pleroy authored and eggrobin committed May 24, 2021
    Copy the full SHA
    bff6dda View commit details
  8. A props file and simpler projects files.

    pleroy authored and eggrobin committed May 24, 2021
    Copy the full SHA
    33df4dc View commit details
  9. Cdecl.

    pleroy authored and eggrobin committed May 24, 2021
    Copy the full SHA
    ac99113 View commit details
  10. Copy the full SHA
    9496c9c View commit details
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@
[Tt]humbs.db
*.DS_Store

# Visual Studio Files
# Visual Studio Files
*.[Oo]bj
*.user
@@ -31,6 +32,7 @@ ipch/
[Bb]in
[Dd]ebug*/
[Rr]elease*/
.vs/

*.a
*.so
83 changes: 83 additions & 0 deletions build_projects_helper.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# This script helps creating project files for benchmark. The argument is the path of benchmark/.
# It produces two pairs of *.vcxproj, *.vcxproj.filters files: one for the project itself, one for its tests.

$dir = resolve-path $args[0]

$filtersheaders = " <ItemGroup>`r`n"
$vcxprojheaders = " <ItemGroup>`r`n"
Get-ChildItem "$dir\include\*" -Recurse -Include *.h | `
Foreach-Object {
$msvcrelativepath = $_.FullName -replace ".*include\\", "..\include\"
$filtersheaders +=
" <ClInclude Include=`"$msvcrelativepath`">`r`n" +
" <Filter>Header Files</Filter>`r`n" +
" </ClInclude>`r`n"
$vcxprojheaders +=
" <ClInclude Include=`"$msvcrelativepath`" />`r`n"
}
$filtersheaders += " </ItemGroup>`r`n"
$vcxprojheaders += " </ItemGroup>`r`n"

$filterssources = " <ItemGroup>`r`n"
$vcxprojsources = " <ItemGroup>`r`n"
Get-ChildItem "$dir\src\*" -Include *.h | `
Foreach-Object {
$msvcrelativepath = $_.FullName -replace ".*src\\", "..\src\"
$filterssources +=
" <ClInclude Include=`"$msvcrelativepath`">`r`n" +
" <Filter>Source Files</Filter>`r`n" +
" </ClInclude>`r`n"
$vcxprojsources +=
" <ClInclude Include=`"$msvcrelativepath`" />`r`n"
}
Get-ChildItem "$dir\src\*" -Include *.cc | `
Foreach-Object {
$msvcrelativepath = $_.FullName -replace ".*src\\", "..\src\"
$filterssources +=
" <ClCompile Include=`"$msvcrelativepath`">`r`n" +
" <Filter>Source Files</Filter>`r`n" +
" </ClCompile>`r`n"
$vcxprojsources +=
" <ClCompile Include=`"$msvcrelativepath`" />`r`n"
}
$filterssources += " </ItemGroup>`r`n"
$vcxprojsources += " </ItemGroup>`r`n"

$filterstests = " <ItemGroup>`r`n"
$vcxprojtests = " <ItemGroup>`r`n"
Get-ChildItem "$dir\test\*" -Include *_test.cc | `
Foreach-Object {
$msvcrelativepath = $_.FullName -replace ".*test\\", "..\test\"
$filterstests +=
" <ClCompile Include=`"$msvcrelativepath`">`r`n" +
" <Filter>Source Files</Filter>`r`n" +
" </ClCompile>`r`n"
$vcxprojtests +=
" <ClCompile Include=`"$msvcrelativepath`" />`r`n"
}
$filterstests += " </ItemGroup>`r`n"
$vcxprojtests += " </ItemGroup>`r`n"

$dirfilterspath = [string]::format("{0}\benchmark_vcxproj_filters.txt", $dir)
[system.io.file]::writealltext(
$dirfilterspath,
$filtersheaders + $filterssources,
[system.text.encoding]::utf8)

$testsfilterspath = [string]::format("{0}\benchmark_tests_vcxproj_filters.txt", $dir)
[system.io.file]::writealltext(
$testsfilterspath,
$filterstests,
[system.text.encoding]::utf8)

$dirvcxprojpath = [string]::format("{0}\benchmark_vcxproj.txt", $dir)
[system.io.file]::writealltext(
$dirvcxprojpath,
$vcxprojheaders + $vcxprojsources,
[system.text.encoding]::utf8)

$testsvcxprojpath = [string]::format("{0}\benchmark_tests_vcxproj.txt", $dir)
[system.io.file]::writealltext(
$testsvcxprojpath,
$vcxprojtests,
[system.text.encoding]::utf8)
2 changes: 1 addition & 1 deletion include/benchmark/benchmark.h
Original file line number Diff line number Diff line change
@@ -1310,7 +1310,7 @@ class Fixture : public internal::Benchmark {

// Helper macro to create a main routine in a test that runs the benchmarks
#define BENCHMARK_MAIN() \
int main(int argc, char** argv) { \
int __cdecl main(int argc, char** argv) { \
::benchmark::Initialize(&argc, argv); \
if (::benchmark::ReportUnrecognizedArguments(argc, argv)) return 1; \
::benchmark::RunSpecifiedBenchmarks(); \
104 changes: 104 additions & 0 deletions msvc/benchmark.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="16.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="Globals">
<Keyword>Win32Proj</Keyword>
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<!--Define project configurations. Nothing interesting can happen here.-->
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>

<!--Microsoft C++ stuff.-->
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />

<!--Compiler.-->
<PropertyGroup>
<PlatformToolset>v142</PlatformToolset>
<OutDir>$(SolutionDir)$(Configuration)\$(Platform)\</OutDir>
<IntDir>$(Configuration)\$(Platform)\</IntDir>
</PropertyGroup>

<!--Target.-->
<PropertyGroup>
<ConfigurationType>StaticLibrary</ConfigurationType>
<ConfigurationType Condition="$(ProjectName)=='google-benchmark-test'">Application</ConfigurationType>
</PropertyGroup>
<ItemDefinitionGroup Condition="$(ConfigurationType)==Application">
<Link>
<SubSystem>Console</SubSystem>
</Link>
</ItemDefinitionGroup>

<!--Definitions.-->
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<UseDebugLibraries>true</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<UseDebugLibraries>false</UseDebugLibraries>
</PropertyGroup>

<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />

<!--Common options.-->
<PropertyGroup>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<CallingConvention>vectorcall</CallingConvention>
<LanguageStandard>stdcpp17</LanguageStandard>
<WarningLevel>Level3</WarningLevel>
<AdditionalIncludeDirectories>$(SolutionDir)\..\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_WINDOWS;_USRDLL;GOOGLEBENCHMARK_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
</Link>
<Lib>
<LinkTimeCodeGeneration>false</LinkTimeCodeGeneration>
</Lib>
</ItemDefinitionGroup>

<!--Debug options.-->
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Optimization>Disabled</Optimization>
</ClCompile>
</ItemDefinitionGroup>

<!--Release options.-->
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>

<!--Import our property sheets.-->
<ImportGroup Label="PropertySheets">
<Import Project="windows_libraries.props" />
<Import Project="portability_macros.props" />
</ImportGroup>

<!--This import must be at the end.-->
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
</Project>
41 changes: 41 additions & 0 deletions msvc/google-benchmark-test.vcxproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="16.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<ProjectGuid>{ABB7BEF8-2C48-4967-A703-7B6FB9AB831F}</ProjectGuid>
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
</PropertyGroup>
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
</PropertyGroup>
<Import Project="$(SolutionDir)benchmark.props" />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Link>
<SubSystem>Console</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Link>
<SubSystem>Console</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\test\args_product_test.cc" />
<ClCompile Include="..\test\basic_test.cc" />
<ClCompile Include="..\test\benchmark_test.cc" />
<ClCompile Include="..\test\fixture_test.cc" />
<ClCompile Include="..\test\internal_threading_test.cc" />
<ClCompile Include="..\test\link_main_test.cc" />
<ClCompile Include="..\test\main.cpp" />
<ClCompile Include="..\test\map_test.cc" />
<ClCompile Include="..\test\multiple_ranges_test.cc" />
<ClCompile Include="..\test\options_test.cc" />
<ClCompile Include="..\test\templated_fixture_test.cc" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="google-benchmark.vcxproj">
<Project>{ef4de73e-ee11-4128-93eb-60b07e650ef2}</Project>
</ProjectReference>
</ItemGroup>
</Project>
52 changes: 52 additions & 0 deletions msvc/google-benchmark-test.vcxproj.filters
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?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="..\test\args_product_test.cc">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\test\basic_test.cc">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\test\benchmark_test.cc">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\test\fixture_test.cc">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\test\internal_threading_test.cc">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\test\link_main_test.cc">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\test\map_test.cc">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\test\multiple_ranges_test.cc">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\test\options_test.cc">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\test\templated_fixture_test.cc">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\test\main.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>
31 changes: 31 additions & 0 deletions msvc/google-benchmark.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.28917.182
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "google-benchmark", "google-benchmark.vcxproj", "{EF4DE73E-EE11-4128-93EB-60B07E650EF2}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "google-benchmark-test", "google-benchmark-test.vcxproj", "{ABB7BEF8-2C48-4967-A703-7B6FB9AB831F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{EF4DE73E-EE11-4128-93EB-60B07E650EF2}.Debug|x64.ActiveCfg = Debug|x64
{EF4DE73E-EE11-4128-93EB-60B07E650EF2}.Debug|x64.Build.0 = Debug|x64
{EF4DE73E-EE11-4128-93EB-60B07E650EF2}.Release|x64.ActiveCfg = Release|x64
{EF4DE73E-EE11-4128-93EB-60B07E650EF2}.Release|x64.Build.0 = Release|x64
{ABB7BEF8-2C48-4967-A703-7B6FB9AB831F}.Debug|x64.ActiveCfg = Debug|x64
{ABB7BEF8-2C48-4967-A703-7B6FB9AB831F}.Debug|x64.Build.0 = Debug|x64
{ABB7BEF8-2C48-4967-A703-7B6FB9AB831F}.Release|x64.ActiveCfg = Release|x64
{ABB7BEF8-2C48-4967-A703-7B6FB9AB831F}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {505CCB90-4F4F-4672-9E2B-2E2267BFE369}
EndGlobalSection
EndGlobal
Loading