Skip to content

Commit

Permalink
Expand the Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dellis1972 committed Feb 27, 2023
1 parent f2dac50 commit fa74273
Showing 1 changed file with 80 additions and 7 deletions.
87 changes: 80 additions & 7 deletions tests/MSBuildDeviceIntegration/Tests/InstallAndRunTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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 ();

Expand All @@ -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))){
Expand Down

0 comments on commit fa74273

Please sign in to comment.