@@ -15,6 +15,8 @@ namespace Microsoft.DotNet.Cli.Commands.Test;
15
15
16
16
internal static class MSBuildUtility
17
17
{
18
+ private const string dotnetTestVerb = "dotnet-test" ;
19
+
18
20
public static ( IEnumerable < ParallelizableTestModuleGroupWithSequentialInnerModules > Projects , bool IsBuiltOrRestored ) GetProjectsFromSolution ( string solutionFilePath , BuildOptions buildOptions )
19
21
{
20
22
SolutionModel solutionModel = SlnFileFactory . CreateFromFileOrDirectory ( solutionFilePath , includeSolutionFilterFiles : true , includeSolutionXmlFiles : true ) ;
@@ -30,9 +32,11 @@ public static (IEnumerable<ParallelizableTestModuleGroupWithSequentialInnerModul
30
32
Path . GetDirectoryName ( solutionModel . Description ) ! :
31
33
SolutionAndProjectUtility . GetRootDirectory ( solutionFilePath ) ;
32
34
33
- var collection = new ProjectCollection ( globalProperties : CommonRunHelpers . GetGlobalPropertiesFromArgs ( [ .. buildOptions . MSBuildArgs ] ) , null , toolsetDefinitionLocations : ToolsetDefinitionLocations . Default ) ;
35
+ FacadeLogger ? logger = LoggerUtility . DetermineBinlogger ( [ .. buildOptions . MSBuildArgs ] , dotnetTestVerb ) ;
36
+ var collection = new ProjectCollection ( globalProperties : CommonRunHelpers . GetGlobalPropertiesFromArgs ( [ .. buildOptions . MSBuildArgs ] ) , loggers : logger is null ? null : [ logger ] , toolsetDefinitionLocations : ToolsetDefinitionLocations . Default ) ;
34
37
35
38
ConcurrentBag < ParallelizableTestModuleGroupWithSequentialInnerModules > projects = GetProjectsProperties ( collection , solutionModel . SolutionProjects . Select ( p => Path . Combine ( rootDirectory , p . FilePath ) ) , buildOptions ) ;
39
+ logger ? . ReallyShutdown ( ) ;
36
40
37
41
return ( projects , isBuiltOrRestored ) ;
38
42
}
@@ -46,9 +50,11 @@ public static (IEnumerable<ParallelizableTestModuleGroupWithSequentialInnerModul
46
50
return ( Array . Empty < ParallelizableTestModuleGroupWithSequentialInnerModules > ( ) , isBuiltOrRestored ) ;
47
51
}
48
52
49
- var collection = new ProjectCollection ( globalProperties : CommonRunHelpers . GetGlobalPropertiesFromArgs ( [ .. buildOptions . MSBuildArgs ] ) , null , toolsetDefinitionLocations : ToolsetDefinitionLocations . Default ) ;
53
+ FacadeLogger ? logger = LoggerUtility . DetermineBinlogger ( [ .. buildOptions . MSBuildArgs ] , dotnetTestVerb ) ;
54
+ var collection = new ProjectCollection ( globalProperties : CommonRunHelpers . GetGlobalPropertiesFromArgs ( [ .. buildOptions . MSBuildArgs ] ) , logger is null ? null : [ logger ] , toolsetDefinitionLocations : ToolsetDefinitionLocations . Default ) ;
50
55
51
56
IEnumerable < ParallelizableTestModuleGroupWithSequentialInnerModules > projects = SolutionAndProjectUtility . GetProjectProperties ( projectFilePath , collection , buildOptions . NoLaunchProfile ) ;
57
+ logger ? . ReallyShutdown ( ) ;
52
58
53
59
return ( projects , isBuiltOrRestored ) ;
54
60
}
0 commit comments