Browse Source

Speed up coverage and respond to comments

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

2
src/ImageSharp/Advanced/AotCompilerTools.cs

@ -1,6 +1,7 @@
// Copyright (c) Six Labors and contributors. // Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0. // Licensed under the Apache License, Version 2.0.
using System.Diagnostics.CodeAnalysis;
using System.Numerics; using System.Numerics;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using SixLabors.ImageSharp.Formats; 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. /// 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.) /// (Very similar to the LinkerIncludes.cs technique used in Xamarin.Android projects.)
/// </summary> /// </summary>
[ExcludeFromCodeCoverage]
internal static class AotCompilerTools internal static class AotCompilerTools
{ {
static AotCompilerTools() static AotCompilerTools()

6
tests/Directory.Build.targets

@ -29,7 +29,7 @@
<CollectCoverage>true</CollectCoverage> <CollectCoverage>true</CollectCoverage>
<UseSourceLink>true</UseSourceLink> <UseSourceLink>true</UseSourceLink>
<CoverletOutputFormat>opencover</CoverletOutputFormat> <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> <CoverletOutput>$(MSBuildThisFileDirectory)..\coverage.xml</CoverletOutput>
<!--Used by coverlet dues to reference issues with SixLabors.Core--> <!--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--> <!--https://github.com/tonerdo/coverlet/blob/master/Documentation/KnowIssues.md#4-failed-to-resolve-assembly-during-instrumentation-->
@ -40,8 +40,8 @@
<!--Test Dependencies--> <!--Test Dependencies-->
<PackageReference Update="BenchmarkDotNet" Version="0.12.0" /> <PackageReference Update="BenchmarkDotNet" Version="0.12.0" />
<PackageReference Update="Colourful" Version="2.0.3" /> <PackageReference Update="Colourful" Version="2.0.3" />
<PackageReference Update="coverlet.collector" Version="1.1.0"/> <PackageReference Update="coverlet.collector" Version="1.1.0" PrivateAssets="All"/>
<PackageReference Update="coverlet.msbuild" Version="2.8.0" /> <PackageReference Update="coverlet.msbuild" Version="2.8.0" PrivateAssets="All"/>
<PackageReference Update="Magick.NET-Q16-AnyCPU" Version="7.14.4" /> <PackageReference Update="Magick.NET-Q16-AnyCPU" Version="7.14.4" />
<PackageReference Update="Microsoft.NET.Test.Sdk" Version="16.4.0" /> <PackageReference Update="Microsoft.NET.Test.Sdk" Version="16.4.0" />
<PackageReference Update="Moq" Version="4.10.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> <TargetFrameworks>netcoreapp3.1;netcoreapp2.1;net472</TargetFrameworks>
<GenerateProgramFile>false</GenerateProgramFile> <GenerateProgramFile>false</GenerateProgramFile>
<!--Used to hide test project from dotnet test--> <!--Used to hide test project from dotnet test-->
<IsTestProject>false</IsTestProject>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>

Loading…
Cancel
Save