-
Notifications
You must be signed in to change notification settings - Fork 5.5k
[browser] More Wasm.Build.Tests on CoreCLR #127281
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
Changes from 10 commits
8debc4a
65e6237
1fa4950
123b863
5250927
14cace4
e17204d
1eb48af
418cd2b
827800e
532e645
7509361
a7b3362
905c755
9d4e5ce
34f2aa2
c0b0e63
51b99d0
0388696
45afe55
bef4e8b
37cdc06
8910706
0eb727a
e51a126
a12e506
8a3a3b0
b730bfc
f6e4327
392a9ee
2ec813f
70bf73d
b4a93e8
5cc2e7b
3c86968
f724f75
683b4cd
51b37e5
4140758
5b3f18f
b2d2001
f3f030c
8092e25
01ed2f0
669125e
4f1b82a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| // Auto-included CoreCLR compat header for app native build. | ||
| // | ||
| // This header is pre-included via -include when compiling pinvoke-table.cpp | ||
|
Comment on lines
+1
to
+3
|
||
| // and wasm_m2n_invoke.g.cpp produced by ManagedToNativeGenerator, so those | ||
| // files can be compiled outside the full CoreCLR build context (e.g. in | ||
|
|
||
| // Wasm.Build.Tests on Helix where src/coreclr/vm/wasm/callhelpers.hpp and | ||
| // src/native/minipal headers are not part of the payload). | ||
| // | ||
| // Definitions for the symbols declared here live in libcoreclr_static.a (which | ||
| // is linked in later) or in the same generated .cpp (e.g. g_wasmThunks / | ||
| // g_ReverseThunks tables are emitted by the generator itself). | ||
|
|
||
| #pragma once | ||
|
|
||
| #include <stddef.h> | ||
| #include <stdint.h> | ||
| #include <stdlib.h> | ||
| #include <stdio.h> | ||
| #include <string.h> | ||
|
|
||
| // CoreCLR type stubs | ||
| #ifndef _CORECLR_COMPAT_TYPES | ||
| #define _CORECLR_COMPAT_TYPES | ||
| typedef void MethodDesc; | ||
| typedef uintptr_t PCODE; | ||
| typedef uint32_t ULONG; | ||
| #define INTERP_STACK_SLOT_SIZE 8u | ||
| #endif | ||
|
||
|
|
||
| // CoreCLR logging stubs | ||
| #define LF_INTEROP 0 | ||
| #define LL_INFO1000 0 | ||
| #define LOG(x) | ||
|
|
||
| // CoreCLR assertion stub | ||
| #define PORTABILITY_ASSERT(msg) do { fprintf(stderr, "PORTABILITY_ASSERT: %s\n", msg); abort(); } while(0) | ||
|
|
||
| // Mirrors of declarations from src/coreclr/vm/wasm/callhelpers.hpp. | ||
| #define TERMINATE_R2R_STACK_WALK 1 | ||
| struct StringToWasmSigThunk { const char* key; void* value; }; | ||
| extern const StringToWasmSigThunk g_wasmThunks[]; | ||
| extern const size_t g_wasmThunksCount; | ||
| struct ReverseThunkMapValue { MethodDesc** Target; void* EntryPoint; }; | ||
| struct ReverseThunkMapEntry { ULONG hashCode; const char* Source; ReverseThunkMapValue value; }; | ||
| extern const ReverseThunkMapEntry g_ReverseThunks[]; | ||
| extern const size_t g_ReverseThunksCount; | ||
|
|
||
| // Mirrors of declarations from src/native/minipal/entrypoints.h, used by | ||
| // pinvoke-table.cpp. Marked static inline (rather than the upstream 'static') | ||
| // so cpp files that #include this compat header but don't call the helper | ||
| // don't trigger -Wunused-function. | ||
| typedef struct { const char* name; const void* method; } Entry; | ||
| #define DllImportEntry(impl) {#impl, (void*)&impl}, | ||
| static inline const void* minipal_resolve_dllimport(const Entry* resolutionTable, size_t tableLength, const char* name) | ||
| { | ||
| for (size_t i = 0; i < tableLength; i++) | ||
| { | ||
| if (strcmp(name, resolutionTable[i].name) == 0) | ||
| return resolutionTable[i].method; | ||
| } | ||
| return NULL; | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -41,13 +41,13 @@ from locale in locales | |
|
|
||
| [Theory] | ||
| [MemberData(nameof(IcuExpectedAndMissingCustomShardTestData), parameters: new object[] { Configuration.Release })] | ||
| [TestCategory("native")] | ||
| [TestCategory("native-coreclr")] | ||
| public async Task CustomIcuShard(Configuration config, bool aot, string customIcuPath, string customLocales, bool onlyPredefinedCultures) => | ||
|
Comment on lines
42
to
45
|
||
| await TestIcuShards(config, Template.WasmBrowser, aot, customIcuPath, customLocales, GlobalizationMode.Custom, onlyPredefinedCultures); | ||
|
|
||
| [Theory] | ||
| [MemberData(nameof(IcuExpectedAndMissingAutomaticShardTestData), parameters: new object[] { Configuration.Release })] | ||
| [TestCategory("native")] | ||
| [TestCategory("native-coreclr")] | ||
| public async Task AutomaticShardSelectionDependingOnEnvLocale(Configuration config, bool aot, string environmentLocale, string testedLocales) => | ||
| await PublishAndRunIcuTest(config, Template.WasmBrowser, aot, testedLocales, GlobalizationMode.Sharded, locale: environmentLocale); | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -38,7 +38,7 @@ from locale in locales | |
|
|
||
| [Theory] | ||
| [MemberData(nameof(IcuExpectedAndMissingShardFromRuntimePackTestData), parameters: new object[] { Configuration.Release })] | ||
| [TestCategory("native")] | ||
| [TestCategory("native-coreclr")] | ||
| public async Task DefaultAvailableIcuShardsFromRuntimePack(Configuration config, bool aot, string shardName, string testedLocales) => | ||
|
Comment on lines
39
to
42
|
||
| await TestIcuShards(config, Template.WasmBrowser, aot, shardName, testedLocales, GlobalizationMode.Custom); | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -53,7 +53,7 @@ public static IEnumerable<object[]> IncorrectIcuTestData(Configuration config) | |
|
|
||
| [Theory] | ||
| [MemberData(nameof(FullIcuWithInvariantTestData), parameters: new object[] { Configuration.Release })] | ||
| [TestCategory("native")] | ||
| [TestCategory("native-coreclr")] | ||
| public async Task FullIcuFromRuntimePackWithInvariant(Configuration config=Configuration.Release, bool aot=false, bool invariant=true, bool fullIcu=true, string testedLocales="Array.Empty<Locale>()") => | ||
|
Comment on lines
54
to
57
|
||
| await PublishAndRunIcuTest( | ||
| config, | ||
|
|
@@ -67,7 +67,7 @@ await PublishAndRunIcuTest( | |
|
|
||
| [Theory] | ||
| [MemberData(nameof(FullIcuWithICustomIcuTestData), parameters: new object[] { Configuration.Release })] | ||
| [TestCategory("native")] | ||
| [TestCategory("native-coreclr")] | ||
|
Comment on lines
56
to
+70
|
||
| public async Task FullIcuFromRuntimePackWithCustomIcu(Configuration config, bool aot, bool fullIcu) | ||
| { | ||
| string customIcuProperty = "BlazorIcuDataFileName"; | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -131,7 +131,11 @@ protected ProjectInfo CreateIcuProject( | |||||||||||||||
| File.WriteAllText(programPath, programText); | ||||||||||||||||
| _testOutput.WriteLine($"----- Program: -----{Environment.NewLine}{programText}{Environment.NewLine}-------"); | ||||||||||||||||
|
|
||||||||||||||||
| UpdateBrowserMainJs(); | ||||||||||||||||
| // The template main.js calls JS interop APIs (setModuleImports, getAssemblyExports) | ||||||||||||||||
| // which the ICU test program does not use. Replace it with a minimal version tailored | ||||||||||||||||
| // for ICU tests, otherwise the JS interop assembly would be linked away by the trimmer. | ||||||||||||||||
|
Comment on lines
+134
to
+136
|
||||||||||||||||
| // The template main.js calls JS interop APIs (setModuleImports, getAssemblyExports) | |
| // which the ICU test program does not use. Replace it with a minimal version tailored | |
| // for ICU tests, otherwise the JS interop assembly would be linked away by the trimmer. | |
| // The template main.js calls JS interop APIs (setModuleImports, getAssemblyExports), | |
| // but the ICU test program does not reference the managed JS interop pieces. Trimming | |
| // can therefore remove them, and the default main.js would then fail at runtime, so | |
| // replace it with a minimal version tailored for ICU tests that avoids those APIs. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,7 +13,7 @@ | |
|
|
||
| namespace Wasm.Build.Tests; | ||
|
|
||
| [TestCategory("native")] | ||
| [TestCategory("native-coreclr")] | ||
| public class MemoryTests : WasmTemplateTestsBase | ||
|
Comment on lines
+16
to
17
|
||
| { | ||
|
Comment on lines
+16
to
18
|
||
| public MemoryTests(ITestOutputHelper output, SharedBuildPerTestClassFixture buildContext) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR description says additional
TestCategory("native")classes likeIcuTestsare "not in scope" and left for follow-up, but this change addsIcu*,InvariantGlobalizationTests, andMemoryTeststo the CoreCLR job list. Either update the PR description to reflect the expanded scope or remove these additions to match the stated intent.