@@ -50,9 +50,8 @@ Task("TestSetup")
50
50
EnsureDirectoryExists ( artifacts + "/coverage" ) ;
51
51
} ) ;
52
52
53
- Task ( "Test (No Coverage )" )
53
+ Task ( "Test (Unix )" )
54
54
. WithCriteria ( IsRunningOnUnix )
55
- . WithCriteria ( false ) // TODO: Make work on travis
56
55
. IsDependentOn ( "TestSetup" )
57
56
. IsDependentOn ( "Build" )
58
57
. DoesForEach ( GetFiles ( "test/*/*.csproj" ) , ( testProject ) =>
@@ -61,27 +60,33 @@ Task("Test (No Coverage)")
61
60
testProject . GetDirectory ( ) . FullPath ,
62
61
new DotNetCoreTestSettings ( ) {
63
62
NoBuild = true ,
64
- Framework = "netcoreapp2.0" ,
63
+ Configuration = configuration ,
64
+ Framework = "netcoreapp2.1" ,
65
65
EnvironmentVariables = GitVersionEnvironmentVariables ,
66
- } ) ;
66
+ TestAdapterPath = "." ,
67
+ Logger = $ "\" xunit;LogFilePath={ string . Format ( "{0}/tests/{1}.xml" , artifacts , testProject . GetFilenameWithoutExtension ( ) ) } \" ",
68
+ ArgumentCustomization = args => args . Append ( "/p:CollectCoverage=true" ) ,
69
+ }
70
+ ) ;
67
71
} ) ;
68
72
69
- Task ( "Test (Coverage )" )
73
+ Task ( "Test (Windows )" )
70
74
. WithCriteria ( IsRunningOnWindows )
71
75
. IsDependentOn ( "TestSetup" )
72
76
. IsDependentOn ( "Build" )
73
77
. DoesForEach ( GetFiles ( "test/*/*.csproj" ) , ( testProject ) =>
74
78
{
75
79
DotCoverCover ( tool => {
76
- tool . DotNetCoreTool (
80
+ tool . DotNetCoreTest (
77
81
testProject . GetDirectory ( ) . FullPath ,
78
- "xunit" ,
79
- new ProcessArgumentBuilder ( )
80
- . AppendSwitchQuoted ( "-xml" , string . Format ( "{0}/tests/{1}.xml" , artifacts , testProject . GetFilenameWithoutExtension ( ) ) )
81
- . AppendSwitch ( "-configuration" , configuration )
82
- . Append ( "-noshadow" ) ,
83
- new DotNetCoreToolSettings ( ) {
82
+ new DotNetCoreTestSettings ( ) {
83
+ NoBuild = true ,
84
+ Configuration = configuration ,
85
+ Framework = "netcoreapp2.1" ,
84
86
EnvironmentVariables = GitVersionEnvironmentVariables ,
87
+ TestAdapterPath = "." ,
88
+ Logger = $ "\" xunit;LogFilePath={ string . Format ( "{0}/tests/{1}.xml" , artifacts , testProject . GetFilenameWithoutExtension ( ) ) } \" ",
89
+ // ArgumentCustomization = args => args.Append("/p:CollectCoverage=true"),
85
90
} ) ;
86
91
} ,
87
92
artifacts + "/coverage/coverage-" + testProject . GetFilenameWithoutExtension ( ) + ".dcvr" ,
@@ -120,8 +125,8 @@ Task("Test (Coverage)")
120
125
} ) ;
121
126
122
127
Task ( "Test" )
123
- . IsDependentOn ( "Test (Coverage )" )
124
- . IsDependentOn ( "Test (No Coverage )" ) ;
128
+ . IsDependentOn ( "Test (Unix )" )
129
+ . IsDependentOn ( "Test (Windows )" ) ;
125
130
126
131
Task ( "Pack" )
127
132
. WithCriteria ( IsRunningOnWindows ) // TODO: Make work on travis
0 commit comments