@@ -42,46 +42,43 @@ Task("Test")
42
42
var framework = parameters . FullFxVersion ;
43
43
44
44
// run using dotnet test
45
+ var actions = new List < Action > ( ) ;
45
46
var projects = GetFiles ( "./src/**/*.Tests.csproj" ) ;
46
47
foreach ( var project in projects )
47
48
{
48
- var settings = new DotNetCoreTestSettings
49
+ actions . Add ( ( ) =>
49
50
{
50
- Framework = framework ,
51
- NoBuild = true ,
52
- NoRestore = true ,
53
- Configuration = parameters . Configuration
54
- } ;
55
-
56
- var coverletSettings = new CoverletSettings {
57
- CollectCoverage = true ,
58
- CoverletOutputFormat = CoverletOutputFormat . opencover ,
59
- CoverletOutputDirectory = parameters . Paths . Directories . TestCoverageOutput + "/" ,
60
- CoverletOutputName = $ "{ project . GetFilenameWithoutExtension ( ) } .coverage.xml"
61
- } ;
62
-
63
- if ( IsRunningOnUnix ( ) )
64
- {
65
- settings . Filter = "TestCategory!=NoMono" ;
66
- }
51
+ var settings = new DotNetCoreTestSettings
52
+ {
53
+ Framework = framework ,
54
+ NoBuild = true ,
55
+ NoRestore = true ,
56
+ Configuration = parameters . Configuration
57
+ } ;
67
58
68
- DotNetCoreTest ( project . FullPath , settings , coverletSettings ) ;
69
- }
59
+ var coverletSettings = new CoverletSettings {
60
+ CollectCoverage = true ,
61
+ CoverletOutputFormat = CoverletOutputFormat . opencover ,
62
+ CoverletOutputDirectory = parameters . Paths . Directories . TestCoverageOutput + "/" ,
63
+ CoverletOutputName = $ "{ project . GetFilenameWithoutExtension ( ) } .coverage.xml"
64
+ } ;
70
65
71
- // run using NUnit
72
- var testAssemblies = GetFiles ( "./src/**/bin/" + parameters . Configuration + "/" + framework + "/*.Tests.dll" ) ;
66
+ if ( IsRunningOnUnix ( ) )
67
+ {
68
+ settings . Filter = "TestCategory!=NoMono" ;
69
+ }
70
+
71
+ DotNetCoreTest ( project . FullPath , settings , coverletSettings ) ;
72
+ } ) ;
73
+ }
73
74
74
- var nunitSettings = new NUnit3Settings
75
+ var options = new ParallelOptions
75
76
{
76
- Results = new List < NUnit3Result > { new NUnit3Result { FileName = parameters . Paths . Files . TestCoverageOutputFilePath } }
77
+ MaxDegreeOfParallelism = - 1 ,
78
+ CancellationToken = default
77
79
} ;
78
80
79
- if ( IsRunningOnUnix ( ) ) {
80
- nunitSettings . Where = "cat!=NoMono" ;
81
- nunitSettings . Agents = 1 ;
82
- }
83
-
84
- //NUnit3(testAssemblies, nunitSettings);
81
+ Parallel . Invoke ( options , actions . ToArray ( ) ) ;
85
82
} ) ;
86
83
87
84
#endregion
0 commit comments