Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 9 additions & 0 deletions eng/testing/scenarios/BuildWasmAppsJobsListCoreCLR.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,12 @@ Wasm.Build.Tests.WasmRunOutOfAppBundleTests
Wasm.Build.Tests.WasmTemplateTests
Wasm.Build.Tests.MaxParallelDownloadsTests
Wasm.Build.Tests.LibraryInitializerTests
Wasm.Build.Tests.NativeBuildTests
Wasm.Build.Tests.DllImportTests
Wasm.Build.Tests.PInvokeTableGeneratorTests
Wasm.Build.Tests.NativeLibraryTests
Wasm.Build.Tests.IcuShardingTests
Wasm.Build.Tests.IcuShardingTests2
Wasm.Build.Tests.IcuTests
Wasm.Build.Tests.InvariantGlobalizationTests
Wasm.Build.Tests.MemoryTests
Comment on lines +19 to +23
Copy link

Copilot AI Apr 24, 2026

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 like IcuTests are "not in scope" and left for follow-up, but this change adds Icu*, InvariantGlobalizationTests, and MemoryTests to the CoreCLR job list. Either update the PR description to reflect the expanded scope or remove these additions to match the stated intent.

Copilot uses AI. Check for mistakes.
44 changes: 6 additions & 38 deletions src/mono/browser/build/BrowserWasmApp.CoreCLR.targets
Original file line number Diff line number Diff line change
Expand Up @@ -271,10 +271,11 @@
<_EmccCFlags Include="-DGEN_PINVOKE=1" />
<_EmccCFlags Include="$(EmccExtraCFlags)" />

<!-- Include paths for ManagedToNativeGenerator output compilation -->
<_EmccCFlags Include="-I&quot;$(RepoRoot)src/coreclr/vm/wasm&quot;" Condition="Exists('$(RepoRoot)src/coreclr/vm/wasm/callhelpers.hpp')" />
<_EmccCFlags Include="-I&quot;$(RepoRoot)src/native&quot;" Condition="Exists('$(RepoRoot)src/native/minipal/entrypoints.h')" />
<_EmccCFlags Include="-include &quot;$(_WasmIntermediateOutputPath)coreclr_compat.h&quot;" />
<!-- 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 &quot;$(MSBuildThisFileDirectory)coreclr_compat.h&quot;" />
Comment on lines +274 to +278
Copy link

Copilot AI Apr 27, 2026

Choose a reason for hiding this comment

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

_CoreCLRGenerateManagedToNative still adds Dependencies="$(_WasmCompileRsp);$(_WasmIntermediateOutputPath)coreclr_compat.h" for the generated pinvoke/interp sources later in the file, but this PR removes the intermediate coreclr_compat.h generation and switches to $(MSBuildThisFileDirectory)coreclr_compat.h. Update those remaining Dependencies values to match the new header location (or drop the dependency) to keep incremental builds correct.

Copilot uses AI. Check for mistakes.
</ItemGroup>

<!-- Source files: user NativeFileReference sources -->
Expand All @@ -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 -->
Expand Down Expand Up @@ -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 &lt;stddef.h&gt;" />
<_CompatHeaderLines Include="#include &lt;stdint.h&gt;" />
<_CompatHeaderLines Include="#include &lt;stdlib.h&gt;" />
<_CompatHeaderLines Include="#include &lt;stdio.h&gt;" />
<_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, &quot;PORTABILITY_ASSERT: %25s&quot;, msg)%3B fprintf(stderr, &quot;\n&quot;)%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>
Expand Down
62 changes: 62 additions & 0 deletions src/mono/browser/build/coreclr_compat.h
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
Copy link

Copilot AI Apr 27, 2026

Choose a reason for hiding this comment

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

coreclr_compat.h is intended to replace <minipal/utils.h>, but it doesn’t currently define NOINLINE. The generated wasm_m2n_invoke.g.cpp uses NOINLINE for portable-entrypoint thunks, so compilation will fail unless this macro is provided (or the generator includes the proper header again).

Copilot uses AI. Check for mistakes.

// 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;
}
18 changes: 13 additions & 5 deletions src/mono/wasm/Wasm.Build.Tests/Common/BuildEnvironment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,19 @@ public string GetRuntimePackVersion(string tfm)
: throw new ArgumentException($"No runtime pack version found for tfm={tfm} .");

public string GetRuntimePackDir(string tfm, RuntimeVariant runtimeType = RuntimeVariant.SingleThreaded)
=> Path.Combine(WorkloadPacksDir,
runtimeType is RuntimeVariant.SingleThreaded
? $"Microsoft.NETCore.App.Runtime.Mono.{DefaultRuntimeIdentifier}"
: $"Microsoft.NETCore.App.Runtime.Mono.multithread.{DefaultRuntimeIdentifier}",
GetRuntimePackVersion(tfm));
=> Path.Combine(WorkloadPacksDir, GetRuntimePackName(runtimeType), GetRuntimePackVersion(tfm));

private string GetRuntimePackName(RuntimeVariant runtimeType)
{
// CoreCLR ships browser-wasm via Microsoft.NETCore.App.Runtime.{rid} (no flavor segment).
// Mono uses Microsoft.NETCore.App.Runtime.Mono.{rid}, with a separate .multithread. variant.
if (IsCoreClrRuntime)
return $"Microsoft.NETCore.App.Runtime.{DefaultRuntimeIdentifier}";

return runtimeType is RuntimeVariant.SingleThreaded
? $"Microsoft.NETCore.App.Runtime.Mono.{DefaultRuntimeIdentifier}"
: $"Microsoft.NETCore.App.Runtime.Mono.multithread.{DefaultRuntimeIdentifier}";
}
public string GetRuntimeNativeDir(string tfm, RuntimeVariant runtimeType = RuntimeVariant.SingleThreaded)
=> Path.Combine(GetRuntimePackDir(tfm, runtimeType), "runtimes", DefaultRuntimeIdentifier, "native");
public bool IsMultiThreadingRuntimePackAvailableFor(string tfm)
Expand Down
4 changes: 3 additions & 1 deletion src/mono/wasm/Wasm.Build.Tests/DllImportTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

namespace Wasm.Build.Tests
{
[TestCategory("native")]
public class DllImportTests : PInvokeTableGeneratorTestsBase
{
public DllImportTests(ITestOutputHelper output, SharedBuildPerTestClassFixture buildContext)
Expand All @@ -24,6 +23,9 @@ public DllImportTests(ITestOutputHelper output, SharedBuildPerTestClassFixture b

[Theory]
[BuildAndRun(aot: false)]
// The "warning ... native function ... varargs" check is emitted by Mono's PInvokeTableGenerator.
// CoreCLR's PInvokeTableGenerator does not emit that warning, so this test is Mono-only.
[TestCategory("mono")]
public async Task NativeLibraryWithVariadicFunctions(Configuration config, bool aot)
{
ProjectInfo info = PrepareProjectForVariadicFunction(config, aot, "variadic");
Expand Down
4 changes: 2 additions & 2 deletions src/mono/wasm/Wasm.Build.Tests/IcuShardingTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link

Copilot AI Apr 24, 2026

Choose a reason for hiding this comment

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

These tests use boolOptions for the aot parameter (so they generate AOT and non-AOT variants). Retagging them to native-coreclr will cause the AOT variants to run on the CoreCLR lane (since only category=native is excluded), which is likely unsupported for CoreCLR (UseMonoRuntime=false). Split/tag AOT variants as category=native (excluded on CoreCLR) or filter aot=true out for CoreCLR runs.

Copilot uses AI. Check for mistakes.
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);
}
2 changes: 1 addition & 1 deletion src/mono/wasm/Wasm.Build.Tests/IcuShardingTests2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link

Copilot AI Apr 24, 2026

Choose a reason for hiding this comment

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

This theory generates both aot=false and aot=true cases via boolOptions. After changing the category to native-coreclr, the AOT variants will no longer be excluded by the CoreCLR trait filter (-notrait category=native) and may run on CoreCLR where AOT is likely unsupported. Consider splitting/tagging AOT variants as category=native (excluded) or changing the data source to omit aot=true on CoreCLR.

Copilot uses AI. Check for mistakes.
await TestIcuShards(config, Template.WasmBrowser, aot, shardName, testedLocales, GlobalizationMode.Custom);
}
4 changes: 2 additions & 2 deletions src/mono/wasm/Wasm.Build.Tests/IcuTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link

Copilot AI Apr 24, 2026

Choose a reason for hiding this comment

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

Changing these theories to TestCategory("native-coreclr") makes them eligible to run under the CoreCLR lane filter (which only excludes category=native). However, the test data includes aot=true cases (boolOptions), and CoreCLR builds set <UseMonoRuntime>false</UseMonoRuntime>; AOT compilation is likely unsupported and will attempt to run anyway. Consider splitting into non-AOT methods (tagged native-coreclr) and AOT methods (keep category=native so they remain excluded on CoreCLR), or adjust the MemberData to exclude aot=true when BuildTestBase.IsCoreClrRuntime.

Copilot uses AI. Check for mistakes.
await PublishAndRunIcuTest(
config,
Expand All @@ -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";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public async Task AOT_InvariantGlobalization(Configuration config, bool aot, boo
// TODO: What else should we use to verify a relinked build?
[Theory]
[MemberData(nameof(InvariantGlobalizationTestData), parameters: new object[] { /*aot*/ false })]
[TestCategory("native")]
[TestCategory("native-coreclr")]
public async Task RelinkingWithoutAOT(Configuration config, bool aot, bool? invariantGlobalization)
=> await TestInvariantGlobalization(config, aot, invariantGlobalization, isNativeBuild: true);

Expand Down
2 changes: 1 addition & 1 deletion src/mono/wasm/Wasm.Build.Tests/MemoryTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

namespace Wasm.Build.Tests;

[TestCategory("native")]
[TestCategory("native-coreclr")]
public class MemoryTests : WasmTemplateTestsBase
Comment on lines +16 to 17
Copy link

Copilot AI Apr 24, 2026

Choose a reason for hiding this comment

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

With the class retagged to native-coreclr, this test will start running in the CoreCLR lane. The build assertion currently uses ExpectSuccess: BuildTestBase.IsUsingWorkloads, but CoreCLR WBT runs with TestUsingWorkloads=false while native relink is now supported (emsdk is provisioned separately). That combination likely makes the test fail (it will expect the native build to fail even if it succeeds). Consider basing ExpectSuccess/execution on whether native builds are actually available (e.g., IsUsingWorkloads || IsCoreClrRuntime), or keep the test excluded until its expectations are updated.

Copilot uses AI. Check for mistakes.
{
public MemoryTests(ITestOutputHelper output, SharedBuildPerTestClassFixture buildContext)
Expand Down
4 changes: 3 additions & 1 deletion src/mono/wasm/Wasm.Build.Tests/NativeBuildTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

namespace Wasm.Build.Tests
{
[TestCategory("native")]
public class NativeBuildTests : WasmTemplateTestsBase
{
Comment thread
maraf marked this conversation as resolved.
public NativeBuildTests(ITestOutputHelper output, SharedBuildPerTestClassFixture buildContext)
Expand Down Expand Up @@ -41,6 +40,7 @@ public async Task SimpleNativeBuild(Configuration config, bool aot)

[Theory]
[BuildAndRun(aot: true)]
[TestCategory("native")]
public void AOTNotSupportedWithNoTrimming(Configuration config, bool aot)
{
ProjectInfo info = CreateWasmTemplateProject(
Expand All @@ -59,6 +59,7 @@ public void AOTNotSupportedWithNoTrimming(Configuration config, bool aot)

[Theory]
[BuildAndRun(config: Configuration.Release, aot: true)]
[TestCategory("native")]
public void IntermediateBitcodeToObjectFilesAreNotLLVMIR(Configuration config, bool aot)
{
string printFileTypeTarget = @"
Expand Down Expand Up @@ -91,6 +92,7 @@ public void IntermediateBitcodeToObjectFilesAreNotLLVMIR(Configuration config, b

[Theory]
[BuildAndRun(config: Configuration.Release, aot: true)]
[TestCategory("native")]
public void NativeBuildIsRequired(Configuration config, bool aot)
{
ProjectInfo info = CreateWasmTemplateProject(
Expand Down
42 changes: 37 additions & 5 deletions src/mono/wasm/Wasm.Build.Tests/NativeLibraryTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

namespace Wasm.Build.Tests
{
[TestCategory("native")]
public class NativeLibraryTests : WasmTemplateTestsBase
{
public NativeLibraryTests(ITestOutputHelper output, SharedBuildPerTestClassFixture buildContext)
Expand All @@ -21,8 +20,16 @@ public NativeLibraryTests(ITestOutputHelper output, SharedBuildPerTestClassFixtu

[Theory]
[BuildAndRun(aot: false)]
public Task ProjectWithNativeReference(Configuration config, bool aot) =>
ProjectWithNativeReferenceCore(config, aot);

[Theory]
[BuildAndRun(config: Configuration.Release, aot: true)]
public async Task ProjectWithNativeReference(Configuration config, bool aot)
[TestCategory("native")]
public Task ProjectWithNativeReference_AOT(Configuration config, bool aot) =>
ProjectWithNativeReferenceCore(config, aot);

private async Task ProjectWithNativeReferenceCore(Configuration config, bool aot)
{
string objectFilename = "native-lib.o";
string extraItems = $"<NativeFileReference Include=\"{objectFilename}\" />";
Expand All @@ -42,9 +49,18 @@ public async Task ProjectWithNativeReference(Configuration config, bool aot)

[Theory]
[BuildAndRun(aot: false)]
[ActiveIssue("https://github.com/dotnet/runtime/issues/103566")]
public Task ProjectUsingSkiaSharp(Configuration config, bool aot) =>
ProjectUsingSkiaSharpCore(config, aot);

[Theory]
[BuildAndRun(config: Configuration.Release, aot: true)]
[TestCategory("native")]
[ActiveIssue("https://github.com/dotnet/runtime/issues/103566")]
public async Task ProjectUsingSkiaSharp(Configuration config, bool aot)
public Task ProjectUsingSkiaSharp_AOT(Configuration config, bool aot) =>
ProjectUsingSkiaSharpCore(config, aot);

private async Task ProjectUsingSkiaSharpCore(Configuration config, bool aot)
{
string prefix = $"AppUsingSkiaSharp";
string extraItems = @$"
Expand All @@ -62,8 +78,16 @@ public async Task ProjectUsingSkiaSharp(Configuration config, bool aot)

[Theory]
[BuildAndRun(aot: false)]
public Task ProjectUsingBrowserNativeCrypto(Configuration config, bool aot) =>
ProjectUsingBrowserNativeCryptoCore(config, aot);

[Theory]
[BuildAndRun(config: Configuration.Release, aot: true)]
public async Task ProjectUsingBrowserNativeCrypto(Configuration config, bool aot)
[TestCategory("native")]
public Task ProjectUsingBrowserNativeCrypto_AOT(Configuration config, bool aot) =>
ProjectUsingBrowserNativeCryptoCore(config, aot);

private async Task ProjectUsingBrowserNativeCryptoCore(Configuration config, bool aot)
{
ProjectInfo info = CopyTestAsset(config, aot, TestAsset.WasmBasicTestApp, "AppUsingBrowserNativeCrypto");
ReplaceFile(Path.Combine("Common", "Program.cs"), Path.Combine(BuildEnvironment.TestAssetsPath, "EntryPoints", "NativeCrypto.cs"));
Expand All @@ -80,8 +104,16 @@ public async Task ProjectUsingBrowserNativeCrypto(Configuration config, bool aot

[Theory]
[BuildAndRun(aot: false)]
public Task ProjectWithNativeLibrary(Configuration config, bool aot) =>
ProjectWithNativeLibraryCore(config, aot);

[Theory]
[BuildAndRun(config: Configuration.Release, aot: true)]
public async Task ProjectWithNativeLibrary(Configuration config, bool aot)
[TestCategory("native")]
public Task ProjectWithNativeLibrary_AOT(Configuration config, bool aot) =>
ProjectWithNativeLibraryCore(config, aot);

private async Task ProjectWithNativeLibraryCore(Configuration config, bool aot)
{
string extraItems = "<NativeLibrary Include=\"native-lib.o\" />\n<NativeLibrary Include=\"DoesNotExist.o\" />";
ProjectInfo info = CopyTestAsset(config, aot, TestAsset.WasmBasicTestApp, "AppUsingNativeLib-a", extraItems: extraItems);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

namespace Wasm.Build.Tests
{
[TestCategory("native")]
public class PInvokeTableGeneratorTests : PInvokeTableGeneratorTestsBase
{
public PInvokeTableGeneratorTests(ITestOutputHelper output, SharedBuildPerTestClassFixture buildContext)
Expand Down Expand Up @@ -351,6 +350,7 @@ private async Task EnsureWasmAbiRulesAreFollowed(Configuration config, bool aot)

[Theory]
[BuildAndRun(aot: true, config: Configuration.Release)]
[TestCategory("native")]
public async Task EnsureWasmAbiRulesAreFollowedInAOT(Configuration config, bool aot) =>
await EnsureWasmAbiRulesAreFollowed(config, aot);

Expand All @@ -361,6 +361,7 @@ public async Task EnsureWasmAbiRulesAreFollowedInInterpreter(Configuration confi

[Theory]
[BuildAndRun(aot: true, config: Configuration.Release)]
[TestCategory("native")]
public void EnsureComInteropCompilesInAOT(Configuration config, bool aot)
{
ProjectInfo info = CopyTestAsset(config, aot, TestAsset.WasmBasicTestApp, "com");
Expand Down
Loading
Loading