Skip to content

Commit 408d8f6

Browse files
committed
Add install and run test
1 parent 94d9a7b commit 408d8f6

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

tests/MSBuildDeviceIntegration/Tests/InstallAndRunTests.cs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1332,5 +1332,32 @@ public void NativeAOTSample ()
13321332
throw;
13331333
}
13341334
}
1335+
1336+
[Test]
1337+
public void EnableManagedMarshalMethodsLookup ()
1338+
{
1339+
string [] properties = [
1340+
"Configuration=Release",
1341+
"AndroidUseMarshalMethods=true",
1342+
"_AndroidUseManagedMarshalMethodsLookup=true",
1343+
];
1344+
var projectDirectory = Path.Combine (XABuildPaths.TopDirectory, "samples", "HelloWorld", "HelloWorld");
1345+
try {
1346+
var dotnet = new DotNetCLI (Path.Combine (projectDirectory, "HelloWorld.DotNet.csproj"));
1347+
Assert.IsTrue (dotnet.Build (target: "Run", parameters: properties), "`dotnet build -t:Run` should succeed");
1348+
1349+
bool didLaunch = WaitForActivityToStart ("example", "MainActivity",
1350+
Path.Combine (projectDirectory, "logcat.log"), 30);
1351+
Assert.IsTrue (didLaunch, "Activity should have started.");
1352+
} catch {
1353+
foreach (var file in Directory.GetFiles (projectDirectory, "*.log", SearchOption.AllDirectories)) {
1354+
TestContext.AddTestAttachment (file);
1355+
}
1356+
foreach (var bl in Directory.GetFiles (projectDirectory, "*.binlog", SearchOption.AllDirectories)) {
1357+
TestContext.AddTestAttachment (bl);
1358+
}
1359+
throw;
1360+
}
1361+
}
13351362
}
13361363
}

0 commit comments

Comments
 (0)