Browse Source

run tests on travis

pull/69/head
Scott Williams 9 years ago
parent
commit
176ad96dd2
  1. 1
      .travis.yml
  2. 17
      tests/ImageSharp.Tests/TestFile.cs

1
.travis.yml

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

17
tests/ImageSharp.Tests/TestFile.cs

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

Loading…
Cancel
Save