Browse Source

Speed up coverage and respond to comments

pull/1061/head
James Jackson-South 6 years ago
parent
commit
21ad572ee6
  1. 16
      ci-test.ps1
  2. 2
      src/ImageSharp/Advanced/AotCompilerTools.cs
  3. 6
      tests/Directory.Build.targets
  4. 1
      tests/ImageSharp.Benchmarks/ImageSharp.Benchmarks.csproj

16
ci-test.ps1

@ -6,18 +6,18 @@ param(
[Parameter(Mandatory, Position = 2)]
[string]$platform,
[Parameter(Mandatory, Position = 3)]
[string]$codecov
[string]$codecov,
[Parameter(Position = 4)]
[string]$codecovProfile = 'Release'
)
$netFxRegex = '^net\d+'
$netFxRegex = '^net\d+'
if ($codecov -eq 'true') {
# xunit doesn't understand custom params so use dotnet test.
# Coverage tests are run in debug because the coverage tools are triggering a JIT error in filter processors
# that causes the blue component of transformed values to be corrupted.
dotnet clean -c Debug
dotnet test -c Debug -f $targetFramework /p:codecov=true
# Allow toggling of profile to workaround any potential JIT errors caused by code injection.
dotnet clean -c $codecovProfile
dotnet test -c $codecovProfile -f $targetFramework /p:codecov=true
}
elseif ($platform -eq '-x86' -and $targetFramework -match $netFxRegex) {
@ -31,7 +31,7 @@ elseif ($platform -eq '-x86' -and $targetFramework -match $netFxRegex) {
Set-Location $PSScriptRoot
}
else {
else {
dotnet test --no-build -c Release -f $targetFramework
}

2
src/ImageSharp/Advanced/AotCompilerTools.cs

@ -1,6 +1,7 @@
// Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0.
using System.Diagnostics.CodeAnalysis;
using System.Numerics;
using System.Runtime.CompilerServices;
using SixLabors.ImageSharp.Formats;
@ -19,6 +20,7 @@ namespace SixLabors.ImageSharp.Advanced
/// None of the methods in this class should ever be called, the code only has to exist at compile-time to be picked up by the AoT compiler.
/// (Very similar to the LinkerIncludes.cs technique used in Xamarin.Android projects.)
/// </summary>
[ExcludeFromCodeCoverage]
internal static class AotCompilerTools
{
static AotCompilerTools()

6
tests/Directory.Build.targets

@ -29,7 +29,7 @@
<CollectCoverage>true</CollectCoverage>
<UseSourceLink>true</UseSourceLink>
<CoverletOutputFormat>opencover</CoverletOutputFormat>
<!--Ouput injects target framework into name despite explicit config. See build yml-->
<!--Output injects target framework into name despite explicit config. See build yml-->
<CoverletOutput>$(MSBuildThisFileDirectory)..\coverage.xml</CoverletOutput>
<!--Used by coverlet dues to reference issues with SixLabors.Core-->
<!--https://github.com/tonerdo/coverlet/blob/master/Documentation/KnowIssues.md#4-failed-to-resolve-assembly-during-instrumentation-->
@ -40,8 +40,8 @@
<!--Test Dependencies-->
<PackageReference Update="BenchmarkDotNet" Version="0.12.0" />
<PackageReference Update="Colourful" Version="2.0.3" />
<PackageReference Update="coverlet.collector" Version="1.1.0"/>
<PackageReference Update="coverlet.msbuild" Version="2.8.0" />
<PackageReference Update="coverlet.collector" Version="1.1.0" PrivateAssets="All"/>
<PackageReference Update="coverlet.msbuild" Version="2.8.0" PrivateAssets="All"/>
<PackageReference Update="Magick.NET-Q16-AnyCPU" Version="7.14.4" />
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="16.4.0" />
<PackageReference Update="Moq" Version="4.10.0" />

1
tests/ImageSharp.Benchmarks/ImageSharp.Benchmarks.csproj

@ -8,6 +8,7 @@
<TargetFrameworks>netcoreapp3.1;netcoreapp2.1;net472</TargetFrameworks>
<GenerateProgramFile>false</GenerateProgramFile>
<!--Used to hide test project from dotnet test-->
<IsTestProject>false</IsTestProject>
</PropertyGroup>
<ItemGroup>

Loading…
Cancel
Save