Просмотр исходного кода

Fixed a bug in '_RunBenchmark' target that caused ProtoBench to throw an exception during execution

ArnoldZokas 15 лет назад
Родитель
Сommit
8bd5521e69
3 измененных файлов с 15 добавлено и 1 удалено
  1. 13 0
      build/BuildBenchmark.ps1
  2. 1 0
      build/Common.targets
  3. 1 1
      build/build.csproj

+ 13 - 0
build/BuildBenchmark.ps1

@@ -0,0 +1,13 @@
+write-host `nRunning build. Please wait...
+
+$iterations = 10
+
+for ($i=1; $i -le $iterations; $i++)
+{
+	$sw = [System.Diagnostics.StopWatch]::StartNew()
+	& E:\dotnet-protobufs\build\BuildAll.bat
+	$sw.Stop()
+	$msbuildTotalRunTime += $sw.ElapsedMilliseconds
+}
+
+write-host `nMSBuild average speed over $iterations iterations: ($msbuildTotalRunTime/$iterations) milliseconds

+ 1 - 0
build/Common.targets

@@ -75,6 +75,7 @@
 		<ItemGroup>
 			<BenchmarkResources Include="$(BenchmarkProtosDirectory)\google_message1.dat" />
 			<BenchmarkResources Include="$(BenchmarkProtosDirectory)\google_message2.dat" />
+			<BenchmarkResources Include="$(SourceDirectory)\ProtocolBuffers\bin\$(BuildConfiguration)\Google.ProtocolBuffers.dll" />
 			<BenchmarkResources Include="$(SourceDirectory)\ProtoBench\bin\$(BuildConfiguration)\ProtoBench.exe" />
 		</ItemGroup>
 

+ 1 - 1
build/build.csproj

@@ -20,7 +20,7 @@
 		<!--Tool Paths-->
 		<ProtocExePath>$(LibDirectory)\protoc.exe</ProtocExePath>
 		<ProtogenExePath>$(SourceDirectory)\ProtoGen\bin\$(BuildConfiguration)\protogen.exe</ProtogenExePath>
-		<ProtoBenchExePath>$(SourceDirectory)\ProtoBench\bin\$(BuildConfiguration)\ProtoBench.exe</ProtoBenchExePath>
+		<ProtoBenchExePath>$(BuildTempDirectory)\ProtoBench.exe</ProtoBenchExePath>
 		<NUnitExePath>$(LibDirectory)\NUnit 2.2.8.0\nunit-console.exe</NUnitExePath>
 		<ZipExePath>$(LibDirectory)\7-Zip 9.20\7za.exe</ZipExePath>
 	</PropertyGroup>