diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/AotTests.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/AotTests.cs index 48ea5d3d6f4..df17ccd3a55 100644 --- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/AotTests.cs +++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/AotTests.cs @@ -110,6 +110,26 @@ public void BuildBasicApplicationReleaseProfiledAotWithoutDefaultProfile () StringAssertEx.DoesNotContainRegex (@$"Using profile data file.*{filename}\.aotprofile", b.LastBuildOutput, "Should not use default AOT profile", RegexOptions.IgnoreCase); } + [Test] + [Category ("SmokeTests")] + [TestCase ("テスト", false)] + [TestCase ("随机生成器", false)] + [TestCase ("テスト", true)] + [TestCase ("随机生成器", true)] + public void BuildAotApplicationWithSpecialCharactersInProject (string testName, bool aot) + { + var rootPath = Path.Combine (Root, "temp", TestName); + var proj = new XamarinAndroidApplicationProject () { + ProjectName = testName, + IsRelease = true, + AotAssemblies = aot, + }; + proj.SetAndroidSupportedAbis ("armeabi-v7a", "arm64-v8a", "x86", "x86_64"); + using (var builder = CreateApkBuilder (Path.Combine (rootPath, proj.ProjectName))){ + Assert.IsTrue (builder.Build (proj), "Build should have succeeded."); + } + } + static object [] AotChecks () => new object [] { new object[] { /* supportedAbis */ "arm64-v8a", diff --git a/tests/MSBuildDeviceIntegration/Tests/InstallAndRunTests.cs b/tests/MSBuildDeviceIntegration/Tests/InstallAndRunTests.cs index d1a3cd61d2a..334864dba67 100644 --- a/tests/MSBuildDeviceIntegration/Tests/InstallAndRunTests.cs +++ b/tests/MSBuildDeviceIntegration/Tests/InstallAndRunTests.cs @@ -205,12 +205,89 @@ 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")] - public void SmokeTestBuildAndRunWithSpecialCharacters () + [TestCaseSource (nameof (AotChecks))] + public void SmokeTestNativeBuildAndRunWithSpecialCharacters (bool aotAssemblies, bool enableLLVM, bool usesAssemblyBlobs, string testName) { - var 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")] + [TestCase ("テスト")] + [TestCase ("随机生成器")] + public void SmokeTestBuildAndRunWithSpecialCharacters (string testName) + { var rootPath = Path.Combine (Root, "temp", TestName); var proj = new XamarinFormsAndroidApplicationProject () { ProjectName = testName,