-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Also: * Update `.travis.yml` to use .NET Core released version. * Update `appveyor.yml` with `dotnet pack` and saving package as build artifact (we can configure `deploy:` to NuGet as well). * Minor branding updates including addition of MaxMind-logo and used in project.json -> `iconUrl`. :) * Add ability to set `mmdb` path via command-line argument and environment variable `MAXMIND_BENCHMARK_DB` in `GeoIP2.Benchmark` runner with fallback to CWD/GeoLite2-City.mmdb. * Add ability to set test directory via environment variable `MAXMIND_TEST_BASE_DIR` in `GeoIP2.UnitTests` and falls back to CWD. * Remove `Program.cs` in `UnitTests` project in favour of dotnet-test-nunit runner.
- Loading branch information
Showing
12 changed files
with
179 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using System; | ||
using System.IO; | ||
|
||
namespace MaxMind.GeoIP2.UnitTests | ||
{ | ||
internal static class TestUtils | ||
{ | ||
public static string TestDirectory { get; } = GetTestDirectory(); | ||
|
||
private static string GetTestDirectory() | ||
{ | ||
// check if environment variable MAXMIND_TEST_BASE_DIR is set | ||
string dbPath = Environment.GetEnvironmentVariable("MAXMIND_TEST_BASE_DIR"); | ||
|
||
if (!string.IsNullOrEmpty(dbPath)) | ||
{ | ||
if (!Directory.Exists(dbPath)) | ||
{ | ||
throw new Exception("Path set as environment variable MAXMIND_TEST_BASE_DIR does not exist!"); | ||
} | ||
|
||
return dbPath; | ||
} | ||
|
||
#if !NETCOREAPP1_0 | ||
return Environment.CurrentDirectory; | ||
#else | ||
return Directory.GetCurrentDirectory(); | ||
#endif | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.