summaryrefslogtreecommitdiff
path: root/.packages/microsoft.dotnet.arcade.sdk/1.0.0-beta.19577.5/tools/Performance.targets
diff options
context:
space:
mode:
Diffstat (limited to '.packages/microsoft.dotnet.arcade.sdk/1.0.0-beta.19577.5/tools/Performance.targets')
-rwxr-xr-x.packages/microsoft.dotnet.arcade.sdk/1.0.0-beta.19577.5/tools/Performance.targets27
1 files changed, 27 insertions, 0 deletions
diff --git a/.packages/microsoft.dotnet.arcade.sdk/1.0.0-beta.19577.5/tools/Performance.targets b/.packages/microsoft.dotnet.arcade.sdk/1.0.0-beta.19577.5/tools/Performance.targets
new file mode 100755
index 0000000000..ad7da0dc12
--- /dev/null
+++ b/.packages/microsoft.dotnet.arcade.sdk/1.0.0-beta.19577.5/tools/Performance.targets
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the LICENSE file in the project root for more information. -->
+<Project>
+ <!-- The 'PerformanceTest' target is only viable for repos building their own performance-test harness. -->
+ <Target Name="PerformanceTest" Condition="'$(IsPerformanceTestProject)' == 'true'">
+ <PropertyGroup>
+ <PerfIterations Condition="'$(PerfIterations)' == ''">10</PerfIterations>
+ <PerfOutputDirectory Condition="'$(PerfOutputDirectory)' == ''">$(ArtifactsTestResultsDir)Performance</PerfOutputDirectory>
+ <PerfCollectionType Condition="'$(PerfCollectionType)' == ''">stopwatch</PerfCollectionType>
+ </PropertyGroup>
+
+ <MakeDir Directories="$(PerfOutputDirectory)"/>
+ <Message Text="Running performance tests: $(TargetPath)" Importance="high"/>
+
+ <!-- Call the repo built performance-test harness directly with the necessary parameters. -->
+ <Exec Command='"$(DotNetTool)" "$(TargetPath)" --perf:iterations $(PerfIterations) --perf:outputdir "$(PerfOutputDirectory)" --perf:collect $(PerfCollectionType)'
+ LogStandardErrorAsError="false"
+ WorkingDirectory="$(OutDir)"
+ IgnoreExitCode="true">
+
+ <Output TaskParameter="ExitCode" PropertyName="_TestErrorCode" />
+ </Exec>
+
+ <Error Text="Performance tests failed: ExitCode = $(_TestErrorCode)" Condition="'$(_TestErrorCode)' != '0'" />
+ </Target>
+
+</Project>