From fa742732404457f81bec7c2cf06fd2ed47f545e6 Mon Sep 17 00:00:00 2001 From: Dean Ellis Date: Wed, 22 Feb 2023 13:06:15 +0000 Subject: [PATCH] Expand the Tests --- .../Tests/InstallAndRunTests.cs | 87 +++++++++++++++++-- 1 file changed, 80 insertions(+), 7 deletions(-) diff --git a/tests/MSBuildDeviceIntegration/Tests/InstallAndRunTests.cs b/tests/MSBuildDeviceIntegration/Tests/InstallAndRunTests.cs index 9887d0e4ba8..0c3cb5ad648 100644 --- a/tests/MSBuildDeviceIntegration/Tests/InstallAndRunTests.cs +++ b/tests/MSBuildDeviceIntegration/Tests/InstallAndRunTests.cs @@ -178,13 +178,88 @@ public void MonoSymbolicateAndroidStackTrace () }) ; } + static object [] AotChecks () => new object [] { + new object[] { + /* aotAssemblies */ true, + /* enableLLVM */ false, + /* usesAssemblyBlobs */ false, + /* testName*/ "テスト", + }, + new object[] { + /* aotAssemblies */ false, + /* enableLLVM */ true, + /* usesAssemblyBlobs */ true, + /* testName*/ "テスト", + }, + new object[] { + /* aotAssemblies */ true, + /* enableLLVM */ false, + /* usesAssemblyBlobs */ true, + /* testName*/ "テスト", + }, + new object[] { + /* aotAssemblies */ false, + /* enableLLVM */ true, + /* usesAssemblyBlobs */ false, + /* testName*/ "テスト", + }, + new object[] { + /* aotAssemblies */ false, + /* enableLLVM */ false, + /* usesAssemblyBlobs */ false, + /* testName*/ "随机生成器", + }, + new object[] { + /* aotAssemblies */ true, + /* enableLLVM */ true, + /* usesAssemblyBlobs */ true, + /* testName*/ "随机生成器", + }, + new object[] { + /* aotAssemblies */ false, + /* enableLLVM */ false, + /* usesAssemblyBlobs */ true, + /* testName*/ "随机生成器", + }, + new object[] { + /* aotAssemblies */ true, + /* enableLLVM */ true, + /* usesAssemblyBlobs */ false, + /* testName*/ "随机生成器", + }, + }; + + [Test] + [Category ("UsesDevice"), Category ("SmokeTests")] + [TestCaseSource (nameof (AotChecks))] + public void SmokeTestNativeBuildAndRunWithSpecialCharacters (bool aotAssemblies, bool enableLLVM, bool usesAssemblyBlobs, string testName) + { + AssertHasDevices (); + + var rootPath = Path.Combine (Root, "temp", TestName); + var proj = new XamarinAndroidApplicationProject () { + ProjectName = testName, + AotAssemblies = aotAssemblies, + IsRelease = true, + }; + proj.SetProperty ("EnableLLVM", enableLLVM.ToString ()); + proj.SetProperty ("AndroidUseAssemblyStore", usesAssemblyBlobs.ToString ()); + proj.SetAndroidSupportedAbis ("armeabi-v7a", "x86", "x86_64"); + proj.SetDefaultTargetDevice (); + using (var builder = CreateApkBuilder (Path.Combine (rootPath, proj.ProjectName))){ + Assert.IsTrue (builder.Install (proj), "Install should have succeeded."); + Assert.IsTrue (builder.RunTarget (proj, "_Run", doNotCleanupOnUpdate: true), "Project should have run."); + var timeoutInSeconds = 120; + Assert.IsTrue (WaitForActivityToStart (proj.PackageName, "MainActivity", + Path.Combine (Root, builder.ProjectDirectory, "startup-logcat.log"), timeoutInSeconds)); + } + } + [Test] [Category ("UsesDevice"), Category ("SmokeTests")] - [TestCase (false, "テスト")] - [TestCase (true, "テスト")] - [TestCase (false, "随机生成器")] - [TestCase (true, "随机生成器")] - public void SmokeTestBuildAndRunWithSpecialCharacters (bool fullAot, string testName) + [TestCase ("テスト")] + [TestCase ("随机生成器")] + public void SmokeTestBuildAndRunWithSpecialCharacters (string testName) { AssertHasDevices (); @@ -193,8 +268,6 @@ public void SmokeTestBuildAndRunWithSpecialCharacters (bool fullAot, string test ProjectName = testName, IsRelease = true, }; - if (fullAot) - proj.SetProperty (proj.ReleaseProperties, "RunAOTCompilation", "true"); proj.SetAndroidSupportedAbis ("armeabi-v7a", "x86", "x86_64"); proj.SetDefaultTargetDevice (); using (var builder = CreateApkBuilder (Path.Combine (rootPath, proj.ProjectName))){