From 99710699eaeaca9fb7d0bbccabbb2b5402954b17 Mon Sep 17 00:00:00 2001 From: Nepp3r Date: Mon, 31 Jul 2023 20:09:36 +0200 Subject: [PATCH] Adding tests for export of csv and csv Measurements --- .../Exporters/CommonExporterVerifyTests.cs | 3 +++ ...orterVerifyTests.Exporters_Invariant.verified.txt | 12 ++++++++++++ ...nExporterVerifyTests.Exporters_en-US.verified.txt | 12 ++++++++++++ ...nExporterVerifyTests.Exporters_ru-RU.verified.txt | 12 ++++++++++++ 4 files changed, 39 insertions(+) diff --git a/tests/BenchmarkDotNet.Tests/Exporters/CommonExporterVerifyTests.cs b/tests/BenchmarkDotNet.Tests/Exporters/CommonExporterVerifyTests.cs index b3e142c6c5..92b02dc750 100644 --- a/tests/BenchmarkDotNet.Tests/Exporters/CommonExporterVerifyTests.cs +++ b/tests/BenchmarkDotNet.Tests/Exporters/CommonExporterVerifyTests.cs @@ -6,6 +6,7 @@ using BenchmarkDotNet.Columns; using BenchmarkDotNet.Configs; using BenchmarkDotNet.Exporters; +using BenchmarkDotNet.Exporters.Csv; using BenchmarkDotNet.Exporters.Json; using BenchmarkDotNet.Exporters.Xml; using BenchmarkDotNet.Loggers; @@ -92,6 +93,8 @@ private static IEnumerable GetExporters() yield return XmlExporter.BriefCompressed; yield return XmlExporter.Full; yield return XmlExporter.FullCompressed; + yield return CsvExporter.Default; + yield return CsvMeasurementsExporter.Default; } private static readonly IConfig config = ManualConfig.Create(DefaultConfig.Instance) diff --git a/tests/BenchmarkDotNet.Tests/Exporters/VerifiedFiles/CommonExporterVerifyTests.Exporters_Invariant.verified.txt b/tests/BenchmarkDotNet.Tests/Exporters/VerifiedFiles/CommonExporterVerifyTests.Exporters_Invariant.verified.txt index 31d5cec733..152cfa7aa5 100644 --- a/tests/BenchmarkDotNet.Tests/Exporters/VerifiedFiles/CommonExporterVerifyTests.Exporters_Invariant.verified.txt +++ b/tests/BenchmarkDotNet.Tests/Exporters/VerifiedFiles/CommonExporterVerifyTests.Exporters_Invariant.verified.txt @@ -812,3 +812,15 @@ XmlExporter-full XmlExporter-full-compressed ############################################ MockSummaryBenchmarkDotNet0.10.x-mockMicrosoft Windows NT 10.0.x.mockMockIntel Core i7-6700HQ CPU 2.60GHz148Clr 4.0.x.mock64mockFalseTrueCONFIGURATION2531248TscMockBenchmarkClass.Foo: LongRun(IterationCount=100, LaunchCount=3, WarmupCount=15)BenchmarkDotNet.Tests.MocksMockBenchmarkClassFooFoo11111111110000NaNNaN110L999NaNNaNNaN1111111110000WorkloadResult1111MockBenchmarkClass.Bar: LongRun(IterationCount=100, LaunchCount=3, WarmupCount=15)BenchmarkDotNet.Tests.MocksMockBenchmarkClassBarBar11111111110000NaNNaN110L999NaNNaNNaN1111111110000WorkloadResult1111 +############################################ +CsvExporter +############################################ +Method,Job,AnalyzeLaunchVariance,EvaluateOverhead,MaxAbsoluteError,MaxRelativeError,MinInvokeCount,MinIterationTime,OutlierMode,Affinity,EnvironmentVariables,Jit,LargeAddressAware,Platform,PowerPlanMode,Runtime,AllowVeryLargeObjects,Concurrent,CpuGroups,Force,HeapAffinitizeMask,HeapCount,NoAffinitize,RetainVm,Server,Arguments,BuildConfiguration,Clock,EngineFactory,NuGetReferences,Toolchain,IsMutator,InvocationCount,IterationCount,IterationTime,LaunchCount,MaxIterationCount,MaxWarmupIterationCount,MemoryRandomization,MinIterationCount,MinWarmupIterationCount,RunStrategy,UnrollFactor,WarmupCount,Mean,Error,StdDev,P67 +Foo,LongRun,False,Default,Default,Default,Default,Default,Default,11111111,Empty,RyuJit,Default,X64,8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c,.NET 7.0,False,True,False,True,Default,Default,False,False,False,Default,Default,Default,Default,Default,Default,Default,Default,100,Default,3,Default,Default,Default,Default,Default,Default,16,15,1.000 ns,NA,0.000 ns,1.000 ns +Bar,LongRun,False,Default,Default,Default,Default,Default,Default,11111111,Empty,RyuJit,Default,X64,8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c,.NET 7.0,False,True,False,True,Default,Default,False,False,False,Default,Default,Default,Default,Default,Default,Default,Default,100,Default,3,Default,Default,Default,Default,Default,Default,16,15,1.000 ns,NA,0.000 ns,1.000 ns +############################################ +CsvMeasurementsExporter +############################################ +Target,Target_Namespace,Target_Type,Target_Method,Job_Id,Job_AnalyzeLaunchVariance,Job_EvaluateOverhead,Job_MaxAbsoluteError,Job_MaxRelativeError,Job_MinInvokeCount,Job_MinIterationTime,Job_OutlierMode,Job_Affinity,Job_EnvironmentVariables,Job_Jit,Job_LargeAddressAware,Job_Platform,Job_PowerPlanMode,Job_Runtime,Job_AllowVeryLargeObjects,Job_Concurrent,Job_CpuGroups,Job_Force,Job_HeapAffinitizeMask,Job_HeapCount,Job_NoAffinitize,Job_RetainVm,Job_Server,Job_Arguments,Job_BuildConfiguration,Job_Clock,Job_EngineFactory,Job_NuGetReferences,Job_Toolchain,Job_IsMutator,Job_InvocationCount,Job_IterationCount,Job_IterationTime,Job_LaunchCount,Job_MaxIterationCount,Job_MaxWarmupIterationCount,Job_MemoryRandomization,Job_MinIterationCount,Job_MinWarmupIterationCount,Job_RunStrategy,Job_UnrollFactor,Job_WarmupCount,Job_Display,Params,Measurement_LaunchIndex,Measurement_IterationMode,Measurement_IterationStage,Measurement_IterationIndex,Measurement_Nanoseconds,Measurement_Operations,Measurement_Value,Gen_0,Gen_1,Gen_2,Allocated_Bytes +MockBenchmarkClass.Foo,BenchmarkDotNet.Tests.Mocks,MockBenchmarkClass,Foo,LongRun,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,100,Default,3,Default,Default,Default,Default,Default,Default,Default,15,"LongRun(IterationCount=100, LaunchCount=3, WarmupCount=15)",,1,Workload,Result,1,1,1,1,0,0,0,? +MockBenchmarkClass.Bar,BenchmarkDotNet.Tests.Mocks,MockBenchmarkClass,Bar,LongRun,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,100,Default,3,Default,Default,Default,Default,Default,Default,Default,15,"LongRun(IterationCount=100, LaunchCount=3, WarmupCount=15)",,1,Workload,Result,1,1,1,1,0,0,0,? diff --git a/tests/BenchmarkDotNet.Tests/Exporters/VerifiedFiles/CommonExporterVerifyTests.Exporters_en-US.verified.txt b/tests/BenchmarkDotNet.Tests/Exporters/VerifiedFiles/CommonExporterVerifyTests.Exporters_en-US.verified.txt index 31d5cec733..152cfa7aa5 100644 --- a/tests/BenchmarkDotNet.Tests/Exporters/VerifiedFiles/CommonExporterVerifyTests.Exporters_en-US.verified.txt +++ b/tests/BenchmarkDotNet.Tests/Exporters/VerifiedFiles/CommonExporterVerifyTests.Exporters_en-US.verified.txt @@ -812,3 +812,15 @@ XmlExporter-full XmlExporter-full-compressed ############################################ MockSummaryBenchmarkDotNet0.10.x-mockMicrosoft Windows NT 10.0.x.mockMockIntel Core i7-6700HQ CPU 2.60GHz148Clr 4.0.x.mock64mockFalseTrueCONFIGURATION2531248TscMockBenchmarkClass.Foo: LongRun(IterationCount=100, LaunchCount=3, WarmupCount=15)BenchmarkDotNet.Tests.MocksMockBenchmarkClassFooFoo11111111110000NaNNaN110L999NaNNaNNaN1111111110000WorkloadResult1111MockBenchmarkClass.Bar: LongRun(IterationCount=100, LaunchCount=3, WarmupCount=15)BenchmarkDotNet.Tests.MocksMockBenchmarkClassBarBar11111111110000NaNNaN110L999NaNNaNNaN1111111110000WorkloadResult1111 +############################################ +CsvExporter +############################################ +Method,Job,AnalyzeLaunchVariance,EvaluateOverhead,MaxAbsoluteError,MaxRelativeError,MinInvokeCount,MinIterationTime,OutlierMode,Affinity,EnvironmentVariables,Jit,LargeAddressAware,Platform,PowerPlanMode,Runtime,AllowVeryLargeObjects,Concurrent,CpuGroups,Force,HeapAffinitizeMask,HeapCount,NoAffinitize,RetainVm,Server,Arguments,BuildConfiguration,Clock,EngineFactory,NuGetReferences,Toolchain,IsMutator,InvocationCount,IterationCount,IterationTime,LaunchCount,MaxIterationCount,MaxWarmupIterationCount,MemoryRandomization,MinIterationCount,MinWarmupIterationCount,RunStrategy,UnrollFactor,WarmupCount,Mean,Error,StdDev,P67 +Foo,LongRun,False,Default,Default,Default,Default,Default,Default,11111111,Empty,RyuJit,Default,X64,8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c,.NET 7.0,False,True,False,True,Default,Default,False,False,False,Default,Default,Default,Default,Default,Default,Default,Default,100,Default,3,Default,Default,Default,Default,Default,Default,16,15,1.000 ns,NA,0.000 ns,1.000 ns +Bar,LongRun,False,Default,Default,Default,Default,Default,Default,11111111,Empty,RyuJit,Default,X64,8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c,.NET 7.0,False,True,False,True,Default,Default,False,False,False,Default,Default,Default,Default,Default,Default,Default,Default,100,Default,3,Default,Default,Default,Default,Default,Default,16,15,1.000 ns,NA,0.000 ns,1.000 ns +############################################ +CsvMeasurementsExporter +############################################ +Target,Target_Namespace,Target_Type,Target_Method,Job_Id,Job_AnalyzeLaunchVariance,Job_EvaluateOverhead,Job_MaxAbsoluteError,Job_MaxRelativeError,Job_MinInvokeCount,Job_MinIterationTime,Job_OutlierMode,Job_Affinity,Job_EnvironmentVariables,Job_Jit,Job_LargeAddressAware,Job_Platform,Job_PowerPlanMode,Job_Runtime,Job_AllowVeryLargeObjects,Job_Concurrent,Job_CpuGroups,Job_Force,Job_HeapAffinitizeMask,Job_HeapCount,Job_NoAffinitize,Job_RetainVm,Job_Server,Job_Arguments,Job_BuildConfiguration,Job_Clock,Job_EngineFactory,Job_NuGetReferences,Job_Toolchain,Job_IsMutator,Job_InvocationCount,Job_IterationCount,Job_IterationTime,Job_LaunchCount,Job_MaxIterationCount,Job_MaxWarmupIterationCount,Job_MemoryRandomization,Job_MinIterationCount,Job_MinWarmupIterationCount,Job_RunStrategy,Job_UnrollFactor,Job_WarmupCount,Job_Display,Params,Measurement_LaunchIndex,Measurement_IterationMode,Measurement_IterationStage,Measurement_IterationIndex,Measurement_Nanoseconds,Measurement_Operations,Measurement_Value,Gen_0,Gen_1,Gen_2,Allocated_Bytes +MockBenchmarkClass.Foo,BenchmarkDotNet.Tests.Mocks,MockBenchmarkClass,Foo,LongRun,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,100,Default,3,Default,Default,Default,Default,Default,Default,Default,15,"LongRun(IterationCount=100, LaunchCount=3, WarmupCount=15)",,1,Workload,Result,1,1,1,1,0,0,0,? +MockBenchmarkClass.Bar,BenchmarkDotNet.Tests.Mocks,MockBenchmarkClass,Bar,LongRun,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,Default,100,Default,3,Default,Default,Default,Default,Default,Default,Default,15,"LongRun(IterationCount=100, LaunchCount=3, WarmupCount=15)",,1,Workload,Result,1,1,1,1,0,0,0,? diff --git a/tests/BenchmarkDotNet.Tests/Exporters/VerifiedFiles/CommonExporterVerifyTests.Exporters_ru-RU.verified.txt b/tests/BenchmarkDotNet.Tests/Exporters/VerifiedFiles/CommonExporterVerifyTests.Exporters_ru-RU.verified.txt index 6071e78b4d..fa047590b9 100644 --- a/tests/BenchmarkDotNet.Tests/Exporters/VerifiedFiles/CommonExporterVerifyTests.Exporters_ru-RU.verified.txt +++ b/tests/BenchmarkDotNet.Tests/Exporters/VerifiedFiles/CommonExporterVerifyTests.Exporters_ru-RU.verified.txt @@ -812,3 +812,15 @@ XmlExporter-full XmlExporter-full-compressed ############################################ MockSummaryBenchmarkDotNet0.10.x-mockMicrosoft Windows NT 10.0.x.mockMockIntel Core i7-6700HQ CPU 2.60GHz148Clr 4.0.x.mock64mockFalseTrueCONFIGURATION2531248TscMockBenchmarkClass.Foo: LongRun(IterationCount=100, LaunchCount=3, WarmupCount=15)BenchmarkDotNet.Tests.MocksMockBenchmarkClassFooFoo11111111110000NaNNaN110L999NaNNaNNaN1111111110000WorkloadResult1111MockBenchmarkClass.Bar: LongRun(IterationCount=100, LaunchCount=3, WarmupCount=15)BenchmarkDotNet.Tests.MocksMockBenchmarkClassBarBar11111111110000NaNNaN110L999NaNNaNNaN1111111110000WorkloadResult1111 +############################################ +CsvExporter +############################################ +Method;Job;AnalyzeLaunchVariance;EvaluateOverhead;MaxAbsoluteError;MaxRelativeError;MinInvokeCount;MinIterationTime;OutlierMode;Affinity;EnvironmentVariables;Jit;LargeAddressAware;Platform;PowerPlanMode;Runtime;AllowVeryLargeObjects;Concurrent;CpuGroups;Force;HeapAffinitizeMask;HeapCount;NoAffinitize;RetainVm;Server;Arguments;BuildConfiguration;Clock;EngineFactory;NuGetReferences;Toolchain;IsMutator;InvocationCount;IterationCount;IterationTime;LaunchCount;MaxIterationCount;MaxWarmupIterationCount;MemoryRandomization;MinIterationCount;MinWarmupIterationCount;RunStrategy;UnrollFactor;WarmupCount;Mean;Error;StdDev;P67 +Foo;LongRun;False;Default;Default;Default;Default;Default;Default;11111111;Empty;RyuJit;Default;X64;8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c;.NET 7.0;False;True;False;True;Default;Default;False;False;False;Default;Default;Default;Default;Default;Default;Default;Default;100;Default;3;Default;Default;Default;Default;Default;Default;16;15;"1,000 ns";NA;"0,000 ns";"1,000 ns" +Bar;LongRun;False;Default;Default;Default;Default;Default;Default;11111111;Empty;RyuJit;Default;X64;8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c;.NET 7.0;False;True;False;True;Default;Default;False;False;False;Default;Default;Default;Default;Default;Default;Default;Default;100;Default;3;Default;Default;Default;Default;Default;Default;16;15;"1,000 ns";NA;"0,000 ns";"1,000 ns" +############################################ +CsvMeasurementsExporter +############################################ +Target;Target_Namespace;Target_Type;Target_Method;Job_Id;Job_AnalyzeLaunchVariance;Job_EvaluateOverhead;Job_MaxAbsoluteError;Job_MaxRelativeError;Job_MinInvokeCount;Job_MinIterationTime;Job_OutlierMode;Job_Affinity;Job_EnvironmentVariables;Job_Jit;Job_LargeAddressAware;Job_Platform;Job_PowerPlanMode;Job_Runtime;Job_AllowVeryLargeObjects;Job_Concurrent;Job_CpuGroups;Job_Force;Job_HeapAffinitizeMask;Job_HeapCount;Job_NoAffinitize;Job_RetainVm;Job_Server;Job_Arguments;Job_BuildConfiguration;Job_Clock;Job_EngineFactory;Job_NuGetReferences;Job_Toolchain;Job_IsMutator;Job_InvocationCount;Job_IterationCount;Job_IterationTime;Job_LaunchCount;Job_MaxIterationCount;Job_MaxWarmupIterationCount;Job_MemoryRandomization;Job_MinIterationCount;Job_MinWarmupIterationCount;Job_RunStrategy;Job_UnrollFactor;Job_WarmupCount;Job_Display;Params;Measurement_LaunchIndex;Measurement_IterationMode;Measurement_IterationStage;Measurement_IterationIndex;Measurement_Nanoseconds;Measurement_Operations;Measurement_Value;Gen_0;Gen_1;Gen_2;Allocated_Bytes +MockBenchmarkClass.Foo;BenchmarkDotNet.Tests.Mocks;MockBenchmarkClass;Foo;LongRun;Default;Default;Default;Default;Default;Default;Default;Default;Default;Default;Default;Default;Default;Default;Default;Default;Default;Default;Default;Default;Default;Default;Default;Default;Default;Default;Default;Default;Default;Default;Default;100;Default;3;Default;Default;Default;Default;Default;Default;Default;15;"LongRun(IterationCount=100, LaunchCount=3, WarmupCount=15)";;1;Workload;Result;1;1;1;1;0;0;0;? +MockBenchmarkClass.Bar;BenchmarkDotNet.Tests.Mocks;MockBenchmarkClass;Bar;LongRun;Default;Default;Default;Default;Default;Default;Default;Default;Default;Default;Default;Default;Default;Default;Default;Default;Default;Default;Default;Default;Default;Default;Default;Default;Default;Default;Default;Default;Default;Default;Default;100;Default;3;Default;Default;Default;Default;Default;Default;Default;15;"LongRun(IterationCount=100, LaunchCount=3, WarmupCount=15)";;1;Workload;Result;1;1;1;1;0;0;0;?