Skip to content

Commit 97e543a

Browse files
[tests] we don't need to check if Clean deletes directories (#6117)
Context: #6112 The .NET 6 Preview 7 bump had a test failure: CleanBasicBindingLibrary("class-parse") obj/Release should have no directories. Expected: <empty> But was: < "/Users/runner/work/1/s/bin/TestRelease/temp/CleanBasicBindingLibraryclass-parse/obj/Release/refint" > `refint` is a new directory, see: * dotnet/sdk@e424c0e * https://github.com/dotnet/msbuild/blob/9e576281e638d60701ca34411e2483bed01e35c7/src/Tasks/Microsoft.Common.CurrentVersion.targets#L397 Clean doesn't actually delete directories, no need to test for this. The test already is checking if any files exist, and that should be sufficient.
1 parent 96eb449 commit 97e543a

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

src/Xamarin.Android.Build.Tasks/Tests/Xamarin.Android.Build.Tests/BindingBuildTest.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,6 @@ public void CleanBasicBindingLibrary (string classParser)
9797
};
9898
var files = Directory.GetFiles (Path.Combine (Root, b.ProjectDirectory, proj.IntermediateOutputPath), "*", SearchOption.AllDirectories)
9999
.Where (x => !ignoreFiles.Any (i => !Path.GetFileName (x).Contains (i)));
100-
var directories = Directory.GetDirectories (Path.Combine (Root, b.ProjectDirectory, proj.IntermediateOutputPath), "*", SearchOption.AllDirectories)
101-
// designtime folder is left behind, so Intellisense continues to work after a Clean
102-
.Where (x => Path.GetFileName (x) != "designtime")
103-
// .NET 5+ sets $(ProduceReferenceAssembly) by default
104-
// https://github.com/dotnet/sdk/blob/18ee4eac8b3abe6d554d2e0c39d8952da0f23ce5/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.TargetFrameworkInference.targets#L242-L244
105-
.Where (x => Path.GetFileName (x) != "ref");
106-
CollectionAssert.IsEmpty (directories, $"{proj.IntermediateOutputPath} should have no directories.");
107100
CollectionAssert.IsEmpty (files, $"{proj.IntermediateOutputPath} should have no files.");
108101
}
109102
}

0 commit comments

Comments
 (0)