Browse Source

Merge pull request #77 from antonfirsov/add-sandbox46

Add ImageSharp.Sandbox46 to the test projects
pull/84/head
Anton Firsov 9 years ago
committed by GitHub
parent
commit
44abadd497
  1. 17
      ImageSharp.sln
  2. 3
      src/Shared/AssemblyInfo.Common.cs
  3. 217
      tests/ImageSharp.Sandbox46/ImageSharp.Sandbox46.csproj
  4. 25
      tests/ImageSharp.Sandbox46/Properties/AssemblyInfo.cs
  5. 24
      tests/ImageSharp.Sandbox46/README.md
  6. 11
      tests/ImageSharp.Sandbox46/packages.config
  7. 38
      tests/ImageSharp.Tests/TestFile.cs

17
ImageSharp.sln

@ -53,6 +53,18 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Shared", "Shared", "{9E574A
src\Shared\stylecop.json = src\Shared\stylecop.json
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ImageSharp.Sandbox46", "tests\ImageSharp.Sandbox46\ImageSharp.Sandbox46.csproj", "{96188137-5FA6-4924-AB6E-4EFF79C6E0BB}"
ProjectSection(ProjectDependencies) = postProject
{299D8E18-102C-42DE-ADBF-79098EE706A8} = {299D8E18-102C-42DE-ADBF-79098EE706A8}
{2E33181E-6E28-4662-A801-E2E7DC206029} = {2E33181E-6E28-4662-A801-E2E7DC206029}
{2AA31A1F-142C-43F4-8687-09ABCA4B3A26} = {2AA31A1F-142C-43F4-8687-09ABCA4B3A26}
{27AD4B5F-ECC4-4C63-9ECB-04EC772FDB6F} = {27AD4B5F-ECC4-4C63-9ECB-04EC772FDB6F}
{7213767C-0003-41CA-AB18-0223CFA7CE4B} = {7213767C-0003-41CA-AB18-0223CFA7CE4B}
{C77661B9-F793-422E-8E27-AC60ECC5F215} = {C77661B9-F793-422E-8E27-AC60ECC5F215}
{556ABDCF-ED93-4327-BE98-F6815F78B9B8} = {556ABDCF-ED93-4327-BE98-F6815F78B9B8}
{A623CFE9-9D2B-4528-AD1F-2E834B061134} = {A623CFE9-9D2B-4528-AD1F-2E834B061134}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -99,6 +111,10 @@ Global
{A623CFE9-9D2B-4528-AD1F-2E834B061134}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A623CFE9-9D2B-4528-AD1F-2E834B061134}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A623CFE9-9D2B-4528-AD1F-2E834B061134}.Release|Any CPU.Build.0 = Release|Any CPU
{96188137-5FA6-4924-AB6E-4EFF79C6E0BB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{96188137-5FA6-4924-AB6E-4EFF79C6E0BB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{96188137-5FA6-4924-AB6E-4EFF79C6E0BB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{96188137-5FA6-4924-AB6E-4EFF79C6E0BB}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -115,5 +131,6 @@ Global
{556ABDCF-ED93-4327-BE98-F6815F78B9B8} = {815C0625-CD3D-440F-9F80-2D83856AB7AE}
{A623CFE9-9D2B-4528-AD1F-2E834B061134} = {815C0625-CD3D-440F-9F80-2D83856AB7AE}
{9E574A07-F879-4811-9C41-5CBDC6BAFDB7} = {815C0625-CD3D-440F-9F80-2D83856AB7AE}
{96188137-5FA6-4924-AB6E-4EFF79C6E0BB} = {56801022-D71A-4FBE-BC5B-CBA08E2284EC}
EndGlobalSection
EndGlobal

3
src/Shared/AssemblyInfo.Common.cs

@ -35,4 +35,5 @@ using System.Runtime.CompilerServices;
// Ensure the internals can be tested.
[assembly: InternalsVisibleTo("ImageSharp.Benchmarks")]
[assembly: InternalsVisibleTo("ImageSharp.Tests")]
[assembly: InternalsVisibleTo("ImageSharp.Tests")]
[assembly: InternalsVisibleTo("ImageSharp.Sandbox46")]

217
tests/ImageSharp.Sandbox46/ImageSharp.Sandbox46.csproj

@ -0,0 +1,217 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\..\packages\xunit.runner.visualstudio.2.2.0-beta4-build1194\build\net20\xunit.runner.visualstudio.props" Condition="Exists('..\..\packages\xunit.runner.visualstudio.2.2.0-beta4-build1194\build\net20\xunit.runner.visualstudio.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{96188137-5FA6-4924-AB6E-4EFF79C6E0BB}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>ImageSharp</RootNamespace>
<AssemblyName>ImageSharp.Sandbox46</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;BENCHMARKING</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Numerics" />
<Reference Include="System.Numerics.Vectors, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\..\packages\System.Numerics.Vectors.4.1.1\lib\net46\System.Numerics.Vectors.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<Reference Include="xunit.abstractions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
<HintPath>..\..\packages\xunit.abstractions.2.0.1\lib\net35\xunit.abstractions.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="xunit.assert, Version=2.2.0.3444, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
<HintPath>..\..\packages\xunit.assert.2.2.0-beta4-build3444\lib\netstandard1.0\xunit.assert.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="xunit.core, Version=2.2.0.3444, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
<HintPath>..\..\packages\xunit.extensibility.core.2.2.0-beta4-build3444\lib\net45\xunit.core.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="xunit.execution.desktop, Version=2.2.0.3444, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
<HintPath>..\..\packages\xunit.extensibility.execution.2.2.0-beta4-build3444\lib\net45\xunit.execution.desktop.dll</HintPath>
<Private>True</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<Reference Include="ImageSharp">
<HintPath>..\..\src\ImageSharp\bin\$(Configuration)\net45\ImageSharp.dll</HintPath>
</Reference>
<Reference Include="ImageSharp.Drawing">
<HintPath>..\..\src\ImageSharp.Drawing\bin\$(Configuration)\net45\ImageSharp.Drawing.dll</HintPath>
</Reference>
<Reference Include="ImageSharp.Formats.Bmp">
<HintPath>..\..\src\ImageSharp.Formats.Bmp\bin\$(Configuration)\net45\ImageSharp.Formats.Bmp.dll</HintPath>
</Reference>
<Reference Include="ImageSharp.Formats.Gif">
<HintPath>..\..\src\ImageSharp.Formats.Gif\bin\$(Configuration)\net45\ImageSharp.Formats.Gif.dll</HintPath>
</Reference>
<Reference Include="ImageSharp.Formats.Jpeg">
<HintPath>..\..\src\ImageSharp.Formats.Jpeg\bin\$(Configuration)\net45\ImageSharp.Formats.Jpeg.dll</HintPath>
</Reference>
<Reference Include="ImageSharp.Formats.Png">
<HintPath>..\..\src\ImageSharp.Formats.Png\bin\$(Configuration)\net45\ImageSharp.Formats.Png.dll</HintPath>
</Reference>
<Reference Include="ImageSharp.Processing">
<HintPath>..\..\src\ImageSharp.Processing\bin\$(Configuration)\net45\ImageSharp.Processing.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="..\ImageSharp.Tests\Drawing\PolygonTests.cs">
<Link>Tests\Drawing\PolygonTests.cs</Link>
</Compile>
<Compile Include="..\ImageSharp.Tests\FileTestBase.cs">
<Link>Tests\FileTestBase.cs</Link>
</Compile>
<Compile Include="..\ImageSharp.Tests\Formats\Jpg\Block8x8FTests.cs">
<Link>Tests\Formats\Jpg\Block8x8FTests.cs</Link>
</Compile>
<Compile Include="..\ImageSharp.Tests\Formats\Jpg\JpegTestBase.cs">
<Link>Tests\Formats\Jpg\JpegTestBase.cs</Link>
</Compile>
<Compile Include="..\ImageSharp.Tests\Formats\Jpg\JpegTests.cs">
<Link>Tests\Formats\Jpg\JpegTests.cs</Link>
</Compile>
<Compile Include="..\ImageSharp.Tests\Formats\Jpg\ReferenceImplementations.cs">
<Link>Tests\Formats\Jpg\ReferenceImplementations.cs</Link>
</Compile>
<Compile Include="..\ImageSharp.Tests\Formats\Jpg\ReferenceImplementationsTests.cs">
<Link>Tests\Formats\Jpg\ReferenceImplementationsTests.cs</Link>
</Compile>
<Compile Include="..\ImageSharp.Tests\Formats\Jpg\YCbCrImageTests.cs">
<Link>Tests\Formats\Jpg\YCbCrImageTests.cs</Link>
</Compile>
<Compile Include="..\ImageSharp.Tests\Image\ImagePropertyTests.cs">
<Link>Tests\Image\ImagePropertyTests.cs</Link>
</Compile>
<Compile Include="..\ImageSharp.Tests\Image\ImageTests.cs">
<Link>Tests\Image\ImageTests.cs</Link>
</Compile>
<Compile Include="..\ImageSharp.Tests\Image\PixelAccessorTests.cs">
<Link>Tests\Image\PixelAccessorTests.cs</Link>
</Compile>
<Compile Include="..\ImageSharp.Tests\Processors\Filters\ResizeTests.cs">
<Link>Tests\Processors\Filters\ResizeTests.cs</Link>
</Compile>
<Compile Include="..\ImageSharp.Tests\TestBase.cs">
<Link>Tests\TestBase.cs</Link>
</Compile>
<Compile Include="..\ImageSharp.Tests\TestFile.cs">
<Link>Tests\TestFile.cs</Link>
</Compile>
<Compile Include="..\ImageSharp.Tests\TestImages.cs">
<Link>Tests\TestImages.cs</Link>
</Compile>
<Compile Include="..\ImageSharp.Tests\TestUtilities\Attributes\ImageDataAttributeBase.cs">
<Link>Tests\TestUtilities\Attributes\ImageDataAttributeBase.cs</Link>
</Compile>
<Compile Include="..\ImageSharp.Tests\TestUtilities\Attributes\WithBlankImageAttribute.cs">
<Link>Tests\TestUtilities\Attributes\WithBlankImageAttribute.cs</Link>
</Compile>
<Compile Include="..\ImageSharp.Tests\TestUtilities\Attributes\WithFileAttribute.cs">
<Link>Tests\TestUtilities\Attributes\WithFileAttribute.cs</Link>
</Compile>
<Compile Include="..\ImageSharp.Tests\TestUtilities\Attributes\WithFileCollectionAttribute.cs">
<Link>Tests\TestUtilities\Attributes\WithFileCollectionAttribute.cs</Link>
</Compile>
<Compile Include="..\ImageSharp.Tests\TestUtilities\Attributes\WithMemberFactoryAttribute.cs">
<Link>Tests\TestUtilities\Attributes\WithMemberFactoryAttribute.cs</Link>
</Compile>
<Compile Include="..\ImageSharp.Tests\TestUtilities\Attributes\WithSolidFilledImagesAttribute.cs">
<Link>Tests\TestUtilities\Attributes\WithSolidFilledImagesAttribute.cs</Link>
</Compile>
<Compile Include="..\ImageSharp.Tests\TestUtilities\Factories\GenericFactory.cs">
<Link>Tests\TestUtilities\Factories\GenericFactory.cs</Link>
</Compile>
<Compile Include="..\ImageSharp.Tests\TestUtilities\Factories\ImageFactory.cs">
<Link>Tests\TestUtilities\Factories\ImageFactory.cs</Link>
</Compile>
<Compile Include="..\ImageSharp.Tests\TestUtilities\ImageProviders\BlankProvider.cs">
<Link>Tests\TestUtilities\ImageProviders\BlankProvider.cs</Link>
</Compile>
<Compile Include="..\ImageSharp.Tests\TestUtilities\ImageProviders\FileProvider.cs">
<Link>Tests\TestUtilities\ImageProviders\FileProvider.cs</Link>
</Compile>
<Compile Include="..\ImageSharp.Tests\TestUtilities\ImageProviders\LambdaProvider.cs">
<Link>Tests\TestUtilities\ImageProviders\LambdaProvider.cs</Link>
</Compile>
<Compile Include="..\ImageSharp.Tests\TestUtilities\ImageProviders\SolidProvider.cs">
<Link>Tests\TestUtilities\ImageProviders\SolidProvider.cs</Link>
</Compile>
<Compile Include="..\ImageSharp.Tests\TestUtilities\ImageProviders\TestImageProvider.cs">
<Link>Tests\TestUtilities\ImageProviders\TestImageProvider.cs</Link>
</Compile>
<Compile Include="..\ImageSharp.Tests\TestUtilities\ImagingTestCaseUtility.cs">
<Link>Tests\TestUtilities\ImagingTestCaseUtility.cs</Link>
</Compile>
<Compile Include="..\ImageSharp.Tests\TestUtilities\MeasureFixture.cs">
<Link>Tests\TestUtilities\MeasureFixture.cs</Link>
</Compile>
<Compile Include="..\ImageSharp.Tests\TestUtilities\PixelTypes.cs">
<Link>Tests\TestUtilities\PixelTypes.cs</Link>
</Compile>
<Compile Include="..\ImageSharp.Tests\TestUtilities\Tests\TestImageProviderTests.cs">
<Link>Tests\TestUtilities\Tests\TestImageProviderTests.cs</Link>
</Compile>
<Compile Include="..\ImageSharp.Tests\TestUtilities\Tests\TestUtilityExtensionsTests.cs">
<Link>Tests\TestUtilities\Tests\TestUtilityExtensionsTests.cs</Link>
</Compile>
<Compile Include="..\ImageSharp.Tests\TestUtilities\TestUtilityExtensions.cs">
<Link>Tests\TestUtilities\TestUtilityExtensions.cs</Link>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
<None Include="README.md" />
</ItemGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\..\packages\xunit.runner.visualstudio.2.2.0-beta4-build1194\build\net20\xunit.runner.visualstudio.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\xunit.runner.visualstudio.2.2.0-beta4-build1194\build\net20\xunit.runner.visualstudio.props'))" />
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

25
tests/ImageSharp.Sandbox46/Properties/AssemblyInfo.cs

@ -0,0 +1,25 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("ImageSharp.Sandbox46")]
[assembly: AssemblyDescription("A cross-platform library for processing of image files written in C#")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ImageSharp.Sandbox46")]
[assembly: AssemblyCopyright("Copyright © James Jackson-South and contributors.")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("96188137-5fa6-4924-ab6e-4eff79c6e0bb")]

24
tests/ImageSharp.Sandbox46/README.md

@ -0,0 +1,24 @@
## Purpose
This project aims to workaround certain .NET Core tooling issues in Visual Studio based developer workflow at the time of it's creation (January 2017):
- .NET Core Performance profiling is not possible neither with Visual Studio nor with JetBrains profilers
- ~~JetBrains Unit Test explorer does not work with .NET Core projects~~
## How does it work?
- By referencing .NET 4.5 dll-s created by net45 target's of ImageSharp projects. NOTE: These are not project references!
- By including test classes (and utility classes) of the `ImageSharp.Tests` project using MSBUILD `<Link>`
- Compiling `ImageSharp.Sandbox46` should trigger the compilation of ImageSharp subprojects using a manually defined solution dependencies
## How to profile unit tests
#### 1. With Visual Studio 2015 Test Runner
- **Do not** build `ImageSharp.Tests`
- Build `ImageSharp.Sandbox46`
- Use the [context menu in Test Explorer](https://adamprescott.net/2012/12/12/performance-profiling-for-unit-tests/)
NOTE:
There was no *Profile test* option in my VS Professional. Maybe things were messed by VS2017 RC installation. [This post suggests](http://stackoverflow.com/questions/32034375/profiling-tests-in-visual-studio-community-2015) it's necessary to own Premium or Ultimate edition of Visual Studio to profile tests.
#### 2. With JetBrains ReSharper Ultimate
- The `Sandbox46` project is no longer needed here. The classic `ImageSharp.Tests` project can be discovered by Unit Test Explorer.
- You can use [context menus](https://www.jetbrains.com/resharper/features/unit_testing.html) from your test class, or from unit Test Exporer/Unit Test Sessions windows.
![Context Menu](https://www.jetbrains.com/resharper/features/screenshots/100/unit_testing_profiling.png)

11
tests/ImageSharp.Sandbox46/packages.config

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="System.Numerics.Vectors" version="4.1.1" targetFramework="net461" />
<package id="xunit" version="2.2.0-beta4-build3444" targetFramework="net461" />
<package id="xunit.abstractions" version="2.0.1" targetFramework="net461" />
<package id="xunit.assert" version="2.2.0-beta4-build3444" targetFramework="net461" />
<package id="xunit.core" version="2.2.0-beta4-build3444" targetFramework="net461" />
<package id="xunit.extensibility.core" version="2.2.0-beta4-build3444" targetFramework="net461" />
<package id="xunit.extensibility.execution" version="2.2.0-beta4-build3444" targetFramework="net461" />
<package id="xunit.runner.visualstudio" version="2.2.0-beta4-build1194" targetFramework="net461" developmentDependency="true" />
</packages>

38
tests/ImageSharp.Tests/TestFile.cs

@ -5,11 +5,12 @@
namespace ImageSharp.Tests
{
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.IO;
using ImageSharp.Formats;
using System.Linq;
using System.Reflection;
/// <summary>
/// A test image file.
@ -35,7 +36,7 @@ namespace ImageSharp.Tests
/// The file.
/// </summary>
private readonly string file;
/// <summary>
/// Initializes a new instance of the <see cref="TestFile"/> class.
/// </summary>
@ -132,13 +133,19 @@ namespace ImageSharp.Tests
/// </returns>
private static string GetFormatsDirectory()
{
var directories = new[] {
List<string> directories = new List< string > {
"TestImages/Formats/", // Here for code coverage tests.
"tests/ImageSharp.Tests/TestImages/Formats/", // from travis/build script
"../../../../TestImages/Formats/"
"../../../ImageSharp.Tests/TestImages/Formats/", // from Sandbox46
"../../../../TestImages/Formats/"
};
directories= directories.Select(x => Path.GetFullPath(x)).ToArray();
directories = directories.SelectMany(x => new[]
{
Path.GetFullPath(x)
}).ToList();
AddFormatsDirectoryFromTestAssebmlyPath(directories);
var directory = directories.FirstOrDefault(x => Directory.Exists(x));
@ -149,5 +156,24 @@ namespace ImageSharp.Tests
throw new System.Exception($"Unable to find Formats directory at any of these locations [{string.Join(", ", directories)}]");
}
/// <summary>
/// The path returned by Path.GetFullPath(x) can be relative to dotnet framework directory
/// in certain scenarios like dotTrace test profiling.
/// This method calculates and adds the format directory based on the ImageSharp.Tests assembly location.
/// </summary>
/// <param name="directories">The directories list</param>
private static void AddFormatsDirectoryFromTestAssebmlyPath(List<string> directories)
{
string assemblyLocation = typeof(TestFile).GetTypeInfo().Assembly.Location;
assemblyLocation = Path.GetDirectoryName(assemblyLocation);
if (assemblyLocation != null)
{
string dirFromAssemblyLocation = Path.Combine(assemblyLocation, "../../../TestImages/Formats/");
dirFromAssemblyLocation = Path.GetFullPath(dirFromAssemblyLocation);
directories.Add(dirFromAssemblyLocation);
}
}
}
}

Loading…
Cancel
Save