diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/AndroidUpdateResourcesTest.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/AndroidUpdateResourcesTest.cs
index 07efc5a7709..07e6be2bf72 100644
--- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/AndroidUpdateResourcesTest.cs
+++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/AndroidUpdateResourcesTest.cs
@@ -556,7 +556,7 @@ public void CheckOldResourceDesignerIsNotUsed ([Values (true, false)] bool isRel
};
proj.SetProperty ("AndroidUseIntermediateDesignerFile", "True");
proj.SetProperty ("AndroidUseManagedDesignTimeResourceGenerator", "False");
- using (var b = CreateApkBuilder (Path.Combine ("temp", TestContext.CurrentContext.Test.Name))) {
+ using (var b = CreateApkBuilder ()) {
var designer = Path.Combine ("Resources", "Resource.designer" + proj.Language.DefaultDesignerExtension);
if (File.Exists (designer))
File.Delete (Path.Combine (Root, b.ProjectDirectory, designer));
@@ -582,7 +582,7 @@ public void CheckOldResourceDesignerWithWrongCasingIsRemoved ([Values (true, fal
};
proj.SetProperty ("AndroidUseIntermediateDesignerFile", "True");
proj.SetProperty ("AndroidResgenFile", "Resources\\Resource.designer" + proj.Language.DefaultDesignerExtension);
- using (var b = CreateApkBuilder (Path.Combine ("temp", TestContext.CurrentContext.Test.Name))) {
+ using (var b = CreateApkBuilder ()) {
var designer = proj.Sources.FirstOrDefault (x => x.Include() == "Resources\\Resource.designer" + proj.Language.DefaultDesignerExtension);
designer = designer ?? proj.OtherBuildItems.FirstOrDefault (x => x.Include () == "Resources\\Resource.designer" + proj.Language.DefaultDesignerExtension);
Assert.IsNotNull (designer, $"Failed to retrieve the Resource.designer.{proj.Language.DefaultDesignerExtension}");
@@ -1179,7 +1179,7 @@ public void CheckInvalidXmlInManagedResourceParser ()
public void LightlyModifyLayout ()
{
var proj = new XamarinAndroidApplicationProject ();
- using (var b = CreateApkBuilder (Path.Combine ("temp", TestName))) {
+ using (var b = CreateApkBuilder ()) {
Assert.IsTrue (b.Build (proj), "first build should have succeeded");
//Just change something, doesn't matter
@@ -1198,7 +1198,7 @@ public void CustomViewAddResourceId ()
var proj = new XamarinAndroidApplicationProject ();
proj.LayoutMain = proj.LayoutMain.Replace ("", "");
proj.PackageReferences.Add (KnownPackages.AndroidXAppCompat);
- using (var b = CreateApkBuilder (Path.Combine ("temp", TestName))) {
+ using (var b = CreateApkBuilder ()) {
b.Verbosity = LoggerVerbosity.Detailed;
Assert.IsTrue (b.Build (proj), "first build should have succeeded");
@@ -1227,7 +1227,7 @@ public void CustomViewAddResourceId ()
public void CheckNoVersionVectors ()
{
var proj = new XamarinFormsAndroidApplicationProject ();
- using (var b = CreateApkBuilder (Path.Combine ("temp", TestName))) {
+ using (var b = CreateApkBuilder ()) {
b.Verbosity = LoggerVerbosity.Detailed;
Assert.IsTrue (b.Build (proj), "Build should have succeeded.");
diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest.cs
index 8cc76792220..b515cf32649 100644
--- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest.cs
+++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest.cs
@@ -716,7 +716,7 @@ public void BuildAfterUpgradingNuget ()
Version = "1.6.1.5",
});
- using (var b = CreateApkBuilder (Path.Combine ("temp", TestContext.CurrentContext.Test.Name))) {
+ using (var b = CreateApkBuilder (Path.Combine ("temp", TestName))) {
//[TearDown] will still delete if test outcome successful, I need logs if assertions fail but build passes
b.CleanupAfterSuccessfulBuild =
b.CleanupOnDispose = false;
@@ -841,7 +841,7 @@ public void Dispose ()
}
}
}" });
- using (var builder = CreateApkBuilder (Path.Combine ("temp", TestContext.CurrentContext.Test.Name))) {
+ using (var builder = CreateApkBuilder (Path.Combine ("temp", TestName))) {
builder.ThrowOnBuildFailure = false;
Assert.IsFalse (builder.Build (proj), "Build should have failed with XA4212.");
StringAssertEx.Contains ($"error : XA4", builder.LastBuildOutput, "Error should be XA4212");
diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest2.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest2.cs
index 68193e1dc1c..983a35ff35d 100644
--- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest2.cs
+++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildTest2.cs
@@ -979,7 +979,7 @@ public void BuildApplicationWithLibraryAndClean ([Values (false, true)] bool isR
ProjectName = "App1",
References = { new BuildItem ("ProjectReference", "..\\Library1\\Library1.csproj") },
};
- var projectPath = Path.Combine ("temp", TestContext.CurrentContext.Test.Name);
+ var projectPath = Path.Combine ("temp", TestName);
using (var libb = CreateDllBuilder (Path.Combine (projectPath, lib.ProjectName), false, false)) {
Assert.IsTrue (libb.Build (lib), "Build of library should have succeeded");
using (var b = CreateApkBuilder (Path.Combine (projectPath, proj.ProjectName), false, false)) {
@@ -1382,7 +1382,7 @@ public void BuildAppCheckDebugSymbols ()
{
AssertCommercialBuild (); // FIXME: when Fast Deployment isn't available, we would need to use `llvm-objcopy` to extract the debug symbols
- var path = Path.Combine ("temp", TestContext.CurrentContext.Test.Name);
+ var path = Path.Combine ("temp", TestName);
var lib = new XamarinAndroidLibraryProject () {
IsRelease = false,
ProjectName = "Library1",
@@ -1552,7 +1552,7 @@ public void BuildWithJavaToolOptions ()
[Test]
public void LibraryWithGenericAttribute ()
{
- var path = Path.Combine ("temp", TestContext.CurrentContext.Test.Name);
+ var path = Path.Combine ("temp", TestName);
var lib = new XamarinAndroidLibraryProject {
ProjectName = "Library1",
IsRelease = true,
diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildWithLibraryTests.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildWithLibraryTests.cs
index a4ffdb5ca31..b911192418f 100644
--- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildWithLibraryTests.cs
+++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BuildWithLibraryTests.cs
@@ -458,7 +458,7 @@ public void BuildWithNativeLibraryUnknownAbi ()
};
proj.SetAndroidSupportedAbis ("armeabi-v7a", "x86");
- using (var builder = CreateApkBuilder (Path.Combine ("temp", TestContext.CurrentContext.Test.Name))) {
+ using (var builder = CreateApkBuilder (Path.Combine ("temp", TestName))) {
builder.ThrowOnBuildFailure = false;
Assert.IsFalse (builder.Build (proj), "Build should have failed.");
Assert.IsTrue (StringAssertEx.ContainsText (builder.LastBuildOutput, $"error XA4301: Cannot determine ABI of native library 'not-a-real-abi{Path.DirectorySeparatorChar}libtest.so'. Move this file to a directory with a valid Android ABI name such as 'libs/armeabi-v7a/'."),
@@ -502,7 +502,7 @@ public void AndroidLibraryProjectsZipWithOddPaths ()
TextContent = () => $@"
- $(MSBuildThisFileDirectory)../{TestContext.CurrentContext.Test.Name}/obj/$(Configuration)/foo/
+ $(MSBuildThisFileDirectory)../{TestName}/obj/$(Configuration)/foo/
"
});
diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/ManifestTest.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/ManifestTest.cs
index c1f5fc03085..2164f147f8f 100644
--- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/ManifestTest.cs
+++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/ManifestTest.cs
@@ -578,7 +578,7 @@ public void ManifestDataPathError ()
");
proj.AndroidManifest = s;
- using (var builder = CreateApkBuilder (Path.Combine ("temp", TestContext.CurrentContext.Test.Name))) {
+ using (var builder = CreateApkBuilder (Path.Combine ("temp", TestName))) {
builder.ThrowOnBuildFailure = false;
Assert.IsFalse (builder.Build (proj), "Build should have failed.");
var messages = builder.LastBuildOutput.SkipWhile (x => !x.StartsWith ("Build FAILED.", StringComparison.Ordinal));
@@ -621,7 +621,7 @@ public void ManifestPlaceHolders2 ()
Assert.AreNotEqual (proj.AndroidManifest, s, "#0");
proj.SetProperty ("AndroidManifestPlaceholders", "FOOBARNAME=AAAAAAAA");
proj.AndroidManifest = s;
- using (var builder = CreateApkBuilder (Path.Combine ("temp", TestContext.CurrentContext.Test.Name), false, false)) {
+ using (var builder = CreateApkBuilder (Path.Combine ("temp", TestName), false, false)) {
Assert.IsTrue (builder.Build (proj), "Build should have succeeded.");
var manifest = builder.Output.GetIntermediaryAsText (Root, "android/AndroidManifest.xml");
Assert.IsTrue (manifest.Contains ("AAAAAAAA"), "#1");
@@ -745,7 +745,7 @@ public void MergeLibraryManifest ()
}
data = ms.ToArray ();
}
- var path = Path.Combine ("temp", TestContext.CurrentContext.Test.Name);
+ var path = Path.Combine ("temp", TestName);
var lib = new XamarinAndroidBindingProject () {
ProjectName = "Binding1",
AndroidClassParser = "class-parse",
diff --git a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/PackagingTest.cs b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/PackagingTest.cs
index f9394a98ca1..fab91fbab86 100644
--- a/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/PackagingTest.cs
+++ b/src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/PackagingTest.cs
@@ -362,7 +362,7 @@ public void CheckSignApk ([Values(true, false)] bool useApkSigner, [Values(true,
if (useApkSigner && !foundApkSigner) {
Assert.Ignore ("Skipping test. Required build-tools verison which contains apksigner is not installed.");
}
- string keyfile = Path.Combine (Root, "temp", TestName, "release.keystore");
+ string keyfile = Path.Combine (Root, "temp", TestName, "keystore", "release.keystore");
if (File.Exists (keyfile))
File.Delete (keyfile);
string keyToolPath = Path.Combine (AndroidSdkResolver.GetJavaSdkPath (), "bin");
@@ -397,7 +397,7 @@ public void CheckSignApk ([Values(true, false)] bool useApkSigner, [Values(true,
} else {
proj.SetAndroidSupportedAbis ("armeabi-v7a", "x86");
}
- using (var b = CreateApkBuilder (Path.Combine ("temp", TestContext.CurrentContext.Test.Name))) {
+ using (var b = CreateApkBuilder (Path.Combine ("temp", TestName, "App"))) {
var bin = Path.Combine (Root, b.ProjectDirectory, proj.OutputPath);
Assert.IsTrue (b.Build (proj), "First build failed");
b.AssertHasNoWarnings ();
diff --git a/tests/MSBuildDeviceIntegration/Tests/InstallTests.cs b/tests/MSBuildDeviceIntegration/Tests/InstallTests.cs
index 2e2960dcd03..b5b7f7628d3 100644
--- a/tests/MSBuildDeviceIntegration/Tests/InstallTests.cs
+++ b/tests/MSBuildDeviceIntegration/Tests/InstallTests.cs
@@ -220,7 +220,7 @@ public void InstallErrorCode ()
};
proj.SetAndroidSupportedAbis (abi);
- using (var builder = CreateApkBuilder (Path.Combine ("temp", TestContext.CurrentContext.Test.Name))) {
+ using (var builder = CreateApkBuilder (Path.Combine ("temp", TestName))) {
builder.ThrowOnBuildFailure = false;
if (!builder.Install (proj)) {
Assert.IsTrue (StringAssertEx.ContainsText (builder.LastBuildOutput, "ADB0020"), "Should receive ADB0020 error code.");
@@ -247,7 +247,7 @@ public void ToggleFastDev ()
}
};
- using (var builder = CreateApkBuilder (Path.Combine ("temp", TestContext.CurrentContext.Test.Name))) {
+ using (var builder = CreateApkBuilder (Path.Combine ("temp", TestName))) {
Assert.IsTrue (builder.Install (proj), "Install should have succeeded.");
var directorylist = GetContentFromAllOverrideDirectories (proj.PackageName, DeviceAbi);
StringAssert.Contains ($"{proj.ProjectName}.dll", directorylist, $"{proj.ProjectName}.dll should exist in the .__override__ directory.");