Skip to content

Commit 8b0bab2

Browse files
committed
Fix InProcessBenchmarkEmitsSameIL tests.
1 parent 6906de3 commit 8b0bab2

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/BenchmarkDotNet/Running/BuildPartition.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public class BuildPartition
2121
{
2222
// We use an auto-increment global counter instead of Guid to guarantee uniqueness per benchmark run (Guid has a small chance to collide),
2323
// assuming there are fewer than 4 billion build partitions (a safe assumption).
24-
private static int s_partitionCounter;
24+
internal static int s_partitionCounter;
2525

2626
public BuildPartition(BenchmarkBuildInfo[] benchmarks, IResolver resolver)
2727
{

tests/BenchmarkDotNet.IntegrationTests/InProcessEmitTest.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
using BenchmarkDotNet.Jobs;
1111
using BenchmarkDotNet.Loggers;
1212
using BenchmarkDotNet.Reports;
13+
using BenchmarkDotNet.Running;
1314
using BenchmarkDotNet.Tests.Loggers;
1415
using BenchmarkDotNet.Tests.XUnit;
1516
using BenchmarkDotNet.Toolchains.InProcess.Emit;
@@ -68,10 +69,11 @@ private void DiffEmit(Summary summary)
6869
if (!Portability.RuntimeInformation.IsFullFramework)
6970
return;
7071

71-
var caseName = summary.BenchmarksCases.First().Job.ToString();
72+
var benchmarkCase = summary.BenchmarksCases.First();
73+
var caseName = $"{benchmarkCase.Descriptor.Type.Assembly.GetName().Name}-{benchmarkCase.Job.FolderInfo}";
7274
NaiveRunnableEmitDiff.RunDiff(
73-
$@"{caseName}.exe",
74-
$@"{caseName}Emitted.dll",
75+
$@"{caseName}-{BuildPartition.s_partitionCounter}.exe",
76+
$@"{caseName}-{BuildPartition.s_partitionCounter - 1}Emitted.dll",
7577
ConsoleLogger.Default);
7678
}
7779

0 commit comments

Comments
 (0)