Skip to content

Commit 3b610c9

Browse files
authored
Try actually running the tests under .net core (#77)
1 parent 03cd66b commit 3b610c9

File tree

2 files changed

+32
-10
lines changed

2 files changed

+32
-10
lines changed

LibZipSharp.UnitTest/LibZipSharp.UnitTest.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
<Project Sdk="Microsoft.NET.Sdk">
2-
<Import Project="$(MSBuildThisFileDirectory)..\LibZipSharp.props" />
32
<PropertyGroup>
4-
<TargetFrameworks>net471</TargetFrameworks>
5-
<TargetFrameworks Condition="$([MSBuild]::IsOsPlatform('Windows')) And $([MSBuild]::IsOsPlatform('Linux'))">$(TargetFrameworks);netcoreapp3.1</TargetFrameworks>
3+
<TargetFrameworks>net471;netcoreapp3.1</TargetFrameworks>
64

75
<IsPackable>false</IsPackable>
86
<LibZipSharpBundleAllNativeLibraries>true</LibZipSharpBundleAllNativeLibraries>
97
<ReferenceNuget Condition="'$(ReferenceNuget)' == ''">False</ReferenceNuget>
108
<DefineConstants Condition="'$(OS)' == 'Windows_NT'">$(DefineConstants);WINDOWS</DefineConstants>
119
</PropertyGroup>
1210

11+
<Import Project="$(MSBuildThisFileDirectory)..\LibZipSharp.props" />
12+
1313
<ItemGroup>
1414
<PackageReference Include="nunit" Version="3.12.0" />
1515
<PackageReference Include="NUnit3TestAdapter" Version="3.16.1" />

azure-pipelines.yml

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ stages:
9494
- buildlinux
9595
- buildWindows
9696
pool:
97-
vmImage: macOS-10.14
97+
vmImage: macOS-latest
9898
steps:
9999
- bash: |
100100
brew tap xamarin/xamarin-android-windeps
@@ -194,6 +194,12 @@ stages:
194194
inputs:
195195
artifactName: NuGet
196196
downloadPath: $(Build.SourcesDirectory)
197+
- task: MSBuild@1
198+
displayName: 'Build solution LibZipSharp.UnitTest/LibZipSharp.UnitTest.csproj'
199+
inputs:
200+
solution: LibZipSharp.UnitTest/LibZipSharp.UnitTest.csproj
201+
configuration: Release
202+
msbuildArguments: /restore /p:ReferenceNuget=True /v:diag
197203
- task: MSBuild@1
198204
displayName: 'Build solution LibZipSharp.UnitTest/LibZipSharp.UnitTest.csproj'
199205
inputs:
@@ -204,12 +210,11 @@ stages:
204210
displayName: "Run Tests under .net Core"
205211
inputs:
206212
command: test
207-
projects: 'LibZipSharp.UnitTest/LibZipSharp.UnitTest.csproj'
208-
arguments: '--configuration Release --framework netcoreapp3.1 --no-build'
213+
arguments: 'LibZipSharp.UnitTest/bin/Release/netcoreapp3.1/LibZipSharp.UnitTest.dll'
209214
- job: testmacos
210215
displayName: 'Test MacOS'
211216
pool:
212-
vmImage: macOS-10.14
217+
vmImage: macOS-latest
213218
steps:
214219
- template: yaml-templates/use-dot-net.yaml
215220
parameters:
@@ -219,16 +224,27 @@ stages:
219224
inputs:
220225
artifactName: NuGet
221226
downloadPath: $(Build.SourcesDirectory)
227+
- task: MSBuild@1
228+
displayName: 'Build solution LibZipSharp.UnitTest/LibZipSharp.UnitTest.csproj'
229+
inputs:
230+
solution: LibZipSharp.UnitTest/LibZipSharp.UnitTest.csproj
231+
configuration: Release
232+
msbuildArguments: /restore /p:ReferenceNuget=True /v:diag
222233
- task: MSBuild@1
223234
displayName: 'Build solution LibZipSharp.UnitTest/LibZipSharp.UnitTest.csproj'
224235
inputs:
225236
solution: LibZipSharp.UnitTest/LibZipSharp.UnitTest.csproj
226237
configuration: Release
227238
msbuildArguments: /restore /t:RunNunitTests /p:ReferenceNuget=True /v:diag
239+
- task: DotNetCoreCLI@2
240+
displayName: "Run Tests under .net Core"
241+
inputs:
242+
command: test
243+
arguments: 'LibZipSharp.UnitTest/bin/Release/netcoreapp3.1/LibZipSharp.UnitTest.dll'
228244
- job: testwindows
229245
displayName: 'Test Windows'
230246
pool:
231-
vmImage: windows-2019
247+
vmImage: windows-latest
232248
steps:
233249
- template: yaml-templates/use-dot-net.yaml
234250
parameters:
@@ -240,6 +256,12 @@ stages:
240256
downloadPath: $(Build.SourcesDirectory)
241257
- task: MSBuild@1
242258
displayName: 'Build solution LibZipSharp.UnitTest/LibZipSharp.UnitTest.csproj'
259+
inputs:
260+
solution: LibZipSharp.UnitTest/LibZipSharp.UnitTest.csproj
261+
configuration: Release
262+
msbuildArguments: /restore /p:ReferenceNuget=True /v:diag
263+
- task: MSBuild@1
264+
displayName: 'Run Tests LibZipSharp.UnitTest/LibZipSharp.UnitTest.csproj'
243265
inputs:
244266
solution: LibZipSharp.UnitTest/LibZipSharp.UnitTest.csproj
245267
configuration: Release
@@ -248,8 +270,8 @@ stages:
248270
displayName: "Run Tests under .net Core"
249271
inputs:
250272
command: test
251-
projects: 'LibZipSharp.UnitTest/LibZipSharp.UnitTest.csproj'
252-
arguments: '--configuration Release --framework netcoreapp3.1 --no-build'
273+
arguments: 'LibZipSharp.UnitTest\bin\Release\netcoreapp3.1\LibZipSharp.UnitTest.dll
274+
'
253275
- stage: Publish
254276
dependsOn: Test
255277
condition: eq(variables['System.TeamProject'], 'devdiv') # only sign the packages when running on Windows, and using the private server which has the certificates

0 commit comments

Comments
 (0)