@@ -18,6 +18,7 @@ public static class BuildParameters
18
18
public static string PreReleaseLabelFilePath { get ; private set ; }
19
19
public static string Target { get ; private set ; }
20
20
public static string BuildCounter { get ; private set ; }
21
+ public static string TestExecutionType { get ; private set ; }
21
22
public static string Configuration { get ; private set ; }
22
23
public static string DeploymentEnvironment { get ; private set ; }
23
24
public static Cake . Core . Configuration . ICakeConfiguration CakeConfiguration { get ; private set ; }
@@ -44,7 +45,8 @@ public static class BuildParameters
44
45
public static DirectoryPath SolutionDirectoryPath { get ; private set ; }
45
46
public static DirectoryPath TestDirectoryPath { get ; private set ; }
46
47
public static FilePath IntegrationTestScriptPath { get ; private set ; }
47
- public static string TestFilePattern { get ; private set ; }
48
+ public static string TestAssemblyFilePattern { get ; private set ; }
49
+ public static string TestAssemblyProjectPattern { get ; private set ; }
48
50
public static string Title { get ; private set ; }
49
51
public static string ResharperSettingsFileName { get ; private set ; }
50
52
public static string RepositoryOwner { get ; private set ; }
@@ -160,6 +162,7 @@ public static class BuildParameters
160
162
context . Information ( "RepositoryName: {0}" , RepositoryName ) ;
161
163
context . Information ( "NugetConfig: {0} ({1})" , NugetConfig , context . FileExists ( NugetConfig ) ) ;
162
164
context . Information ( "Build Counter: {0}" , BuildCounter ) ;
165
+ context . Information ( "Test Execution Type: {0}" , TestExecutionType ) ;
163
166
context . Information ( "RestorePackagesDirectory: {0}" , RestorePackagesDirectory ) ;
164
167
context . Information ( "ProductName: {0}" , ProductName ) ;
165
168
context . Information ( "ProductDescription: {0}" , ProductDescription ) ;
@@ -174,6 +177,8 @@ public static class BuildParameters
174
177
context . Information ( "StrongNameDependentAssembliesInputPath: {0}" , StrongNameDependentAssembliesInputPath ) ;
175
178
context . Information ( "ShouldStrongNameChocolateyDependenciesWithCurrentPublicKeyToken: {0}" , ShouldStrongNameChocolateyDependenciesWithCurrentPublicKeyToken ) ;
176
179
context . Information ( "AssemblyNamesRegexPattern: {0}" , AssemblyNamesRegexPattern ) ;
180
+ context . Information ( "TestAssemblyFilePattern: {0}" , TestAssemblyFilePattern ) ;
181
+ context . Information ( "TestAssemblyProjectPattern: {0}" , TestAssemblyProjectPattern ) ;
177
182
context . Information ( "UseChocolateyGuiStrongNameKey: {0}" , UseChocolateyGuiStrongNameKey ) ;
178
183
context . Information ( "AllowedAssemblyName: {0}" , string . Join ( ", " , AllowedAssemblyNames ) ) ;
179
184
context . Information ( "TransifexEnabled: {0}" , TransifexEnabled ) ;
@@ -206,7 +211,8 @@ public static class BuildParameters
206
211
DirectoryPath solutionDirectoryPath = null ,
207
212
DirectoryPath rootDirectoryPath = null ,
208
213
DirectoryPath testDirectoryPath = null ,
209
- string testFilePattern = null ,
214
+ string testAssemblyFilePattern = null ,
215
+ string testAssemblyProjectPattern = null ,
210
216
string integrationTestScriptPath = null ,
211
217
string resharperSettingsFileName = null ,
212
218
string repositoryOwner = null ,
@@ -293,7 +299,6 @@ public static class BuildParameters
293
299
SolutionDirectoryPath = solutionDirectoryPath ?? SourceDirectoryPath . Combine ( Title ) ;
294
300
RootDirectoryPath = rootDirectoryPath ?? context . MakeAbsolute ( context . Environment . WorkingDirectory ) ;
295
301
TestDirectoryPath = testDirectoryPath ?? sourceDirectoryPath ;
296
- TestFilePattern = testFilePattern ;
297
302
IntegrationTestScriptPath = integrationTestScriptPath ?? context . MakeAbsolute ( ( FilePath ) "test.cake" ) ;
298
303
ResharperSettingsFileName = resharperSettingsFileName ?? string . Format ( "{0}.sln.DotSettings" , Title ) ;
299
304
RepositoryOwner = repositoryOwner ?? string . Empty ;
@@ -386,6 +391,24 @@ public static class BuildParameters
386
391
387
392
Target = context . Argument ( "target" , "Default" ) ;
388
393
BuildCounter = context . Argument ( "buildCounter" , BuildProvider . Build . Number ) ;
394
+ TestExecutionType = context . Argument ( "testExecutionType" , "unit" ) ;
395
+
396
+ if ( TestExecutionType == "unit" )
397
+ {
398
+ TestAssemblyFilePattern = testAssemblyFilePattern ?? "/**/*[tT]ests.dll" ;
399
+ TestAssemblyProjectPattern = testAssemblyProjectPattern ?? "/**/*[tT]ests.csproj" ;
400
+ }
401
+ else if ( TestExecutionType == "integration" )
402
+ {
403
+ TestAssemblyFilePattern = testAssemblyFilePattern ?? "/**/*[tT]ests.[iI]ntegration.dll" ;
404
+ TestAssemblyProjectPattern = testAssemblyProjectPattern ?? "/**/*[tT]ests.[iI]ntegration.csproj" ;
405
+ }
406
+ else if ( TestExecutionType == "all" )
407
+ {
408
+ TestAssemblyFilePattern = testAssemblyFilePattern ?? "/**/*{[tT]ests|[tT]ests.[iI]ntegration}.dll" ;
409
+ TestAssemblyProjectPattern = testAssemblyProjectPattern ?? "/**/*{[tT]ests|[tT]ests.[iI]ntegration}.csproj" ;
410
+ }
411
+
389
412
Configuration = context . Argument ( "configuration" , "Release" ) ;
390
413
DeploymentEnvironment = context . Argument ( "environment" , "Release" ) ;
391
414
ForceContinuousIntegration = context . Argument ( "forceContinuousIntegration" , false ) ;
0 commit comments