Skip to content

Commit e28be63

Browse files
jonathanpeppersjonpryor
authored andcommitted
[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 fa17c6d commit e28be63

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
@@ -94,13 +94,6 @@ public void CleanBasicBindingLibrary (string classParser)
9494
};
9595
var files = Directory.GetFiles (Path.Combine (Root, b.ProjectDirectory, proj.IntermediateOutputPath), "*", SearchOption.AllDirectories)
9696
.Where (x => !ignoreFiles.Any (i => !Path.GetFileName (x).Contains (i)));
97-
var directories = Directory.GetDirectories (Path.Combine (Root, b.ProjectDirectory, proj.IntermediateOutputPath), "*", SearchOption.AllDirectories)
98-
// designtime folder is left behind, so Intellisense continues to work after a Clean
99-
.Where (x => Path.GetFileName (x) != "designtime")
100-
// .NET 5+ sets $(ProduceReferenceAssembly) by default
101-
// https://github.com/dotnet/sdk/blob/18ee4eac8b3abe6d554d2e0c39d8952da0f23ce5/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.TargetFrameworkInference.targets#L242-L244
102-
.Where (x => Path.GetFileName (x) != "ref");
103-
CollectionAssert.IsEmpty (directories, $"{proj.IntermediateOutputPath} should have no directories.");
10497
CollectionAssert.IsEmpty (files, $"{proj.IntermediateOutputPath} should have no files.");
10598
}
10699
}

0 commit comments

Comments
 (0)