From ddc632fbdb86a0e3d56340c4f745fc75cf4c57a4 Mon Sep 17 00:00:00 2001 From: Dean Ellis Date: Thu, 5 Dec 2024 13:35:21 +0000 Subject: [PATCH] Add DesignTimeBuild Performance test --- .../Tests/PerformanceTest.cs | 21 +++++++++++++++++++ .../MSBuildDeviceIntegration.csv | 1 + 2 files changed, 22 insertions(+) diff --git a/tests/MSBuildDeviceIntegration/Tests/PerformanceTest.cs b/tests/MSBuildDeviceIntegration/Tests/PerformanceTest.cs index feb2c394006..6064d238328 100644 --- a/tests/MSBuildDeviceIntegration/Tests/PerformanceTest.cs +++ b/tests/MSBuildDeviceIntegration/Tests/PerformanceTest.cs @@ -395,5 +395,26 @@ public void Install_CSharp_FromClean () }); } } + + [Test] + public void DesignTimeBuild_CSharp_From_Clean () + { + AssertCommercialBuild (); // This test will fail without Fast Deployment + + var proj = CreateApplicationProject (); + proj.PackageName = "com.xamarin.designtimebuild_csharp_from_clean"; + proj.PackageReferences.Add (KnownPackages.AndroidXAppCompat); + proj.MainActivity = proj.DefaultMainActivity; + using (var builder = CreateBuilderWithoutLogFile ()) { + builder.BuildLogFile = "designtimebuild.log"; + builder.Verbosity = LoggerVerbosity.Quiet; + builder.Clean (proj); + builder.Restore (proj); + builder.AutomaticNuGetRestore = false; + Profile (builder, b => { + b.DesignTimeBuild (proj, "CoreCompile", parameters: new string[] { "BuildingInsideVisualStudio=true" }); + }); + } + } } } diff --git a/tests/msbuild-times-reference/MSBuildDeviceIntegration.csv b/tests/msbuild-times-reference/MSBuildDeviceIntegration.csv index da07762adcd..aeb637110ef 100644 --- a/tests/msbuild-times-reference/MSBuildDeviceIntegration.csv +++ b/tests/msbuild-times-reference/MSBuildDeviceIntegration.csv @@ -14,3 +14,4 @@ Install_CSharp_Change,4000 Install_XAML_Change,3750 Install_CSharp_FromClean,3000 Install_CSharp_FromClean,20000 +DesignTimeBuild_CSharp_From_Clean,4000