-
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Add net6.0 to tests - allow to build and run tests with `dotnet` - fix failing tests with net6.0 - at least partially caused by a too long message for `IgnoreAttribute` - move native tests to `NativeMethods` subdirectory - remove `icu.net.netstandard.testrunner` project since it's now possible to run .NET Core tests with `dotnet test` - implement `DllResolver` to resolve native libraries on .NET Core +semver:minor
- Loading branch information
1 parent
ea985f1
commit 0ab57ff
Showing
21 changed files
with
223 additions
and
95 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 was deleted.
Oops, something went wrong.
14 changes: 0 additions & 14 deletions
14
source/icu.net.netstandard.testrunner/icu.net.netstandard.testrunner.csproj
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
// Copyright (c) 2022 SIL International | ||
// This software is licensed under the MIT License (http://opensource.org/licenses/MIT) | ||
|
||
using System.IO; | ||
using NUnit.Framework; | ||
|
||
namespace Icu.Tests | ||
{ | ||
#if NET | ||
[TestFixture] | ||
public class DllResolverTests | ||
{ | ||
private string _tempPath; | ||
|
||
[TearDown] | ||
public void TearDown() | ||
{ | ||
if (string.IsNullOrEmpty(_tempPath)) | ||
return; | ||
|
||
Directory.Delete(_tempPath, true); | ||
_tempPath = null; | ||
} | ||
|
||
[TestCase("linux", ExpectedResult = true, IncludePlatform = "Linux")] | ||
[TestCase("Linux", ExpectedResult = true, IncludePlatform = "Linux")] | ||
[TestCase("!windows,osx", ExpectedResult = true, IncludePlatform = "Linux")] | ||
[TestCase("!windows,linux", ExpectedResult = false, IncludePlatform = "Linux, Win")] | ||
[TestCase("windows,linux", ExpectedResult = true, IncludePlatform = "Linux")] | ||
[TestCase("windows", ExpectedResult = true, IncludePlatform = "Win")] | ||
[TestCase("Windows", ExpectedResult = true, IncludePlatform = "Win")] | ||
[TestCase("!linux,osx", ExpectedResult = true, IncludePlatform = "Win")] | ||
[TestCase("windows,linux", ExpectedResult = true, IncludePlatform = "Win")] | ||
[TestCase("osx", ExpectedResult = true, IncludePlatform = "MacOsX")] | ||
[TestCase("OSX", ExpectedResult = true, IncludePlatform = "MacOsX")] | ||
[TestCase("!linux,windows", ExpectedResult = true, IncludePlatform = "MacOsX")] | ||
[TestCase("!windows,osx", ExpectedResult = false, IncludePlatform = "MacOsX, Win")] | ||
[TestCase("windows,osx", ExpectedResult = true, IncludePlatform = "MacOsX")] | ||
public bool ConditionApplies(string condition) | ||
{ | ||
return DllResolver.ConditionApplies(condition); | ||
} | ||
|
||
[TestCase(ExpectedResult = "libdl.so.2", IncludePlatform = "Linux")] | ||
[TestCase(ExpectedResult = "libdl.dylib", IncludePlatform = "MacOsX")] | ||
[TestCase(ExpectedResult = "libdl.dll", IncludePlatform = "Win")] | ||
public string MapLibraryName() | ||
{ | ||
_tempPath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); | ||
Directory.CreateDirectory(_tempPath); | ||
var fakeDll = Path.Combine(_tempPath, "test.dll"); | ||
var configFile = fakeDll + ".config"; | ||
File.WriteAllText(configFile, @"<?xml version=""1.0"" encoding=""utf-8"" ?> | ||
<configuration> | ||
<dllmap os=""!windows,osx"" dll=""libdl.dll"" target=""libdl.so.2"" /> | ||
<dllmap os=""osx"" dll=""libdl.dll"" target=""libdl.dylib""/> | ||
</configuration>"); | ||
|
||
return DllResolver.MapLibraryName(fakeDll, "libdl.dll"); | ||
} | ||
} | ||
#endif | ||
} |
File renamed without changes.
File renamed without changes.
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
Oops, something went wrong.