diff --git a/eng/pipelines/runtime.yml b/eng/pipelines/runtime.yml index 9af74955c577b2..2c8dc82291b3e9 100644 --- a/eng/pipelines/runtime.yml +++ b/eng/pipelines/runtime.yml @@ -130,6 +130,7 @@ extends: eq(variables['wasmDarcDependenciesChanged'], true), eq(stageDependencies.EvaluatePaths.evaluate_paths.outputs['SetPathVars_tools_illink.containsChange'], true), eq(stageDependencies.EvaluatePaths.evaluate_paths.outputs['SetPathVars_wasm_coreclr_runtimetests.containsChange'], true), + eq(stageDependencies.EvaluatePaths.evaluate_paths.outputs['SetPathVars_wasmbuildtests.containsChange'], true), eq(variables['isRollingBuild'], true)) - template: /eng/pipelines/common/platform-matrix.yml diff --git a/eng/testing/scenarios/BuildWasmAppsJobsListCLR.txt b/eng/testing/scenarios/BuildWasmAppsJobsListCLR.txt new file mode 100644 index 00000000000000..28a2f6ccee94a4 --- /dev/null +++ b/eng/testing/scenarios/BuildWasmAppsJobsListCLR.txt @@ -0,0 +1,12 @@ +Wasm.Build.Tests.DebugLevelTests +Wasm.Build.Tests.EnvVariablesTests +Wasm.Build.Tests.FilesToIncludeInFileSystemTests +Wasm.Build.Tests.HttpTests +Wasm.Build.Tests.LazyLoadingTests +Wasm.Build.Tests.ModuleConfigTests +Wasm.Build.Tests.PreloadingTests +Wasm.Build.Tests.RebuildTests +Wasm.Build.Tests.SatelliteLoadingTests +Wasm.Build.Tests.WasmBuildAppTest +Wasm.Build.Tests.WasmRunOutOfAppBundleTests +Wasm.Build.Tests.WasmTemplateTests \ No newline at end of file diff --git a/src/libraries/sendtohelix-browser.targets b/src/libraries/sendtohelix-browser.targets index 0729da3fb808d7..5a06771698e2ff 100644 --- a/src/libraries/sendtohelix-browser.targets +++ b/src/libraries/sendtohelix-browser.targets @@ -131,12 +131,13 @@ - $(RepositoryEngineeringDir)testing\scenarios\BuildWasmAppsJobsList.txt + $(RepositoryEngineeringDir)testing\scenarios\BuildWasmAppsJobsList.txt + $(RepositoryEngineeringDir)testing\scenarios\BuildWasmAppsJobsListCLR.txt <_XUnitTraitArg Condition="'$(TestUsingWorkloads)' == 'true'">-notrait category=no-workload <_XUnitTraitArg Condition="'$(TestUsingWorkloads)' != 'true'">-trait category=no-workload <_XUnitTraitArg Condition="'$(WasmFingerprintAssets)' == 'false'">$(_XUnitTraitArg) -trait category=no-fingerprinting <_XUnitTraitArg Condition="'$(WasmBundlerFriendlyBootConfig)' == 'true'">$(_XUnitTraitArg) -trait category=bundler-friendly - <_XUnitTraitArg Condition="'$(RuntimeFlavor)' == 'CoreCLR'">-trait category=$(RuntimeFlavor) + <_XUnitTraitArg Condition="'$(RuntimeFlavor)' == 'CoreCLR'">-notrait category=native -notrait category=mono -notrait category=workload diff --git a/src/libraries/sendtohelix-wasm.targets b/src/libraries/sendtohelix-wasm.targets index 1533b8600e173b..1160ca6c011aa1 100644 --- a/src/libraries/sendtohelix-wasm.targets +++ b/src/libraries/sendtohelix-wasm.targets @@ -43,13 +43,20 @@ <_BuildWasmAppsPayloadArchive>@(_WasmWorkItem) - + - + + $(_BuildWasmAppsPayloadArchive) + $(EnvVarCommand) "HELIX_XUNIT_ARGS=-class %(Identity)" + $(HelixCommand) + $(_workItemTimeout) + + + $(_BuildWasmAppsPayloadArchive) $(EnvVarCommand) "HELIX_XUNIT_ARGS=-class %(Identity)" $(HelixCommand) diff --git a/src/mono/wasm/Wasm.Build.Tests/Blazor/BuildPublishTests.cs b/src/mono/wasm/Wasm.Build.Tests/Blazor/BuildPublishTests.cs index 63f2fd2a3bd145..b1e19c334fc624 100644 --- a/src/mono/wasm/Wasm.Build.Tests/Blazor/BuildPublishTests.cs +++ b/src/mono/wasm/Wasm.Build.Tests/Blazor/BuildPublishTests.cs @@ -50,6 +50,7 @@ public void DefaultTemplate_NoAOT_WithWorkload(Configuration config, bool testUn [Theory] [MemberData(nameof(TestDataForDefaultTemplate_WithWorkload), parameters: new object[] { true })] + [TestCategory("native")] public void DefaultTemplate_AOT_WithWorkload(Configuration config, bool testUnicode) { ProjectInfo info = CopyTestAsset(config, aot: false, TestAsset.BlazorBasicTestApp, "blz_aot", appendUnicodeToPath: testUnicode); @@ -117,6 +118,7 @@ void AssertResourcesDlls(string basePath) [Theory] [InlineData("", true)] // Default case [InlineData("false", false)] // the other case + [TestCategory("native")] public async Task Test_WasmStripILAfterAOT(string stripILAfterAOT, bool expectILStripping) { Configuration config = Configuration.Release; @@ -136,6 +138,7 @@ public async Task Test_WasmStripILAfterAOT(string stripILAfterAOT, bool expectIL [Theory] [InlineData(Configuration.Debug)] + [TestCategory("native")] public void BlazorWasm_CannotAOT_InDebug(Configuration config) { ProjectInfo info = CopyTestAsset( diff --git a/src/mono/wasm/Wasm.Build.Tests/Blazor/CleanTests.cs b/src/mono/wasm/Wasm.Build.Tests/Blazor/CleanTests.cs index 2d9a8baa260f7a..afb0d9c79e2720 100644 --- a/src/mono/wasm/Wasm.Build.Tests/Blazor/CleanTests.cs +++ b/src/mono/wasm/Wasm.Build.Tests/Blazor/CleanTests.cs @@ -13,6 +13,7 @@ namespace Wasm.Build.Tests.Blazor; +[TestCategory("native")] public class CleanTests : BlazorWasmTestBase { public CleanTests(ITestOutputHelper output, SharedBuildPerTestClassFixture buildContext) diff --git a/src/mono/wasm/Wasm.Build.Tests/Blazor/DllImportTests.cs b/src/mono/wasm/Wasm.Build.Tests/Blazor/DllImportTests.cs index 29df5cdc3aec7e..03e1e1e84c8339 100644 --- a/src/mono/wasm/Wasm.Build.Tests/Blazor/DllImportTests.cs +++ b/src/mono/wasm/Wasm.Build.Tests/Blazor/DllImportTests.cs @@ -15,6 +15,7 @@ namespace Wasm.Build.Tests.Blazor; +[TestCategory("native")] public class DllImportTests : BlazorWasmTestBase { public DllImportTests(ITestOutputHelper output, SharedBuildPerTestClassFixture buildContext) diff --git a/src/mono/wasm/Wasm.Build.Tests/Blazor/EventPipeDiagnosticsTests.cs b/src/mono/wasm/Wasm.Build.Tests/Blazor/EventPipeDiagnosticsTests.cs index 3ee0c013877bfb..7f359c9e864a53 100644 --- a/src/mono/wasm/Wasm.Build.Tests/Blazor/EventPipeDiagnosticsTests.cs +++ b/src/mono/wasm/Wasm.Build.Tests/Blazor/EventPipeDiagnosticsTests.cs @@ -17,6 +17,7 @@ namespace Wasm.Build.Tests.Blazor; +[TestCategory("mono")] public class EventPipeDiagnosticsTests : BlazorWasmTestBase { private static readonly string uploadPattern = "^[a-zA-Z0-9_]+\\.nettrace$"; diff --git a/src/mono/wasm/Wasm.Build.Tests/Blazor/MiscTests.cs b/src/mono/wasm/Wasm.Build.Tests/Blazor/MiscTests.cs index 8b851af3586cdf..2b8d4c2158930c 100644 --- a/src/mono/wasm/Wasm.Build.Tests/Blazor/MiscTests.cs +++ b/src/mono/wasm/Wasm.Build.Tests/Blazor/MiscTests.cs @@ -30,6 +30,7 @@ public MiscTests(ITestOutputHelper output, SharedBuildPerTestClassFixture buildC [InlineData(Configuration.Release, true)] [InlineData(Configuration.Release, false)] [ActiveIssue("https://github.com/dotnet/runtime/issues/103566")] + [TestCategory("native")] public void NativeBuild_WithDeployOnBuild_UsedByVS(Configuration config, bool nativeRelink) { string extraProperties = config == Configuration.Debug @@ -57,6 +58,7 @@ public void NativeBuild_WithDeployOnBuild_UsedByVS(Configuration config, bool na [Theory] [InlineData(Configuration.Release)] + [TestCategory("native")] public void DefaultTemplate_AOT_InProjectFile(Configuration config) { string extraProperties = config == Configuration.Debug @@ -77,6 +79,7 @@ public void DefaultTemplate_AOT_InProjectFile(Configuration config) } [Fact] + [TestCategory("native")] public void BugRegression_60479_WithRazorClassLib() { Configuration config = Configuration.Release; diff --git a/src/mono/wasm/Wasm.Build.Tests/Blazor/NativeRefTests.cs b/src/mono/wasm/Wasm.Build.Tests/Blazor/NativeRefTests.cs index 180c1e249c52bf..2314cd4644f135 100644 --- a/src/mono/wasm/Wasm.Build.Tests/Blazor/NativeRefTests.cs +++ b/src/mono/wasm/Wasm.Build.Tests/Blazor/NativeRefTests.cs @@ -9,6 +9,7 @@ namespace Wasm.Build.Tests.Blazor; +[TestCategory("native")] public class NativeTests : BlazorWasmTestBase { public NativeTests(ITestOutputHelper output, SharedBuildPerTestClassFixture buildContext) diff --git a/src/mono/wasm/Wasm.Build.Tests/Blazor/NoopNativeRebuildTest.cs b/src/mono/wasm/Wasm.Build.Tests/Blazor/NoopNativeRebuildTest.cs index 526a4737a29beb..71c8c520dc16ec 100644 --- a/src/mono/wasm/Wasm.Build.Tests/Blazor/NoopNativeRebuildTest.cs +++ b/src/mono/wasm/Wasm.Build.Tests/Blazor/NoopNativeRebuildTest.cs @@ -11,6 +11,7 @@ namespace Wasm.Build.Tests.Blazor { + [TestCategory("native")] public class NoopNativeRebuildTest : BlazorWasmTestBase { public NoopNativeRebuildTest(ITestOutputHelper output, SharedBuildPerTestClassFixture buildContext) diff --git a/src/mono/wasm/Wasm.Build.Tests/Blazor/SimpleMultiThreadedTests.cs b/src/mono/wasm/Wasm.Build.Tests/Blazor/SimpleMultiThreadedTests.cs index 72ae03786db60f..f05c6093b75a54 100644 --- a/src/mono/wasm/Wasm.Build.Tests/Blazor/SimpleMultiThreadedTests.cs +++ b/src/mono/wasm/Wasm.Build.Tests/Blazor/SimpleMultiThreadedTests.cs @@ -13,6 +13,7 @@ namespace Wasm.Build.Tests.MT.Blazor; +[TestCategory("mono")] public class SimpleMultiThreadedTests : BlazorWasmTestBase { public SimpleMultiThreadedTests(ITestOutputHelper output, SharedBuildPerTestClassFixture buildContext) diff --git a/src/mono/wasm/Wasm.Build.Tests/Blazor/SimpleRunTests.cs b/src/mono/wasm/Wasm.Build.Tests/Blazor/SimpleRunTests.cs index e623c6d4efc7e3..d39d794e7f5392 100644 --- a/src/mono/wasm/Wasm.Build.Tests/Blazor/SimpleRunTests.cs +++ b/src/mono/wasm/Wasm.Build.Tests/Blazor/SimpleRunTests.cs @@ -64,6 +64,7 @@ public async Task BlazorBuildAndRunForDifferentOutputPaths(Configuration config, [InlineData(Configuration.Debug, false)] [InlineData(Configuration.Release, false)] [InlineData(Configuration.Release, true)] + [TestCategory("native")] public async Task BlazorPublishRunTest(Configuration config, bool aot) { ProjectInfo info = CopyTestAsset(config, aot, TestAsset.BlazorBasicTestApp, "blazor_publish"); diff --git a/src/mono/wasm/Wasm.Build.Tests/BrowserStructures/TestAsset.cs b/src/mono/wasm/Wasm.Build.Tests/BrowserStructures/TestAsset.cs index e4b4ec9efd0575..83bf2e674d1a39 100644 --- a/src/mono/wasm/Wasm.Build.Tests/BrowserStructures/TestAsset.cs +++ b/src/mono/wasm/Wasm.Build.Tests/BrowserStructures/TestAsset.cs @@ -6,5 +6,4 @@ public class TestAsset public static readonly TestAsset BlazorBasicTestApp = new() { Name = "BlazorBasicTestApp", RunnableProjectSubPath = "App" }; public static readonly TestAsset LibraryModeTestApp = new() { Name = "LibraryMode" }; public static readonly TestAsset BlazorWebWasm = new() { Name = "BlazorWebWasm", RunnableProjectSubPath = "BlazorWebWasm" }; - public static readonly TestAsset WasmBrowserRunMainOnly = new() { Name = "WasmBrowserRunMainOnly" }; } diff --git a/src/mono/wasm/Wasm.Build.Tests/BuildPublishTests.cs b/src/mono/wasm/Wasm.Build.Tests/BuildPublishTests.cs index 41d7fdb6388fec..23dd76ebce99f2 100644 --- a/src/mono/wasm/Wasm.Build.Tests/BuildPublishTests.cs +++ b/src/mono/wasm/Wasm.Build.Tests/BuildPublishTests.cs @@ -23,6 +23,7 @@ public BuildPublishTests(ITestOutputHelper output, SharedBuildPerTestClassFixtur [Theory] [BuildAndRun(config: Configuration.Debug, aot: true)] + [TestCategory("native")] public void Wasm_CannotAOT_InDebug(Configuration config, bool aot) { ProjectInfo info = CopyTestAsset(config, aot, TestAsset.WasmBasicTestApp, "no_aot_in_debug"); @@ -50,6 +51,7 @@ public async Task BuildThenPublishNoAOT(Configuration config, bool aot) [Theory] [BuildAndRun(config: Configuration.Release, aot: true)] + [TestCategory("native")] public async Task BuildThenPublishWithAOT(Configuration config, bool aot) { ProjectInfo info = CopyTestAsset(config, aot, TestAsset.WasmBasicTestApp, "build_publish"); diff --git a/src/mono/wasm/Wasm.Build.Tests/DiagnosticsTests.cs b/src/mono/wasm/Wasm.Build.Tests/DiagnosticsTests.cs index 0e633e20943fd1..d5729449a7ce01 100644 --- a/src/mono/wasm/Wasm.Build.Tests/DiagnosticsTests.cs +++ b/src/mono/wasm/Wasm.Build.Tests/DiagnosticsTests.cs @@ -13,6 +13,7 @@ namespace Wasm.Build.Tests; +[TestCategory("mono")] public class DiagnosticsTests : WasmTemplateTestsBase { public DiagnosticsTests(ITestOutputHelper output, SharedBuildPerTestClassFixture buildContext) diff --git a/src/mono/wasm/Wasm.Build.Tests/DllImportTests.cs b/src/mono/wasm/Wasm.Build.Tests/DllImportTests.cs index dac78c679157ce..4d84a6d567dc0e 100644 --- a/src/mono/wasm/Wasm.Build.Tests/DllImportTests.cs +++ b/src/mono/wasm/Wasm.Build.Tests/DllImportTests.cs @@ -14,6 +14,7 @@ namespace Wasm.Build.Tests { + [TestCategory("native")] public class DllImportTests : PInvokeTableGeneratorTestsBase { public DllImportTests(ITestOutputHelper output, SharedBuildPerTestClassFixture buildContext) diff --git a/src/mono/wasm/Wasm.Build.Tests/IcuShardingTests.cs b/src/mono/wasm/Wasm.Build.Tests/IcuShardingTests.cs index e3ecb5a48717d0..2883967abc0105 100644 --- a/src/mono/wasm/Wasm.Build.Tests/IcuShardingTests.cs +++ b/src/mono/wasm/Wasm.Build.Tests/IcuShardingTests.cs @@ -41,11 +41,13 @@ from locale in locales [Theory] [MemberData(nameof(IcuExpectedAndMissingCustomShardTestData), parameters: new object[] { Configuration.Release })] + [TestCategory("native")] public async Task CustomIcuShard(Configuration config, bool aot, string customIcuPath, string customLocales, bool onlyPredefinedCultures) => await TestIcuShards(config, Template.WasmBrowser, aot, customIcuPath, customLocales, GlobalizationMode.Custom, onlyPredefinedCultures); [Theory] [MemberData(nameof(IcuExpectedAndMissingAutomaticShardTestData), parameters: new object[] { Configuration.Release })] + [TestCategory("native")] public async Task AutomaticShardSelectionDependingOnEnvLocale(Configuration config, bool aot, string environmentLocale, string testedLocales) => await PublishAndRunIcuTest(config, Template.WasmBrowser, aot, testedLocales, GlobalizationMode.Sharded, locale: environmentLocale); } diff --git a/src/mono/wasm/Wasm.Build.Tests/IcuShardingTests2.cs b/src/mono/wasm/Wasm.Build.Tests/IcuShardingTests2.cs index c87afc44b9abb6..7005b99642b21e 100644 --- a/src/mono/wasm/Wasm.Build.Tests/IcuShardingTests2.cs +++ b/src/mono/wasm/Wasm.Build.Tests/IcuShardingTests2.cs @@ -38,6 +38,7 @@ from locale in locales [Theory] [MemberData(nameof(IcuExpectedAndMissingShardFromRuntimePackTestData), parameters: new object[] { Configuration.Release })] + [TestCategory("native")] public async Task DefaultAvailableIcuShardsFromRuntimePack(Configuration config, bool aot, string shardName, string testedLocales) => await TestIcuShards(config, Template.WasmBrowser, aot, shardName, testedLocales, GlobalizationMode.Custom); } diff --git a/src/mono/wasm/Wasm.Build.Tests/IcuTests.cs b/src/mono/wasm/Wasm.Build.Tests/IcuTests.cs index 825f00e3b9b6f0..f57e229bc0200d 100644 --- a/src/mono/wasm/Wasm.Build.Tests/IcuTests.cs +++ b/src/mono/wasm/Wasm.Build.Tests/IcuTests.cs @@ -53,6 +53,7 @@ public static IEnumerable IncorrectIcuTestData(Configuration config) [Theory] [MemberData(nameof(FullIcuWithInvariantTestData), parameters: new object[] { Configuration.Release })] + [TestCategory("native")] public async Task FullIcuFromRuntimePackWithInvariant(Configuration config=Configuration.Release, bool aot=false, bool invariant=true, bool fullIcu=true, string testedLocales="Array.Empty()") => await PublishAndRunIcuTest( config, @@ -66,6 +67,7 @@ await PublishAndRunIcuTest( [Theory] [MemberData(nameof(FullIcuWithICustomIcuTestData), parameters: new object[] { Configuration.Release })] + [TestCategory("native")] public async Task FullIcuFromRuntimePackWithCustomIcu(Configuration config, bool aot, bool fullIcu) { string customIcuProperty = "BlazorIcuDataFileName"; @@ -82,6 +84,7 @@ public async Task FullIcuFromRuntimePackWithCustomIcu(Configuration config, bool [Theory] [MemberData(nameof(IncorrectIcuTestData), parameters: new object[] { Configuration.Release })] + [TestCategory("workload")] public void NonExistingCustomFileAssertError(Configuration config, string customIcu, bool isFilenameFormCorrect) { string customIcuProperty = "BlazorIcuDataFileName"; diff --git a/src/mono/wasm/Wasm.Build.Tests/InterpPgoTests.cs b/src/mono/wasm/Wasm.Build.Tests/InterpPgoTests.cs index 4af6f409aeedb7..693ef6d1fd4f5c 100644 --- a/src/mono/wasm/Wasm.Build.Tests/InterpPgoTests.cs +++ b/src/mono/wasm/Wasm.Build.Tests/InterpPgoTests.cs @@ -15,6 +15,7 @@ namespace Wasm.Build.Tests; +[TestCategory("mono")] public class InterpPgoTests : WasmTemplateTestsBase { public InterpPgoTests(ITestOutputHelper output, SharedBuildPerTestClassFixture buildContext) diff --git a/src/mono/wasm/Wasm.Build.Tests/InvariantGlobalizationTests.cs b/src/mono/wasm/Wasm.Build.Tests/InvariantGlobalizationTests.cs index 28253df6cea2c2..9a7950b7a5ec4b 100644 --- a/src/mono/wasm/Wasm.Build.Tests/InvariantGlobalizationTests.cs +++ b/src/mono/wasm/Wasm.Build.Tests/InvariantGlobalizationTests.cs @@ -32,12 +32,14 @@ public InvariantGlobalizationTests(ITestOutputHelper output, SharedBuildPerTestC [Theory] [MemberData(nameof(InvariantGlobalizationTestData), parameters: new object[] { /*aot*/ false })] [MemberData(nameof(InvariantGlobalizationTestData), parameters: new object[] { /*aot*/ true })] + [TestCategory("native")] public async Task AOT_InvariantGlobalization(Configuration config, bool aot, bool? invariantGlobalization) => await TestInvariantGlobalization(config, aot, invariantGlobalization); // TODO: What else should we use to verify a relinked build? [Theory] [MemberData(nameof(InvariantGlobalizationTestData), parameters: new object[] { /*aot*/ false })] + [TestCategory("native")] public async Task RelinkingWithoutAOT(Configuration config, bool aot, bool? invariantGlobalization) => await TestInvariantGlobalization(config, aot, invariantGlobalization, isNativeBuild: true); diff --git a/src/mono/wasm/Wasm.Build.Tests/InvariantTimezoneTests.cs b/src/mono/wasm/Wasm.Build.Tests/InvariantTimezoneTests.cs index d515dfea8312ae..016996873df776 100644 --- a/src/mono/wasm/Wasm.Build.Tests/InvariantTimezoneTests.cs +++ b/src/mono/wasm/Wasm.Build.Tests/InvariantTimezoneTests.cs @@ -29,11 +29,13 @@ public InvariantTimezoneTests(ITestOutputHelper output, SharedBuildPerTestClassF [Theory] [MemberData(nameof(InvariantTimezoneTestData), parameters: new object[] { /*aot*/ false, })] [MemberData(nameof(InvariantTimezoneTestData), parameters: new object[] { /*aot*/ true })] + [TestCategory("native")] public async Task AOT_InvariantTimezone(Configuration config, bool aot, bool? invariantTimezone) => await TestInvariantTimezone(config, aot, invariantTimezone); [Theory] [MemberData(nameof(InvariantTimezoneTestData), parameters: new object[] { /*aot*/ false })] + [TestCategory("native")] public async Task RelinkingWithoutAOT(Configuration config, bool aot, bool? invariantTimezone) => await TestInvariantTimezone(config, aot, invariantTimezone, isNativeBuild: true); diff --git a/src/mono/wasm/Wasm.Build.Tests/LazyLoadingTests.cs b/src/mono/wasm/Wasm.Build.Tests/LazyLoadingTests.cs index 65011962374221..815f2cf89fdde5 100644 --- a/src/mono/wasm/Wasm.Build.Tests/LazyLoadingTests.cs +++ b/src/mono/wasm/Wasm.Build.Tests/LazyLoadingTests.cs @@ -29,6 +29,7 @@ public LazyLoadingTests(ITestOutputHelper output, SharedBuildPerTestClassFixture [Theory, TestCategory("no-fingerprinting")] [MemberData(nameof(LoadLazyAssemblyBeforeItIsNeededData))] + [Skip("Fails on CoreCLR: PDBs not loaded for lazy assemblies. See issues.md.", RuntimeFlavor = "CoreCLR")] public async Task LoadLazyAssemblyBeforeItIsNeeded(string lazyLoadingTestExtension, string[] allLazyLoadingTestExtensions) { Configuration config = Configuration.Debug; diff --git a/src/mono/wasm/Wasm.Build.Tests/MainWithArgsTests.cs b/src/mono/wasm/Wasm.Build.Tests/MainWithArgsTests.cs index 83e79e6955dddf..ef4d837da761a7 100644 --- a/src/mono/wasm/Wasm.Build.Tests/MainWithArgsTests.cs +++ b/src/mono/wasm/Wasm.Build.Tests/MainWithArgsTests.cs @@ -31,12 +31,14 @@ public MainWithArgsTests(ITestOutputHelper output, SharedBuildPerTestClassFixtur [Theory] [MemberData(nameof(MainWithArgsTestData), parameters: new object[] { /*aot*/ false })] [MemberData(nameof(MainWithArgsTestData), parameters: new object[] { /*aot*/ true })] + [TestCategory("native")] public async Task AsyncMainWithArgs(Configuration config, bool aot, string[] args) => await TestMainWithArgs(config, aot, "async_main_with_args", "AsyncMainWithArgs.cs", args); [Theory] [MemberData(nameof(MainWithArgsTestData), parameters: new object[] { /*aot*/ false })] [MemberData(nameof(MainWithArgsTestData), parameters: new object[] { /*aot*/ true })] + [TestCategory("native")] public async Task NonAsyncMainWithArgs(Configuration config, bool aot, string[] args) => await TestMainWithArgs(config, aot, "non_async_main_args", "SyncMainWithArgs.cs", args); diff --git a/src/mono/wasm/Wasm.Build.Tests/MemoryTests.cs b/src/mono/wasm/Wasm.Build.Tests/MemoryTests.cs index 50283071f30bde..d4c4a32c3b6412 100644 --- a/src/mono/wasm/Wasm.Build.Tests/MemoryTests.cs +++ b/src/mono/wasm/Wasm.Build.Tests/MemoryTests.cs @@ -13,6 +13,7 @@ namespace Wasm.Build.Tests; +[TestCategory("native")] public class MemoryTests : WasmTemplateTestsBase { public MemoryTests(ITestOutputHelper output, SharedBuildPerTestClassFixture buildContext) diff --git a/src/mono/wasm/Wasm.Build.Tests/ModuleConfigTests.cs b/src/mono/wasm/Wasm.Build.Tests/ModuleConfigTests.cs index a9c220e4d07973..7affdf1ff5d558 100644 --- a/src/mono/wasm/Wasm.Build.Tests/ModuleConfigTests.cs +++ b/src/mono/wasm/Wasm.Build.Tests/ModuleConfigTests.cs @@ -124,11 +124,19 @@ public async Task AssetIntegrity() } [Theory] - [InlineData(true, false)] - [InlineData(true, true)] - [InlineData(false, false)] - [InlineData(false, true)] - public void SymbolMapFileEmitted(bool emitSymbolMap, bool isPublish) + [InlineData(false)] + [InlineData(true)] + [TestCategory("native")] + public void SymbolMapFileEmitted(bool isPublish) + => SymbolMapFileEmittedCore(emitSymbolMap: true, isPublish); + + [Theory] + [InlineData(false)] + [InlineData(true)] + public void SymbolMapFileNotEmitted(bool isPublish) + => SymbolMapFileEmittedCore(emitSymbolMap: false, isPublish); + + private void SymbolMapFileEmittedCore(bool emitSymbolMap, bool isPublish) { Configuration config = Configuration.Release; string extraProperties = $"{emitSymbolMap.ToString().ToLowerInvariant()}"; diff --git a/src/mono/wasm/Wasm.Build.Tests/NativeBuildTests.cs b/src/mono/wasm/Wasm.Build.Tests/NativeBuildTests.cs index 6716d4d350a298..ff33906df14d1a 100644 --- a/src/mono/wasm/Wasm.Build.Tests/NativeBuildTests.cs +++ b/src/mono/wasm/Wasm.Build.Tests/NativeBuildTests.cs @@ -13,6 +13,7 @@ namespace Wasm.Build.Tests { + [TestCategory("native")] public class NativeBuildTests : WasmTemplateTestsBase { public NativeBuildTests(ITestOutputHelper output, SharedBuildPerTestClassFixture buildContext) diff --git a/src/mono/wasm/Wasm.Build.Tests/NativeLibraryTests.cs b/src/mono/wasm/Wasm.Build.Tests/NativeLibraryTests.cs index f01fb37c5fe993..9cbe49352c147c 100644 --- a/src/mono/wasm/Wasm.Build.Tests/NativeLibraryTests.cs +++ b/src/mono/wasm/Wasm.Build.Tests/NativeLibraryTests.cs @@ -11,6 +11,7 @@ namespace Wasm.Build.Tests { + [TestCategory("native")] public class NativeLibraryTests : WasmTemplateTestsBase { public NativeLibraryTests(ITestOutputHelper output, SharedBuildPerTestClassFixture buildContext) diff --git a/src/mono/wasm/Wasm.Build.Tests/NativeRebuildTests/FlagsChangeRebuildTest.cs b/src/mono/wasm/Wasm.Build.Tests/NativeRebuildTests/FlagsChangeRebuildTest.cs index 0c16c575dbb212..8182a03b093c64 100644 --- a/src/mono/wasm/Wasm.Build.Tests/NativeRebuildTests/FlagsChangeRebuildTest.cs +++ b/src/mono/wasm/Wasm.Build.Tests/NativeRebuildTests/FlagsChangeRebuildTest.cs @@ -13,6 +13,7 @@ namespace Wasm.Build.NativeRebuild.Tests { + [TestCategory("native")] public class FlagsChangeRebuildTests : NativeRebuildTestsBase { public FlagsChangeRebuildTests(ITestOutputHelper output, SharedBuildPerTestClassFixture buildContext) diff --git a/src/mono/wasm/Wasm.Build.Tests/NativeRebuildTests/NoopNativeRebuildTest.cs b/src/mono/wasm/Wasm.Build.Tests/NativeRebuildTests/NoopNativeRebuildTest.cs index 00c6c25ecf6ed0..a07a03da24e201 100644 --- a/src/mono/wasm/Wasm.Build.Tests/NativeRebuildTests/NoopNativeRebuildTest.cs +++ b/src/mono/wasm/Wasm.Build.Tests/NativeRebuildTests/NoopNativeRebuildTest.cs @@ -11,6 +11,7 @@ namespace Wasm.Build.NativeRebuild.Tests { + [TestCategory("native")] public class NoopNativeRebuildTest : NativeRebuildTestsBase { public NoopNativeRebuildTest(ITestOutputHelper output, SharedBuildPerTestClassFixture buildContext) diff --git a/src/mono/wasm/Wasm.Build.Tests/NativeRebuildTests/OptimizationFlagChangeTests.cs b/src/mono/wasm/Wasm.Build.Tests/NativeRebuildTests/OptimizationFlagChangeTests.cs index 0bc203214df016..205add7709be63 100644 --- a/src/mono/wasm/Wasm.Build.Tests/NativeRebuildTests/OptimizationFlagChangeTests.cs +++ b/src/mono/wasm/Wasm.Build.Tests/NativeRebuildTests/OptimizationFlagChangeTests.cs @@ -14,6 +14,7 @@ namespace Wasm.Build.NativeRebuild.Tests; +[TestCategory("native")] public class OptimizationFlagChangeTests : NativeRebuildTestsBase { public OptimizationFlagChangeTests(ITestOutputHelper output, SharedBuildPerTestClassFixture buildContext) diff --git a/src/mono/wasm/Wasm.Build.Tests/NativeRebuildTests/ReferenceNewAssemblyRebuildTest.cs b/src/mono/wasm/Wasm.Build.Tests/NativeRebuildTests/ReferenceNewAssemblyRebuildTest.cs index bc9d6a4cb5a59d..ff7d6bc862c32c 100644 --- a/src/mono/wasm/Wasm.Build.Tests/NativeRebuildTests/ReferenceNewAssemblyRebuildTest.cs +++ b/src/mono/wasm/Wasm.Build.Tests/NativeRebuildTests/ReferenceNewAssemblyRebuildTest.cs @@ -13,6 +13,7 @@ namespace Wasm.Build.NativeRebuild.Tests { + [TestCategory("native")] public class ReferenceNewAssemblyRebuildTest : NativeRebuildTestsBase { public ReferenceNewAssemblyRebuildTest(ITestOutputHelper output, SharedBuildPerTestClassFixture buildContext) diff --git a/src/mono/wasm/Wasm.Build.Tests/NativeRebuildTests/SimpleSourceChangeRebuildTest.cs b/src/mono/wasm/Wasm.Build.Tests/NativeRebuildTests/SimpleSourceChangeRebuildTest.cs index 342fb537cf3ba6..7de98cf6560f73 100644 --- a/src/mono/wasm/Wasm.Build.Tests/NativeRebuildTests/SimpleSourceChangeRebuildTest.cs +++ b/src/mono/wasm/Wasm.Build.Tests/NativeRebuildTests/SimpleSourceChangeRebuildTest.cs @@ -12,6 +12,7 @@ namespace Wasm.Build.NativeRebuild.Tests { + [TestCategory("native")] public class SimpleSourceChangeRebuildTest : NativeRebuildTestsBase { public SimpleSourceChangeRebuildTest(ITestOutputHelper output, SharedBuildPerTestClassFixture buildContext) diff --git a/src/mono/wasm/Wasm.Build.Tests/PInvokeTableGeneratorTests.cs b/src/mono/wasm/Wasm.Build.Tests/PInvokeTableGeneratorTests.cs index b17615c648bf93..f88a5013b92f95 100644 --- a/src/mono/wasm/Wasm.Build.Tests/PInvokeTableGeneratorTests.cs +++ b/src/mono/wasm/Wasm.Build.Tests/PInvokeTableGeneratorTests.cs @@ -14,6 +14,7 @@ namespace Wasm.Build.Tests { + [TestCategory("native")] public class PInvokeTableGeneratorTests : PInvokeTableGeneratorTestsBase { public PInvokeTableGeneratorTests(ITestOutputHelper output, SharedBuildPerTestClassFixture buildContext) diff --git a/src/mono/wasm/Wasm.Build.Tests/SatelliteAssembliesTests.cs b/src/mono/wasm/Wasm.Build.Tests/SatelliteAssembliesTests.cs index 140e63c326433d..dd9e20d2a8b59a 100644 --- a/src/mono/wasm/Wasm.Build.Tests/SatelliteAssembliesTests.cs +++ b/src/mono/wasm/Wasm.Build.Tests/SatelliteAssembliesTests.cs @@ -33,6 +33,7 @@ public SatelliteAssembliesTests(ITestOutputHelper output, SharedBuildPerTestClas [MemberData(nameof(SatelliteAssemblyTestData), parameters: new object[] { /*aot*/ false, /*relinking*/ false })] [MemberData(nameof(SatelliteAssemblyTestData), parameters: new object[] { /*aot*/ false, /*relinking*/ true })] [MemberData(nameof(SatelliteAssemblyTestData), parameters: new object[] { /*aot*/ true, /*relinking*/ false })] + [TestCategory("native")] public async Task ResourcesFromMainAssembly(Configuration config, bool aot, bool nativeRelink, string? argCulture) { string prefix = $"sat_asm_from_main_asm"; @@ -59,6 +60,7 @@ public async Task ResourcesFromMainAssembly(Configuration config, bool aot, bool [MemberData(nameof(SatelliteAssemblyTestData), parameters: new object[] { /*aot*/ false, /*relinking*/ false })] [MemberData(nameof(SatelliteAssemblyTestData), parameters: new object[] { /*aot*/ false, /*relinking*/ true })] [MemberData(nameof(SatelliteAssemblyTestData), parameters: new object[] { /*aot*/ true, /*relinking*/ true })] + [TestCategory("native")] public async Task ResourcesFromProjectReference(Configuration config, bool aot, bool nativeRelink, string? argCulture) { string prefix = $"SatelliteAssemblyFromProjectRef"; @@ -93,6 +95,7 @@ await RunForPublishWithWebServer( #pragma warning disable xUnit1026 [Theory] [BuildAndRun(aot: true, config: Configuration.Release)] + [TestCategory("native")] public void CheckThatSatelliteAssembliesAreNotAOTed(Configuration config, bool aot) { string extraProperties = $@"-O1 diff --git a/src/mono/wasm/Wasm.Build.Tests/SatelliteLoadingTests.cs b/src/mono/wasm/Wasm.Build.Tests/SatelliteLoadingTests.cs index c0bc8895e093fb..6c3494bb6562e2 100644 --- a/src/mono/wasm/Wasm.Build.Tests/SatelliteLoadingTests.cs +++ b/src/mono/wasm/Wasm.Build.Tests/SatelliteLoadingTests.cs @@ -28,6 +28,7 @@ public SatelliteLoadingTests(ITestOutputHelper output, SharedBuildPerTestClassFi [Theory, TestCategory("no-fingerprinting")] [InlineData(false)] [InlineData(true)] + [Skip("Fails on CoreCLR: Satellite resource loading returns wrong string for es-ES. See issues.md.", RuntimeFlavor = "CoreCLR")] public async Task LoadSatelliteAssembly(bool loadAllSatelliteResources) { Configuration config = Configuration.Debug; @@ -61,6 +62,7 @@ public async Task LoadSatelliteAssembly(bool loadAllSatelliteResources) } [Fact, TestCategory("bundler-friendly")] + [Skip("Fails on CoreCLR: Satellite resource loading returns wrong string for es-ES. See issues.md.", RuntimeFlavor = "CoreCLR")] public async Task LoadSatelliteAssemblyFromReference() { Configuration config = Configuration.Release; diff --git a/src/mono/wasm/Wasm.Build.Tests/Templates/NativeBuildTests.cs b/src/mono/wasm/Wasm.Build.Tests/Templates/NativeBuildTests.cs index b1f892901d13d4..34a81b98004a9d 100644 --- a/src/mono/wasm/Wasm.Build.Tests/Templates/NativeBuildTests.cs +++ b/src/mono/wasm/Wasm.Build.Tests/Templates/NativeBuildTests.cs @@ -11,6 +11,7 @@ namespace Wasm.Build.Templates.Tests { + [TestCategory("native")] public class NativeBuildTests : WasmTemplateTestsBase { public NativeBuildTests(ITestOutputHelper output, SharedBuildPerTestClassFixture buildContext) diff --git a/src/mono/wasm/Wasm.Build.Tests/Templates/WasmTemplateTests.cs b/src/mono/wasm/Wasm.Build.Tests/Templates/WasmTemplateTests.cs index 84f4f2663be448..4e1ed9aa8930d5 100644 --- a/src/mono/wasm/Wasm.Build.Tests/Templates/WasmTemplateTests.cs +++ b/src/mono/wasm/Wasm.Build.Tests/Templates/WasmTemplateTests.cs @@ -22,7 +22,7 @@ public WasmTemplateTests(ITestOutputHelper output, SharedBuildPerTestClassFixtur { } - [Theory, TestCategory("no-fingerprinting")] + [Theory, TestCategory("no-fingerprinting"), TestCategory("workload")] [InlineData(Configuration.Debug)] [InlineData(Configuration.Release)] public void BrowserBuildThenPublish(Configuration config) @@ -70,7 +70,7 @@ void AddTestData(bool runOutsideProjectDirectory) return data; } - [Theory, TestCategory("no-fingerprinting")] + [Theory, TestCategory("no-fingerprinting"), TestCategory("workload")] [MemberData(nameof(TestDataForAppBundleDir))] public async Task RunWithDifferentAppBundleLocations(bool runOutsideProjectDirectory, string extraProperties) => await BrowserRunTwiceWithAndThenWithoutBuildAsync(Configuration.Release, extraProperties, runOutsideProjectDirectory); @@ -134,6 +134,7 @@ private async Task BrowserRunTwiceWithAndThenWithoutBuildAsync(Configuration con [Theory] [MemberData(nameof(BrowserBuildAndRunTestData))] + [TestCategory("workload")] public async Task BrowserBuildAndRun(string extraNewArgs, string targetFramework, string runtimeAssetsRelativePath) { Configuration config = Configuration.Debug; @@ -165,6 +166,7 @@ public async Task BrowserBuildAndRun(string extraNewArgs, string targetFramework [InlineData(Configuration.Debug, /*appendRID*/ true, /*useArtifacts*/ true)] [InlineData(Configuration.Debug, /*appendRID*/ false, /*useArtifacts*/ true)] [InlineData(Configuration.Debug, /*appendRID*/ false, /*useArtifacts*/ false)] + [TestCategory("workload")] public async Task BuildAndRunForDifferentOutputPaths(Configuration config, bool appendRID, bool useArtifacts) { ProjectInfo info = CreateWasmTemplateProject(Template.WasmBrowser, config, aot: false); @@ -198,6 +200,7 @@ public async Task BuildAndRunForDifferentOutputPaths(Configuration config, bool [Theory] [InlineData("", true)] // Default case [InlineData("false", false)] // the other case + [TestCategory("native"), TestCategory("workload")] public async Task Test_WasmStripILAfterAOT(string stripILAfterAOT, bool expectILStripping) { Configuration config = Configuration.Release; @@ -276,6 +279,7 @@ internal static void TestWasmStripILAfterAOTOutput(string objBuildDir, string fr [Theory] [InlineData(false)] [InlineData(true)] + [TestCategory("workload")] public void PublishPdb(bool copyOutputSymbolsToPublishDirectory) { Configuration config = Configuration.Release; @@ -323,6 +327,7 @@ public async Task LibraryModeBuild(bool useWasmSdk) [InlineData(Configuration.Release, true)] [InlineData(Configuration.Debug, false)] [InlineData(Configuration.Release, false)] + [TestCategory("workload")] public void TypeScriptDefinitionsCopiedToWwwrootOnBuild(Configuration config, bool emitTypeScriptDts) { string shouldEmit = emitTypeScriptDts ? "true" : "false"; @@ -354,6 +359,7 @@ public void TypeScriptDefinitionsCopiedToWwwrootOnBuild(Configuration config, bo [InlineData("true", false)] [InlineData("false", true)] [InlineData("", false)] // Default case + [TestCategory("workload")] public void UseMonoRuntimeParameter(string useMonoRuntimeArg, bool expectUseMonoRuntimeProperty) { Configuration config = Configuration.Debug; diff --git a/src/mono/wasm/Wasm.Build.Tests/Wasm.Build.Tests.csproj b/src/mono/wasm/Wasm.Build.Tests/Wasm.Build.Tests.csproj index ddc3118e6cdc07..8eb86c51e5f93b 100644 --- a/src/mono/wasm/Wasm.Build.Tests/Wasm.Build.Tests.csproj +++ b/src/mono/wasm/Wasm.Build.Tests/Wasm.Build.Tests.csproj @@ -103,7 +103,7 @@ <_XUnitTraitArg Condition="'$(TestUsingWorkloads)' != 'true'">-trait category=no-workload <_XUnitTraitArg Condition="'$(WasmFingerprintAssets)' == 'false'">-trait category=no-fingerprinting <_XUnitTraitArg Condition="'$(WasmBundlerFriendlyBootConfig)' == 'true'">-trait category=bundler-friendly - <_XUnitTraitArg Condition="'$(RuntimeFlavor)' == 'CoreCLR'">-trait category=$(RuntimeFlavor) + <_XUnitTraitArg Condition="'$(RuntimeFlavor)' == 'CoreCLR'">-notrait category=native -notrait category=mono -notrait category=workload diff --git a/src/mono/wasm/Wasm.Build.Tests/WasmBrowserRunMainOnly.cs b/src/mono/wasm/Wasm.Build.Tests/WasmBrowserRunMainOnly.cs deleted file mode 100644 index 5f49a85154d9d6..00000000000000 --- a/src/mono/wasm/Wasm.Build.Tests/WasmBrowserRunMainOnly.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System.Collections.Specialized; -using System.Threading.Tasks; -using Xunit; -using Xunit.Abstractions; - -namespace Wasm.Build.Tests; - -public class WasmBrowserRunMainOnly(ITestOutputHelper output, SharedBuildPerTestClassFixture buildContext) : WasmTemplateTestsBase(output, buildContext) -{ - [TestCategory("coreclr")] - [Theory] - [BuildAndRun(config: Configuration.Release)] - [BuildAndRun(config: Configuration.Debug)] - public async Task RunMainOnly(Configuration config, bool aot) - { - ProjectInfo info = CopyTestAsset(config, aot, TestAsset.WasmBrowserRunMainOnly, $"WasmBrowserRunMainOnly"); - var (_, buildOutput) = PublishProject(info, config, new PublishOptions(AssertAppBundle: false, EnableDiagnostics: true)); - - // ** MicrosoftNetCoreAppRuntimePackDir : '....microsoft.netcore.app.runtime.browser-wasm\11.0.0-dev' - Assert.Contains("microsoft.netcore.app.runtime.browser-wasm", buildOutput); - - var result = await RunForPublishWithWebServer(new BrowserRunOptions( - Configuration: config - )); - - Assert.Collection( - result.TestOutput, - m => Assert.Equal("Hello from WasmBrowserRunMainOnly!", m) - ); - } -} diff --git a/src/mono/wasm/Wasm.Build.Tests/WasmBuildAppTest.cs b/src/mono/wasm/Wasm.Build.Tests/WasmBuildAppTest.cs index 63636c98581806..f30281e6ea8f01 100644 --- a/src/mono/wasm/Wasm.Build.Tests/WasmBuildAppTest.cs +++ b/src/mono/wasm/Wasm.Build.Tests/WasmBuildAppTest.cs @@ -20,6 +20,13 @@ public WasmBuildAppTest(ITestOutputHelper output, SharedBuildPerTestClassFixture [Theory] [MemberData(nameof(MainMethodTestData), parameters: new object[] { /*aot*/ true })] + [TestCategory("native")] + public async Task TopLevelMain_AOT(Configuration config, bool aot) + => await TestMain("top_level", + @"System.Console.WriteLine(""Hello, World!""); return await System.Threading.Tasks.Task.FromResult(42);", + config, aot); + + [Theory] [MemberData(nameof(MainMethodTestData), parameters: new object[] { /*aot*/ false })] public async Task TopLevelMain(Configuration config, bool aot) => await TestMain("top_level", @@ -28,6 +35,21 @@ public async Task TopLevelMain(Configuration config, bool aot) [Theory] [MemberData(nameof(MainMethodTestData), parameters: new object[] { /*aot*/ true })] + [TestCategory("native")] + public async Task AsyncMain_AOT(Configuration config, bool aot) + => await TestMain("async_main", @" + using System; + using System.Threading.Tasks; + + public class TestClass { + public static async Task Main() + { + Console.WriteLine(""Hello, World!""); + return await Task.FromResult(42); + } + }", config, aot); + + [Theory] [MemberData(nameof(MainMethodTestData), parameters: new object[] { /*aot*/ false })] public async Task AsyncMain(Configuration config, bool aot) => await TestMain("async_main", @" @@ -44,6 +66,21 @@ public static async Task Main() [Theory] [MemberData(nameof(MainMethodTestData), parameters: new object[] { /*aot*/ true })] + [TestCategory("native")] + public async Task NonAsyncMain_AOT(Configuration config, bool aot) + => await TestMain("non_async_main", @" + using System; + using System.Threading.Tasks; + + public class TestClass { + public static int Main() + { + Console.WriteLine(""Hello, World!""); + return 42; + } + }", config, aot); + + [Theory] [MemberData(nameof(MainMethodTestData), parameters: new object[] { /*aot*/ false })] public async Task NonAsyncMain(Configuration config, bool aot) => await TestMain("non_async_main", @" @@ -68,7 +105,7 @@ public async Task ExceptionFromMain(Configuration config, bool aot) public class TestClass { public static int Main() => throw new Exception("MessageFromMyException"); } - """, config, aot, expectedExitCode: 1, expectedOutput: "Error: MessageFromMyException"); + """, config, aot, expectedExitCode: 1, expectedOutput: "MessageFromMyException"); private static string s_bug49588_ProgramCS = @" using System; @@ -85,11 +122,13 @@ public static int Main() [Theory] [MemberData(nameof(MainMethodTestData), parameters: new object[] { /*aot*/ true })] + [TestCategory("native")] public async Task Bug49588_RegressionTest_AOT(Configuration config, bool aot) => await TestMain("bug49588_aot", s_bug49588_ProgramCS, config, aot); [Theory] [MemberData(nameof(MainMethodTestData), parameters: new object[] { /*aot*/ false })] + [TestCategory("native")] public async Task Bug49588_RegressionTest_NativeRelinking(Configuration config, bool aot) => await TestMain("bug49588_native_relinking", s_bug49588_ProgramCS, config, aot, extraArgs: "-p:WasmBuildNative=true", diff --git a/src/mono/wasm/Wasm.Build.Tests/WasmNativeDefaultsTests.cs b/src/mono/wasm/Wasm.Build.Tests/WasmNativeDefaultsTests.cs index 22bf394ec2a4c4..f3b9a694afa18e 100644 --- a/src/mono/wasm/Wasm.Build.Tests/WasmNativeDefaultsTests.cs +++ b/src/mono/wasm/Wasm.Build.Tests/WasmNativeDefaultsTests.cs @@ -11,6 +11,7 @@ namespace Wasm.Build.Tests { + [TestCategory("native")] public class WasmNativeDefaultsTests : WasmTemplateTestsBase { private static Regex s_regex = new("\\*\\* WasmBuildNative:.*"); diff --git a/src/mono/wasm/Wasm.Build.Tests/WasmSIMDTests.cs b/src/mono/wasm/Wasm.Build.Tests/WasmSIMDTests.cs index 7f034effcf21dc..f0bb792a895dcf 100644 --- a/src/mono/wasm/Wasm.Build.Tests/WasmSIMDTests.cs +++ b/src/mono/wasm/Wasm.Build.Tests/WasmSIMDTests.cs @@ -50,6 +50,7 @@ public async Task Build_NoAOT_ShouldNotRelink(Configuration config, bool aot, bo [MemberData(nameof(MainMethodSimdTestData), parameters: new object[] { /*aot*/ true, /* simd */ true })] [MemberData(nameof(MainMethodSimdTestData), parameters: new object[] { /*aot*/ false, /* simd */ true })] [MemberData(nameof(MainMethodSimdTestData), parameters: new object[] { /*aot*/ true, /* simd */ false })] + [TestCategory("native")] public async Task PublishSIMD_AOT(Configuration config, bool aot, bool simd) { ProjectInfo info = CopyTestAsset(config, aot, TestAsset.WasmBasicTestApp, "simd_publish"); diff --git a/src/mono/wasm/Wasm.Build.Tests/WasmSdkBasedProjectProvider.cs b/src/mono/wasm/Wasm.Build.Tests/WasmSdkBasedProjectProvider.cs index e4988229b8ee37..8c7785ebb2b435 100644 --- a/src/mono/wasm/Wasm.Build.Tests/WasmSdkBasedProjectProvider.cs +++ b/src/mono/wasm/Wasm.Build.Tests/WasmSdkBasedProjectProvider.cs @@ -73,7 +73,7 @@ protected override IReadOnlySet GetDotNetFilesExpectedSet(AssertBundleOp if (assertOptions.AssertSymbolsFile && assertOptions.ExpectSymbolsFile) res.Add("dotnet.native.js.symbols"); - if (assertOptions.BuildOptions.EnableDiagnostics) + if (assertOptions.BuildOptions.EnableDiagnostics || EnvironmentVariables.RuntimeFlavor == "CoreCLR") { res.Add("dotnet.diagnostics.js"); if (!assertOptions.BuildOptions.IsPublish) diff --git a/src/mono/wasm/Wasm.Build.Tests/WorkloadTests.cs b/src/mono/wasm/Wasm.Build.Tests/WorkloadTests.cs index 0889d53091c02a..de371c6091439e 100644 --- a/src/mono/wasm/Wasm.Build.Tests/WorkloadTests.cs +++ b/src/mono/wasm/Wasm.Build.Tests/WorkloadTests.cs @@ -16,6 +16,7 @@ namespace Wasm.Build.Tests { + [TestCategory("native")] public class WorkloadTests : WasmTemplateTestsBase { public WorkloadTests(ITestOutputHelper output, SharedBuildPerTestClassFixture buildContext) diff --git a/src/mono/wasm/testassets/WasmBasicTestApp/App/wwwroot/main.js b/src/mono/wasm/testassets/WasmBasicTestApp/App/wwwroot/main.js index d50d7066655cd5..b732e455ce25c4 100644 --- a/src/mono/wasm/testassets/WasmBasicTestApp/App/wwwroot/main.js +++ b/src/mono/wasm/testassets/WasmBasicTestApp/App/wwwroot/main.js @@ -247,7 +247,7 @@ try { case "OutErrOverrideWorks": case "DotnetRun": case "MainWithArgs": - dotnet.run(); + dotnet.runMainAndExit(); break; case "DebugLevelTest": testOutput("WasmDebugLevel: " + config.debugLevel); diff --git a/src/mono/wasm/testassets/WasmBrowserRunMainOnly/Program.cs b/src/mono/wasm/testassets/WasmBrowserRunMainOnly/Program.cs deleted file mode 100644 index e258162d095c3f..00000000000000 --- a/src/mono/wasm/testassets/WasmBrowserRunMainOnly/Program.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Threading.Tasks; - -class Program -{ - static async Task Main(string[] args) - { - TestOutput.WriteLine("Hello from WasmBrowserRunMainOnly!"); - await Task.Delay(1); - return 0; - } -} \ No newline at end of file diff --git a/src/mono/wasm/testassets/WasmBrowserRunMainOnly/Properties/AssemblyInfo.cs b/src/mono/wasm/testassets/WasmBrowserRunMainOnly/Properties/AssemblyInfo.cs deleted file mode 100644 index 9ad9b578f20649..00000000000000 --- a/src/mono/wasm/testassets/WasmBrowserRunMainOnly/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,4 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -[assembly:System.Runtime.Versioning.SupportedOSPlatform("browser")] diff --git a/src/mono/wasm/testassets/WasmBrowserRunMainOnly/TestOutput.cs b/src/mono/wasm/testassets/WasmBrowserRunMainOnly/TestOutput.cs deleted file mode 100644 index 5755b753b5e492..00000000000000 --- a/src/mono/wasm/testassets/WasmBrowserRunMainOnly/TestOutput.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; - -public static class TestOutput -{ - public static void WriteLine(string message) - { - Console.WriteLine("TestOutput -> " + message); - } - - public static void WriteLine(object message) - { - Console.Write("TestOutput -> "); - Console.WriteLine(message); - } -} diff --git a/src/mono/wasm/testassets/WasmBrowserRunMainOnly/WasmBrowserRunMainOnly.csproj b/src/mono/wasm/testassets/WasmBrowserRunMainOnly/WasmBrowserRunMainOnly.csproj deleted file mode 100644 index 9951d602d915af..00000000000000 --- a/src/mono/wasm/testassets/WasmBrowserRunMainOnly/WasmBrowserRunMainOnly.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - net11.0 - true - true - - - - - - diff --git a/src/mono/wasm/testassets/WasmBrowserRunMainOnly/wwwroot/index.html b/src/mono/wasm/testassets/WasmBrowserRunMainOnly/wwwroot/index.html deleted file mode 100644 index 8fe1b7b4aeb17a..00000000000000 --- a/src/mono/wasm/testassets/WasmBrowserRunMainOnly/wwwroot/index.html +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - WasmBrowserRunMainOnly - - - - - - - - - - - - \ No newline at end of file diff --git a/src/mono/wasm/testassets/WasmBrowserRunMainOnly/wwwroot/main.js b/src/mono/wasm/testassets/WasmBrowserRunMainOnly/wwwroot/main.js deleted file mode 100644 index 6a890e486f2df7..00000000000000 --- a/src/mono/wasm/testassets/WasmBrowserRunMainOnly/wwwroot/main.js +++ /dev/null @@ -1,6 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -import { dotnet } from './_framework/dotnet.js' - -await dotnet.runMainAndExit();