Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

Commit

Permalink
Add more target frameworks for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
caesay committed Dec 23, 2023
1 parent a072ee6 commit a21656b
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 18 deletions.
23 changes: 11 additions & 12 deletions test/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<PropertyGroup>
<PropertyGroup Condition=" $(MSBuildProjectName.EndsWith('Tests')) ">
<IsPackable>false</IsPackable>
<LangVersion>latest</LangVersion>
<IsTest>true</IsTest>
Expand All @@ -9,13 +9,21 @@
<AssemblyOriginatorKeyFile>..\..\Squirrel.snk</AssemblyOriginatorKeyFile>
<IsPackable>false</IsPackable>
<ImplicitUsings>enable</ImplicitUsings>

<!-- Coverage -->
<CoverletOutputFormat>json,opencover</CoverletOutputFormat>
<CoverletOutput>..\</CoverletOutput>
<MergeWith>..\coverage.json</MergeWith>
<Include>[Squirrel*]*</Include>
<Exclude>[Squirrel.*.Tests]*</Exclude>
<CollectCoverage>true</CollectCoverage>
</PropertyGroup>

<ItemGroup>
<ItemGroup Condition=" $(MSBuildProjectName.EndsWith('Tests')) ">
<Compile Include="..\GlobalUsings.cs" Link="GlobalUsings.cs" />
</ItemGroup>

<ItemGroup>
<ItemGroup Condition=" $(MSBuildProjectName.EndsWith('Tests')) ">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="xunit" Version="2.6.3" />
Expand All @@ -28,13 +36,4 @@
</PackageReference>
</ItemGroup>

<PropertyGroup>
<CoverletOutputFormat>json,opencover</CoverletOutputFormat>
<CoverletOutput>..\</CoverletOutput>
<MergeWith>..\coverage.json</MergeWith>
<Include>[Squirrel*]*</Include>
<Exclude>[Squirrel.*.Tests]*</Exclude>
<CollectCoverage>true</CollectCoverage>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
Expand Down
10 changes: 9 additions & 1 deletion test/Squirrel.Tests/Squirrel.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,21 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFrameworks>net462;net48;net6.0;net8.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="System.IO.Packaging" Version="8.0.0" />
</ItemGroup>

<ItemGroup Condition=" $(TargetFramework.StartsWith('net4')) ">
<Reference Include="System.Web" />
<Reference Include="System.Net.Http" />
<Reference Include="System.IO.Compression" />
<Reference Include="System.IO.Compression.FileSystem" />
<PackageReference Include="StrongNamer" Version="0.2.5" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\Squirrel\Squirrel.csproj" />
</ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions test/Squirrel.Tests/TestHelpers/FakeFixtureRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ public FakeFixtureRepository(string pkgId, bool mockLatestFullVer)
.ToList();

if (mockLatestFullVer) {
var minFullVer = releases.Where(r => !r.IsDelta).MinBy(r => r.Version);
var maxfullVer = releases.Where(r => !r.IsDelta).MaxBy(r => r.Version).Single();
var maxDeltaVer = releases.Where(r => r.IsDelta).MaxBy(r => r.Version).Single();
var minFullVer = releases.Where(r => !r.IsDelta).OrderBy(r => r.Version).First();
var maxfullVer = releases.Where(r => !r.IsDelta).OrderByDescending(r => r.Version).First();
var maxDeltaVer = releases.Where(r => r.IsDelta).OrderByDescending(r => r.Version).First();

// our fixtures don't have a full package for the latest version, we expect the tests to generate this file
if (maxfullVer.Version < maxDeltaVer.Version) {
Expand Down

0 comments on commit a21656b

Please sign in to comment.