Browse Source

run tests on travis

af/merge-core
Scott Williams 9 years ago
parent
commit
08ddcd9b0f
  1. 1
      .travis.yml
  2. 17
      tests/ImageSharp.Tests/TestFile.cs

1
.travis.yml

@ -21,6 +21,7 @@ branches:
script:
- dotnet restore
- dotnet build -c Release src/*/project.json
- dotnet test tests\ImageSharp.Tests\project.json -c Release -f "netcoreapp1.1"
env:
global:

17
tests/ImageSharp.Tests/TestFile.cs

@ -9,6 +9,7 @@ namespace ImageSharp.Tests
using System.IO;
using ImageSharp.Formats;
using System.Linq;
/// <summary>
/// A test image file.
@ -144,14 +145,22 @@ namespace ImageSharp.Tests
/// </returns>
private static string GetFormatsDirectory()
{
// Here for code coverage tests.
string directory = "TestImages/Formats/";
if (Directory.Exists(directory))
var directories = new[] {
"TestImages/Formats/", // Here for code coverage tests.
"tests/ImageSharp.Tests/TestImages/Formats/", // from travis/build script
"../../../../TestImages/Formats/"
};
directories= directories.Select(x => Path.GetFullPath(x)).ToArray();
var directory = directories.FirstOrDefault(x => Directory.Exists(x));
if(directory != null)
{
return directory;
}
return "../../../../TestImages/Formats/";
throw new System.Exception($"Unable to find Formats directory at any of these locations [{string.Join(", ", directories)}]");
}
}
}

Loading…
Cancel
Save