-
Notifications
You must be signed in to change notification settings - Fork 5.4k
[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
base: main
Are you sure you want to change the base?
Changes from all commits
8debc4a
65e6237
1fa4950
123b863
5250927
14cace4
e17204d
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 |
|---|---|---|
|
|
@@ -271,10 +271,11 @@ | |
| <_EmccCFlags Include="-DGEN_PINVOKE=1" /> | ||
| <_EmccCFlags Include="$(EmccExtraCFlags)" /> | ||
|
|
||
| <!-- Include paths for ManagedToNativeGenerator output compilation --> | ||
| <_EmccCFlags Include="-I"$(RepoRoot)src/coreclr/vm/wasm"" Condition="Exists('$(RepoRoot)src/coreclr/vm/wasm/callhelpers.hpp')" /> | ||
| <_EmccCFlags Include="-I"$(RepoRoot)src/native"" Condition="Exists('$(RepoRoot)src/native/minipal/entrypoints.h')" /> | ||
| <_EmccCFlags Include="-include "$(_WasmIntermediateOutputPath)coreclr_compat.h"" /> | ||
| <!-- All declarations needed by ManagedToNativeGenerator output (pinvoke-table.cpp, | ||
| wasm_m2n_invoke.g.cpp) are provided by coreclr_compat.h, which ships next to this | ||
| targets file. This avoids relying on the in-repo coreclr/vm/wasm and | ||
| native/minipal headers, which are not present in the WBT Helix payload. --> | ||
| <_EmccCFlags Include="-include "$(MSBuildThisFileDirectory)coreclr_compat.h"" /> | ||
|
Comment on lines
+274
to
+278
|
||
| </ItemGroup> | ||
|
|
||
| <!-- Source files: user NativeFileReference sources --> | ||
|
|
@@ -283,7 +284,7 @@ | |
| <_WasmSourceFileToCompile Include="@(NativeFileReference)" Condition="'%(Extension)' == '.c' or '%(Extension)' == '.cpp'" /> | ||
| <_WasmSourceFileToCompile ObjectFile="$(_WasmIntermediateOutputPath)%(FileName).o" /> | ||
| <!-- Add compile RSP and compat header as dependencies for incremental build --> | ||
| <_WasmSourceFileToCompile Dependencies="$(_WasmCompileRsp);$(_WasmIntermediateOutputPath)coreclr_compat.h" /> | ||
| <_WasmSourceFileToCompile Dependencies="$(_WasmCompileRsp);$(MSBuildThisFileDirectory)coreclr_compat.h" /> | ||
| </ItemGroup> | ||
|
|
||
| <!-- Native .a files to link: any NativeFileReference that are archives --> | ||
|
|
@@ -362,39 +363,6 @@ | |
| <!-- ======================== Write Compile RSP ======================== --> | ||
|
|
||
| <Target Name="_CoreCLRWriteCompileRsp" Condition="@(_WasmSourceFileToCompile->Count()) > 0"> | ||
| <!-- Generate a compatibility header with type/macro stubs for compiling | ||
| ManagedToNativeGenerator output outside the full CoreCLR build context --> | ||
| <PropertyGroup> | ||
| <_WasmCoreclrCompatHeader>$(_WasmIntermediateOutputPath)coreclr_compat.h</_WasmCoreclrCompatHeader> | ||
| </PropertyGroup> | ||
| <ItemGroup> | ||
| <_CompatHeaderLines Include="// Auto-generated CoreCLR compat header for app native build" /> | ||
| <_CompatHeaderLines Include="#pragma once" /> | ||
| <_CompatHeaderLines Include="#include <stddef.h>" /> | ||
| <_CompatHeaderLines Include="#include <stdint.h>" /> | ||
| <_CompatHeaderLines Include="#include <stdlib.h>" /> | ||
| <_CompatHeaderLines Include="#include <stdio.h>" /> | ||
| <_CompatHeaderLines Include="// CoreCLR type stubs" /> | ||
| <_CompatHeaderLines Include="#ifndef _CORECLR_COMPAT_TYPES" /> | ||
| <_CompatHeaderLines Include="#define _CORECLR_COMPAT_TYPES" /> | ||
| <_CompatHeaderLines Include="typedef void MethodDesc%3B" /> | ||
| <_CompatHeaderLines Include="typedef uintptr_t PCODE%3B" /> | ||
| <_CompatHeaderLines Include="typedef uint32_t ULONG%3B" /> | ||
| <_CompatHeaderLines Include="#define INTERP_STACK_SLOT_SIZE 8u" /> | ||
| <_CompatHeaderLines Include="#endif" /> | ||
| <_CompatHeaderLines Include="// CoreCLR logging stubs" /> | ||
| <_CompatHeaderLines Include="#define LF_INTEROP 0" /> | ||
| <_CompatHeaderLines Include="#define LL_INFO1000 0" /> | ||
| <_CompatHeaderLines Include="#define LOG(x)" /> | ||
| <_CompatHeaderLines Include="// CoreCLR assertion stubs" /> | ||
| <_CompatHeaderLines Include="#define PORTABILITY_ASSERT(msg) do { fprintf(stderr, "PORTABILITY_ASSERT: %25s", msg)%3B fprintf(stderr, "\n")%3B abort()%3B } while(0)" /> | ||
| </ItemGroup> | ||
|
|
||
| <WriteLinesToFile Lines="@(_CompatHeaderLines)" File="$(_WasmCoreclrCompatHeader)" Overwrite="true" WriteOnlyWhenDifferent="true" /> | ||
| <ItemGroup> | ||
| <FileWrites Include="$(_WasmCoreclrCompatHeader)" /> | ||
| </ItemGroup> | ||
|
|
||
| <ItemGroup> | ||
| <_WasmCFlags Include="@(_EmccCFlags)" /> | ||
| </ItemGroup> | ||
|
|
||
| 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 | ||
| // 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 | ||
|
Comment on lines
+21
to
+28
|
||
|
|
||
| // 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")] | ||
| public async Task FullIcuFromRuntimePackWithCustomIcu(Configuration config, bool aot, bool fullIcu) | ||
| { | ||
| string customIcuProperty = "BlazorIcuDataFileName"; | ||
|
|
||
| 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
|
||
| { | ||
| 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.