Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[iOS][non-icu] HybridGlobalization use system ICU #93220

Merged
merged 123 commits into from
Dec 19, 2023
Merged
Show file tree
Hide file tree
Changes from 52 commits
Commits
Show all changes
123 commits
Select commit Hold shift + click to select a range
2d149a4
comment loading icu when hybrid mode
mkhamoyan Oct 4, 2023
4bd2918
Fix failing tests without loading icu
mkhamoyan Oct 9, 2023
8bf39c6
Merge branch 'main' into system_icu
mkhamoyan Oct 9, 2023
d5bcd12
Uncomment calendar test cases
mkhamoyan Oct 9, 2023
c2f7ac4
fix build failures
mkhamoyan Oct 16, 2023
064b71b
Remove other ICU references
Oct 17, 2023
47f0271
Load pal_idna.c
mkhamoyan Oct 18, 2023
82c04b1
clean the branch
mkhamoyan Oct 18, 2023
6796080
Merge branch 'main' into system_icu
mkhamoyan Oct 20, 2023
d3fcc60
Remove not needed function
mkhamoyan Oct 20, 2023
fb34efc
minor fix
mkhamoyan Oct 20, 2023
2e0900c
Add country and language tables
mkhamoyan Oct 23, 2023
a91cdf7
Add check for hybrid mode
mkhamoyan Oct 23, 2023
7d6641d
minor fix
mkhamoyan Oct 23, 2023
5097d38
Fix build
akoeplinger Oct 23, 2023
4ad9b4e
link to -licucore in the appbuilder
mkhamoyan Oct 23, 2023
455aa2a
Fix System.Globalization.Tests on hybrid mode
mkhamoyan Oct 24, 2023
64b9309
revert changes in IOS tests
mkhamoyan Oct 24, 2023
39785db
revert ios tests csproj changes
mkhamoyan Oct 24, 2023
1caed2e
inlcude utypes.h
mkhamoyan Oct 24, 2023
7beec5c
Adjust idna mapping tests
mkhamoyan Oct 24, 2023
f097dec
Fix idna mapping tests
mkhamoyan Oct 25, 2023
87f2011
Fix System.Runtime.Tests,disable some of the tests
mkhamoyan Oct 25, 2023
bbf590e
Merge branch 'main' into system_icu
mkhamoyan Oct 25, 2023
125ce63
Merge branch 'main' into system_icu
mkhamoyan Oct 30, 2023
182e069
fix build on non Apple platforms
mkhamoyan Oct 30, 2023
662d5ea
Fix non Apple platform builds
mkhamoyan Oct 30, 2023
6360fd4
Merge branch 'main' into system_icu
mkhamoyan Nov 1, 2023
a3db930
Fix merge conflicts
mkhamoyan Nov 1, 2023
5860103
Fix failed tests after merge
mkhamoyan Nov 2, 2023
16b3847
Include pal files for non Apple platforms
mkhamoyan Nov 2, 2023
710ce29
fix nativeaot build failure
mkhamoyan Nov 6, 2023
71ad42f
Merge branch 'main' into system_icu
mkhamoyan Nov 6, 2023
ef3f945
Fix -licucore related failures
mkhamoyan Nov 6, 2023
49ef3ab
Fix CMake if block
mkhamoyan Nov 6, 2023
3bbe6d8
Remove "pal_icushim_internal.h" from headers
mkhamoyan Nov 6, 2023
380efe4
fix osx failures
mkhamoyan Nov 6, 2023
429d777
Fix OSX failures
mkhamoyan Nov 6, 2023
1d1021e
Fix osx build failures
mkhamoyan Nov 6, 2023
6ecdeae
Fix maccatalyst x64 failure
mkhamoyan Nov 7, 2023
814cadc
Fix native crash when running tests on osx
mkhamoyan Nov 7, 2023
7702cf7
Fix maccatalyst failure
mkhamoyan Nov 7, 2023
b0c1a51
Fix build on iOSLike platforms
mkhamoyan Nov 7, 2023
d9d1136
use TARGET_OS_MAC
mkhamoyan Nov 7, 2023
fc9d472
Fix osx build
mkhamoyan Nov 7, 2023
7e7bf74
include TargetConditionals header
mkhamoyan Nov 8, 2023
d165171
check only using TARGET_OS_IPHONE
mkhamoyan Nov 8, 2023
7049e31
Fix osx build
mkhamoyan Nov 8, 2023
6debeb5
fix build failure
mkhamoyan Nov 8, 2023
68b8b88
Fix osx build
mkhamoyan Nov 8, 2023
7b640e0
Fix browser build failure
mkhamoyan Nov 8, 2023
7330fdf
run iOS.DEVICE.Aot.Tests also on hybrid mode
mkhamoyan Nov 8, 2023
760de2a
Fix native aot build
mkhamoyan Nov 9, 2023
1cf723c
fix nativeaot build
mkhamoyan Nov 9, 2023
b381ef0
fix bowser build
mkhamoyan Nov 9, 2023
2e29b1d
Fix nativeaot build
mkhamoyan Nov 13, 2023
1171ce0
add target definitions
mkhamoyan Nov 13, 2023
043e638
Merge branch 'main' into system_icu
mkhamoyan Nov 13, 2023
b8c697b
Fix native aot build
mkhamoyan Nov 14, 2023
37681f2
set hybridglobalization for functional tests
mkhamoyan Nov 14, 2023
e7111bd
Try without checking hybrid mode
mkhamoyan Nov 14, 2023
8c5d9f0
change IcuInitSortHandle
mkhamoyan Nov 14, 2023
a6fe664
Set hybrid without checking target
mkhamoyan Nov 15, 2023
d8658ce
fix nativeaot build
mkhamoyan Nov 15, 2023
45428ef
add hybrid only for osx in ILLink
mkhamoyan Nov 15, 2023
cf153d9
Fix osx-x64 linker failure
mkhamoyan Nov 15, 2023
90026f0
Cleanup code
mkhamoyan Nov 15, 2023
696ff66
Clean up and fix runtime-extra-platform failure
mkhamoyan Nov 15, 2023
5354f28
enable hybrid mode in nativeaot runtime tests
mkhamoyan Nov 15, 2023
f446fcd
Fix nativeaot and iossimulator failure
mkhamoyan Nov 15, 2023
bd73666
include in LibraryBuilder template -licucore
mkhamoyan Nov 15, 2023
5788349
Merge branch 'main' into system_icu
mkhamoyan Nov 15, 2023
914a7aa
check if hybrid mode is set
mkhamoyan Nov 16, 2023
ba92af7
include licucore when LibraryMode
mkhamoyan Nov 16, 2023
eff8512
Fix nativeaot runtime tests build failure
mkhamoyan Nov 20, 2023
5c53525
Implement GetSortKeyNative function
mkhamoyan Nov 21, 2023
6d5ecde
Update SortKey implementation for hybrid mode
mkhamoyan Nov 23, 2023
8e2dd91
Fix IgnoreKanaType related test failures
mkhamoyan Nov 23, 2023
32d5db1
Do minor fixes and mark active issue
mkhamoyan Nov 24, 2023
1134b7a
Revert ValidCompareMaskOffFlags changes
mkhamoyan Nov 24, 2023
714ac50
Implement IgnoreKanaType for hybrid
mkhamoyan Nov 24, 2023
f16988c
Fix System.Runtime.Tests
mkhamoyan Nov 24, 2023
af8ba6a
Enable some tests
mkhamoyan Nov 24, 2023
ba37d39
Merge branch 'main' into system_icu
mkhamoyan Nov 27, 2023
52b8f35
fix crash on System.Private.Xml.Tests
mkhamoyan Nov 27, 2023
222d528
Fix failure
mkhamoyan Nov 27, 2023
940042b
Fix failure
mkhamoyan Nov 28, 2023
9ecc945
Disable startswith test
mkhamoyan Nov 28, 2023
317bd6a
Skip NoMatch_stringComparisonTests
mkhamoyan Nov 28, 2023
a18110c
enable hybrid mode on XmlFormatWriterGeneratorAot
mkhamoyan Nov 28, 2023
caafa6b
check if utf16 convertion is needed
mkhamoyan Nov 28, 2023
352c1c2
Test GlobalizationNative_GetSortKeyNative
mkhamoyan Nov 29, 2023
d29f2b5
Enable SortKey tests on hybrid mode
mkhamoyan Nov 30, 2023
3e4a8ba
Fix XmlFormatWriterGeneratorAot test
mkhamoyan Nov 30, 2023
2944f96
refactor GetSortKey function
mkhamoyan Dec 4, 2023
8a2ce03
Merge branch 'main' into system_icu
mkhamoyan Dec 4, 2023
09dd476
check if calendar is the cause
mkhamoyan Dec 4, 2023
43aca30
check if _calendars is null
mkhamoyan Dec 4, 2023
d94c917
check for _calendars?.Length
mkhamoyan Dec 4, 2023
6193794
Refactor GetSortKey
mkhamoyan Dec 5, 2023
6321784
Stop using GlobalizationMode Settings static constructor because we d…
Dec 5, 2023
d7613f3
Merge remote-tracking branch 'meri/system_icu' into system_icu
Dec 5, 2023
8ec7727
Fix syntax error
mkhamoyan Dec 6, 2023
6cb3ff0
Merge branch 'main' into system_icu
mkhamoyan Dec 6, 2023
3fe8320
Merge branch 'main' into system_icu
mkhamoyan Dec 6, 2023
6ca8bd1
Refactor
mkhamoyan Dec 6, 2023
a50fb14
Fix wrong merge
mkhamoyan Dec 6, 2023
f6708f0
Changes requested by review
mkhamoyan Dec 7, 2023
7dfc908
Align lines
mkhamoyan Dec 7, 2023
213f6a4
Mark test cases as activeissue
mkhamoyan Dec 12, 2023
35d3b34
Merge branch 'main' into system_icu
mkhamoyan Dec 12, 2023
5127785
Revert the change and update documentation
mkhamoyan Dec 12, 2023
20096cd
include ICU headers in pal_icushim_internal.h
mkhamoyan Dec 12, 2023
cdb2ba2
Merge branch 'main' into system_icu
mkhamoyan Dec 12, 2023
1245214
Fix nativeaot failures
mkhamoyan Dec 12, 2023
336f050
Merge branch 'main' into system_icu
mkhamoyan Dec 15, 2023
ae7d959
Merge branch 'main' into system_icu
mkhamoyan Dec 15, 2023
b602e0a
mark the function as static
mkhamoyan Dec 15, 2023
71d9717
Merge branch 'main' into system_icu
mkhamoyan Dec 18, 2023
83076e0
Fix nativeaot failures
mkhamoyan Dec 18, 2023
c422d07
check if this broke nativeaot tests
mkhamoyan Dec 18, 2023
2b42a43
Fix nativeaot failure
mkhamoyan Dec 18, 2023
ba3aecb
review refactoring
mkhamoyan Dec 19, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion eng/testing/tests.ioslike.targets
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
Include="@(AppleAssembliesToBundle)" TargetDir="extraFiles\%(AppleAssembliesToBundle.RecursiveDir)" />
</ItemGroup>

<ItemGroup Condition="'$(UseNativeAOTRuntime)' == 'true'">
<ItemGroup Condition="'$(UseNativeAOTRuntime)' == 'true' and '$(HybridGlobalization)' == 'false'" >
<BundleFiles Include="$(MicrosoftNetCoreAppRuntimePackDir)/runtimes/$(TargetOS)-$(TargetArchitecture)/native/icudt.dat"
TargetDir="publish" />
<BundleFiles Include="$(MicrosoftNetCoreAppRuntimePackDir)/runtimes/$(TargetOS)-$(TargetArchitecture)/native/libicudata.a"
Expand Down Expand Up @@ -157,6 +157,9 @@
<WriteLinesToFile File="$(PublishDir)xunit-excludes.txt" Lines="$(XunitExcludesTxtFileContent)" Overwrite="true" />

<PropertyGroup>
<!-- Default for now. If we can remove our ICU and rely on the system one, then HybridGlobalization becomes the default and we can remove checks for it -->
<HybridGlobalization>true</HybridGlobalization>
ilonatommy marked this conversation as resolved.
Show resolved Hide resolved

<IncludesTestRunner Condition="'$(IncludesTestRunner)' == ''">true</IncludesTestRunner>
<Optimized Condition="'$(Configuration)' == 'Release'">true</Optimized>
<MainLibraryFileName Condition="'$(MainLibraryFileName)' == '' and '$(IsRuntimeTests)' != 'true' and '$(IncludesTestRunner)' == 'true'">AppleTestRunner.dll</MainLibraryFileName>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ public static string GetDistroVersionString()
public static bool IsIcuGlobalization => ICUVersion > new Version(0, 0, 0, 0);
public static bool IsIcuGlobalizationAndNotHybridOnBrowser => IsIcuGlobalization && IsNotHybridGlobalizationOnBrowser;
public static bool IsIcuGlobalizationAndNotHybrid => IsIcuGlobalization && IsNotHybridGlobalization;
public static bool IsNlsGlobalization => IsNotInvariantGlobalization && !IsIcuGlobalization;
public static bool IsNlsGlobalization => IsNotInvariantGlobalization && !IsIcuGlobalization && !IsHybridGlobalization;

public static bool IsSubstAvailable
{
Expand Down
14 changes: 7 additions & 7 deletions src/libraries/Common/tests/Tests/System/StringTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1282,7 +1282,7 @@ public static void ContainsMatchDifferentSpans_StringComparison()
Assert.True(span.Contains(slice, StringComparison.OrdinalIgnoreCase));
}

[Fact]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotHybridGlobalizationOnOSX))]
public static void ContainsNoMatch_StringComparison()
{
for (int length = 1; length < 150; length++)
Expand Down Expand Up @@ -1724,7 +1724,7 @@ public static IEnumerable<object[]> EndsWith_StringComparison_TestData()
yield return new object[] { "", "a", StringComparison.OrdinalIgnoreCase, false };
}

[Theory]
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotHybridGlobalizationOnOSX))]
[MemberData(nameof(EndsWith_StringComparison_TestData))]
public static void EndsWith_StringComparison(string s, string value, StringComparison comparisonType, bool expected)
{
Expand Down Expand Up @@ -3194,7 +3194,7 @@ public static void IndexOf_TurkishI_EnglishUSCulture()
}
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsIcuGlobalizationAndNotHybrid))]
[ActiveIssue("https://github.com/dotnet/runtime/issues/60568", TestPlatforms.Android | TestPlatforms.LinuxBionic)]
public static void IndexOf_HungarianDoubleCompression_HungarianCulture()
{
Expand Down Expand Up @@ -4919,7 +4919,7 @@ public static IEnumerable<object[]> StartsWith_StringComparison_TestData()
yield return new object[] { "", "hello", StringComparison.OrdinalIgnoreCase, false };
}

[Theory]
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotHybridGlobalizationOnOSX))]
[MemberData(nameof(StartsWith_StringComparison_TestData))]
public static void StartsWith_StringComparison(string s, string value, StringComparison comparisonType, bool expected)
{
Expand Down Expand Up @@ -5341,7 +5341,7 @@ private static IEnumerable<object[]> ToLower_Culture_TestData()
}
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsIcuGlobalizationAndNotHybrid))]
public static void Test_ToLower_Culture()
{
foreach (object[] testdata in ToLower_Culture_TestData())
Expand Down Expand Up @@ -5856,7 +5856,7 @@ public static IEnumerable<object[]> ToUpper_Culture_TestData()
yield return new object[] { "h\u0131 world", "H\u0131 WORLD", CultureInfo.InvariantCulture };
}

[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))]
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsIcuGlobalizationAndNotHybrid))]
[MemberData(nameof(ToUpper_Culture_TestData))]
public static void Test_ToUpper_Culture(string actual, string expected, CultureInfo culture)
{
Expand Down Expand Up @@ -5955,7 +5955,7 @@ public static IEnumerable<object[]> ToUpper_TurkishI_InvariantCulture_MemberData
new KeyValuePair<char, char>('\u0130', '\u0130'),
new KeyValuePair<char, char>('\u0131', '\u0131'));

[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotInvariantGlobalization))]
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsIcuGlobalizationAndNotHybrid))]
[MemberData(nameof(ToUpper_TurkishI_InvariantCulture_MemberData))]
public static void ToUpper_TurkishI_InvariantCulture(string s, string expected)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public void GetStringComparer_Invalid()
AssertExtensions.Throws<ArgumentException>("options", () => new CultureInfo("tr-TR").CompareInfo.GetStringComparer(CompareOptions.OrdinalIgnoreCase | CompareOptions.IgnoreCase));
}

[Theory]
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotHybridGlobalization))]
[InlineData("hello", "hello", "fr-FR", CompareOptions.IgnoreCase, 0, 0)]
[InlineData("hello", "HELLo", "fr-FR", CompareOptions.IgnoreCase, 0, 0)]
[InlineData("hello", null, "fr-FR", CompareOptions.IgnoreCase, 1, 1)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ private static string RemoveComment(string line)
private static Stream GetIdnaTestTxt()
{
string fileName = null;
if (PlatformDetection.ICUVersion >= new Version(66, 0))
if (PlatformDetection.ICUVersion >= new Version(66, 0) || PlatformDetection.IsHybridGlobalizationOnOSX)
fileName = "IdnaTest_13.txt";
else if (PlatformDetection.IsWindows7)
fileName = "IdnaTest_Win7.txt";
Expand Down Expand Up @@ -61,7 +61,7 @@ private static IEnumerable<IConformanceIdnaTest> ParseFile(Stream stream, Func<s

private static IConformanceIdnaTest GetConformanceIdnaTest(string line, int lineCount)
{
if (PlatformDetection.ICUVersion >= new Version(66, 0))
if (PlatformDetection.ICUVersion >= new Version(66, 0) || PlatformDetection.IsHybridGlobalizationOnOSX)
return new Unicode_13_0_IdnaTest(line, lineCount);
else if (PlatformDetection.IsWindows7)
return new Unicode_Win7_IdnaTest(line, lineCount);
Expand All @@ -88,7 +88,7 @@ public static IEnumerable<IConformanceIdnaTest> GetDataset()
{
// Nls is transitional so we filter out non transitional test cases.
// Icu is the opposite.
IdnType idnFilter = PlatformDetection.IsNlsGlobalization ? IdnType.Nontransitional : IdnType.Transitional;
IdnType idnFilter = PlatformDetection.IsNlsGlobalization || PlatformDetection.IsHybridGlobalizationOnOSX ? IdnType.Nontransitional : IdnType.Transitional;
foreach (var entry in ParseFile(GetIdnaTestTxt(), GetConformanceIdnaTest))
{
if (entry.Type != idnFilter && entry.Source != string.Empty)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public static IEnumerable<object[]> GetAscii_TestData()
}

string ascii = c.ToString();
if (!PlatformDetection.IsIcuGlobalization || c != '-') // expected platform differences, see https://github.com/dotnet/runtime/issues/17190
if ((!PlatformDetection.IsIcuGlobalization && !PlatformDetection.IsHybridGlobalizationOnOSX) || c != '-') // expected platform differences, see https://github.com/dotnet/runtime/issues/17190
{
yield return new object[] { ascii, 0, 1, ascii };
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public void UseStd3AsciiRules_ChangesGetAsciiBehavior(string unicode, bool conta
var idnStd3False = new IdnMapping { UseStd3AsciiRules = false };
var idnStd3True = new IdnMapping { UseStd3AsciiRules = true };

if (containsInvalidHyphen && PlatformDetection.IsIcuGlobalization)
if (containsInvalidHyphen && (PlatformDetection.IsIcuGlobalization || PlatformDetection.IsHybridGlobalizationOnOSX))
{
// ICU always fails on leading/trailing hyphens regardless of the Std3 rules option.
AssertExtensions.Throws<ArgumentException>("unicode", () => idnStd3False.GetAscii(unicode));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public void NativeCalendarName_Get_ReturnsExpected(DateTimeFormatInfo dtfi, Cale
{
dtfi.Calendar = calendar;

if (PlatformDetection.IsNotUsingLimitedCultures)
if (PlatformDetection.IsNotUsingLimitedCultures || PlatformDetection.IsHybridGlobalizationOnOSX)
{
// Mobile / Browser ICU doesn't contain NativeCalendarName,
Assert.Equal(nativeCalendarName, dtfi.NativeCalendarName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ static Settings()
// and PredefinedCulturesOnly is unspecified.
if (!GlobalizationMode.Invariant)
{
#if TARGET_MACCATALYST || TARGET_IOS || TARGET_TVOS
if (GlobalizationMode.Hybrid)
return;
#endif
if (TryGetAppLocalIcuSwitchValue(out string? icuSuffixAndVersion))
{
LoadAppLocalIcu(icuSuffixAndVersion);
Expand Down
2 changes: 1 addition & 1 deletion src/libraries/System.Runtime/tests/System/Attributes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ private static void GenericAttributesTestHelper<TGenericParameter>(Func<Type, At
public static class GetCustomAttribute
{

[Fact]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotHybridGlobalizationOnOSX))]
public static void customAttributeCount()
{
List<CustomAttributeData> customAttributes = typeof(GetCustomAttribute).Module.CustomAttributes.ToList();
Expand Down
4 changes: 2 additions & 2 deletions src/libraries/System.Runtime/tests/System/DateTimeTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2002,7 +2002,7 @@ public static IEnumerable<object[]> Parse_ValidInput_Succeeds_MemberData()
}
}

[Theory]
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotHybridGlobalizationOnOSX))]
[MemberData(nameof(Parse_ValidInput_Succeeds_MemberData))]
public static void Parse_ValidInput_Succeeds(string input, CultureInfo culture, DateTime? expected)
{
Expand Down Expand Up @@ -2462,7 +2462,7 @@ public static IEnumerable<object[]> ToString_MatchesExpected_MemberData()
yield return new object[] { new DateTime(2023, 04, 17, 10, 46, 12, DateTimeKind.Utc), "HH\u202dmm", null, "10\u202d46" };
}

[Theory]
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotHybridGlobalizationOnOSX))]
[MemberData(nameof(Parse_ValidInput_Succeeds_MemberData))]
public static void Parse_Span_ValidInput_Succeeds(string input, CultureInfo culture, DateTime? expected)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public void Create_InvalidArguments_Throws()
AssertExtensions.Throws<ArgumentNullException>("culture", () => StringComparer.Create(null, ignoreCase: true));
}

[Fact]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotHybridGlobalizationOnOSX))]
public void Create_CreatesValidComparer()
{
StringComparer c = StringComparer.Create(CultureInfo.InvariantCulture, ignoreCase: true);
Expand Down Expand Up @@ -117,7 +117,7 @@ public void CreateCultureOptions_InvalidArguments_Throws()
Assert.Throws<ArgumentNullException>(() => StringComparer.Create(null, CompareOptions.None));
}

[Fact]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotHybridGlobalizationOnOSX))]
public void CreateCultureOptions_CreatesValidComparer()
{
StringComparer c = StringComparer.Create(CultureInfo.InvariantCulture, CompareOptions.IgnoreCase);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public static IEnumerable<object[]> GetHashCode_TestData()
() => { return CultureInfo.CurrentCulture.CompareInfo.GetHashCode("abc", CompareOptions.OrdinalIgnoreCase); }
};

[Theory]
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotHybridGlobalizationOnOSX))]
[MemberData(nameof(GetHashCodeOrdinalIgnoreCase_TestData))]
public void GetHashCode_OrdinalIgnoreCase_ReturnsSameHashCodeAsUpperCaseOrdinal(string input)
{
Expand Down
12 changes: 6 additions & 6 deletions src/libraries/System.Runtime/tests/System/StringTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ public static IEnumerable<object[]> Contains_String_StringComparison_TestData()
yield return new object[] { "Hello", "Ell" + SoftHyphen, StringComparison.OrdinalIgnoreCase, false };
}

[Theory]
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotHybridGlobalizationOnOSX))]
[MemberData(nameof(Contains_String_StringComparison_TestData))]
public static void Contains_String_StringComparison(string s, string value, StringComparison comparisonType, bool expected)
{
Expand Down Expand Up @@ -775,7 +775,7 @@ public static IEnumerable<object[]> Replace_StringComparison_TestData()
yield return new object[] { "", "\0", "y", StringComparison.InvariantCulture, "" };
}

[Theory]
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotHybridGlobalizationOnOSX))]
[MemberData(nameof(Replace_StringComparison_TestData))]
public void Replace_StringComparison_ReturnsExpected(string original, string oldValue, string newValue, StringComparison comparisonType, string expected)
{
Expand Down Expand Up @@ -841,7 +841,7 @@ public static IEnumerable<object[]> Replace_StringComparisonCulture_TestData()
}
}

[Theory]
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotHybridGlobalizationOnOSX))]
[MemberData(nameof(Replace_StringComparisonCulture_TestData))]
public void Replace_StringComparisonCulture_ReturnsExpected(string original, string oldValue, string newValue, bool ignoreCase, CultureInfo culture, string expected)
{
Expand Down Expand Up @@ -906,7 +906,7 @@ public static void GetHashCode_OfSpan_MatchesOfString()
Assert.NotEqual("abc".GetHashCode(), string.GetHashCode("ABC".AsSpan())); // case differences
}

[Fact]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotHybridGlobalizationOnOSX))]
public static void GetHashCode_CompareInfo()
{
// ordinal
Expand All @@ -926,7 +926,7 @@ public static void GetHashCode_CompareInfo()
Assert.Equal("aeiXXabc".GetHashCode(StringComparison.InvariantCultureIgnoreCase), CultureInfo.InvariantCulture.CompareInfo.GetHashCode("aeiXXabc", CompareOptions.IgnoreCase));
}

[Fact]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotHybridGlobalizationOnOSX))]
public static void GetHashCode_CompareInfo_OfSpan()
{
// ordinal
Expand All @@ -948,7 +948,7 @@ public static void GetHashCode_CompareInfo_OfSpan()

public static IEnumerable<object[]> GetHashCode_StringComparison_Data => StringComparisons.Select(value => new object[] { value });

[Theory]
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsNotHybridGlobalizationOnOSX))]
[MemberData(nameof(GetHashCode_StringComparison_Data))]
public static void GetHashCode_StringComparison(StringComparison comparisonType)
{
Expand Down
3 changes: 1 addition & 2 deletions src/mono/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -746,10 +746,9 @@ elseif(HOST_BROWSER)
set(STATIC_ICU 1)
set(ICU_LIBS "icucore")
elseif(HOST_IOS OR HOST_TVOS OR HOST_MACCAT)
set(ICU_FLAGS "-DTARGET_UNIX -DU_DISABLE_RENAMING -Wno-reserved-id-macro -Wno-documentation -Wno-documentation-unknown-command -Wno-switch-enum -Wno-covered-switch-default -Wno-extra-semi-stmt -Wno-unknown-warning-option -Wno-deprecated-declarations")
set(ICU_FLAGS "-DTARGET_UNIX -DTARGET_IOS -DTARGET_TVOS -DTARGET_MACCATALYST -DU_DISABLE_RENAMING -Wno-reserved-id-macro -Wno-documentation -Wno-documentation-unknown-command -Wno-switch-enum -Wno-covered-switch-default -Wno-extra-semi-stmt -Wno-unknown-warning-option -Wno-deprecated-declarations")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it ok if we pass -DTARGET_IOS -DTARGET_TVOS -DTARGET_MACCATALYST unconditionally? I'd have expected we only pass on the respective platform

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated, thanks.

set(HAVE_SYS_ICU 1)
set(STATIC_ICU 1)
set(ICU_LIBS icuuc icui18n icudata)
elseif(HOST_ANDROID)
set(ICU_FLAGS "-DPALEXPORT=\"\" -DHAVE_UDAT_STANDALONE_SHORTER_WEEKDAYS -DHAVE_SET_MAX_VARIABLE -DTARGET_UNIX -DTARGET_ANDROID -Wno-reserved-id-macro -Wno-documentation -Wno-documentation-unknown-command -Wno-switch-enum -Wno-covered-switch-default -Wno-covered-switch-default -Wno-extra-semi-stmt -Wno-unknown-warning-option")
set(HAVE_SYS_ICU 1)
Expand Down
6 changes: 5 additions & 1 deletion src/mono/mono.proj
Original file line number Diff line number Diff line change
Expand Up @@ -469,9 +469,11 @@
<_MonoCMakeVersionMin Condition="'$(TargetsiOS)' == 'true'">$(iOSVersionMin)</_MonoCMakeVersionMin>
<_MonoCMakeVersionMin Condition="'$(TargetstvOS)' == 'true'">$(tvOSVersionMin)</_MonoCMakeVersionMin>
</PropertyGroup>
<!--
<PropertyGroup Condition="'$(TargetsiOS)' == 'true' or '$(TargetstvOS)' == 'true' or '$(TargetsMacCatalyst)' == 'true'">
<_IcuLibdir>$(PkgMicrosoft_NETCore_Runtime_ICU_Transport)/runtimes/$(TargetOS)-$(TargetArchitecture)/native/lib</_IcuLibdir>
</PropertyGroup>
-->
<ItemGroup Condition="'$(TargetsiOS)' == 'true' or '$(TargetstvOS)' == 'true'">
<_MonoCMakeArgs Include="-DCMAKE_SYSTEM_NAME=$(_MonoCMakeSystemName)"/>
<_MonoCMakeArgs Include="-DCMAKE_OSX_DEPLOYMENT_TARGET=$(_MonoCMakeVersionMin)" />
Expand All @@ -486,9 +488,11 @@
<_MonoCMakeArgs Condition="'$(Platform)' == 'arm'" Include="&quot;-DCMAKE_OSX_ARCHITECTURES=armv7%3Barmv7s&quot;" />
</ItemGroup>
<ItemGroup Condition="'$(TargetsiOS)' == 'true' or '$(TargetstvOS)' == 'true' or '$(TargetsMacCatalyst)' == 'true'">
<_MonoCMakeArgs Include="-DICU_LIBDIR=$(_IcuLibdir)"/>
<_MonoCMakeArgs Include="-DENABLE_ICALL_EXPORT=1"/>
<!--
<_MonoCMakeArgs Include="-DICU_LIBDIR=$(_IcuLibdir)"/>
<_MonoCFLAGS Include="-I$(PkgMicrosoft_NETCore_Runtime_ICU_Transport)/runtimes/$(TargetOS)-$(TargetArchitecture)/native/include" />
-->
</ItemGroup>
<!-- iOS/tvOS simulator specific options -->
<ItemGroup Condition="('$(TargetsiOS)' == 'true' and '$(TargetsiOSSimulator)' == 'true') or ('$(TargetstvOS)' == 'true' and '$(TargetstvOSSimulator)' == 'true')">
Expand Down
Loading
Loading