Skip to content
Closed
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
2 changes: 1 addition & 1 deletion eng/Subsets.props
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@
</ItemGroup>

<ItemGroup Condition="$(_subset.Contains('+mono.wasmruntime+'))">
<ProjectToBuild Include="$(MonoProjectRoot)wasm\wasm.proj" Category="mono" />
<ProjectToBuild Include="$(MonoProjectRoot)wasm\wasm.proj" Category="mono" Test="true" />
</ItemGroup>

<ItemGroup Condition="$(_subset.Contains('+libs.pretest+'))">
Expand Down
18 changes: 3 additions & 15 deletions src/mono/wasm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -150,27 +150,15 @@ run-tests-jsc-%:
run-tests-%:
PATH="$(JSVU):$(PATH)" $(DOTNET) build $(TOP)/src/libraries/$*/tests/ /t:Test /p:TargetOS=Browser /p:TargetArchitecture=wasm /p:Configuration=$(CONFIG) $(MSBUILD_ARGS)

build-debugger-test-app:
$(DOTNET) build --configuration debug --nologo /p:TargetArchitecture=wasm /p:TargetOS=Browser /p:Configuration=Debug /p:RuntimeConfiguration=$(CONFIG) $(TOP)/src/mono/wasm/debugger/tests/debugger-test
$(DOTNET) build --configuration debug --nologo /p:TargetArchitecture=wasm /p:TargetOS=Browser /p:Configuration=Debug /p:RuntimeConfiguration=$(CONFIG) $(TOP)/src/mono/wasm/debugger/tests/lazy-debugger-test
$(DOTNET) build --configuration debug --nologo /p:TargetArchitecture=wasm /p:TargetOS=Browser /p:Configuration=Debug /p:RuntimeConfiguration=$(CONFIG) $(TOP)/src/mono/wasm/debugger/tests/lazy-debugger-test-embedded
cp $(TOP)/src/mono/wasm/debugger/tests/debugger-test/debugger-driver.html $(TOP)/src/mono/wasm/debugger/tests/debugger-test/bin/Debug/publish
cp $(TOP)/src/mono/wasm/debugger/tests/debugger-test/other.js $(TOP)/src/mono/wasm/debugger/tests/debugger-test/bin/Debug/publish
cp $(TOP)/src/mono/wasm/debugger/tests/debugger-test/runtime-debugger.js $(TOP)/src/mono/wasm/debugger/tests/debugger-test/bin/Debug/publish
cp $(TOP)/src/mono/wasm/debugger/tests/lazy-debugger-test/bin/Debug/publish/managed/* $(TOP)/src/mono/wasm/debugger/tests/debugger-test/bin/Debug/publish
cp $(TOP)/src/mono/wasm/debugger/tests/lazy-debugger-test-embedded/bin/Debug/publish/managed/* $(TOP)/src/mono/wasm/debugger/tests/debugger-test/bin/Debug/publish

run-debugger-tests: build-debugger-test-app build-dbg-testsuite
run-debugger-tests:
if [ ! -z "$(TEST_FILTER)" ]; then \
export TEST_SUITE_PATH=$(TOP)/src/mono/wasm/debugger/tests/debugger-test/bin/Debug/publish; \
export LC_ALL=en_US.UTF-8; \
$(DOTNET) test $(TOP)/src/mono/wasm/debugger/DebuggerTestSuite --filter FullyQualifiedName~$(TEST_FILTER); \
unset TEST_SUITE_PATH LC_ALL; \
unset LC_ALL; \
else \
export TEST_SUITE_PATH=$(TOP)/src/mono/wasm/debugger/tests/debugger-test/bin/Debug/publish; \
export LC_ALL=en_US.UTF-8; \
$(DOTNET) test $(TOP)/src/mono/wasm/debugger/DebuggerTestSuite $(TEST_ARGS); \
unset TEST_SUITE_PATH LC_ALL; \
unset LC_ALL; \
fi

build-dbg-proxy:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<TargetFramework>$(NetCoreAppCurrent)</TargetFramework>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<RunAnalyzers>false</RunAnalyzers>
<IsUnitTestProject>true</IsUnitTestProject>
</PropertyGroup>

<ItemGroup>
Expand All @@ -16,6 +17,7 @@
<ItemGroup>
<ProjectReference Include="..\BrowserDebugHost\BrowserDebugHost.csproj" />
<ProjectReference Include="..\BrowserDebugProxy\BrowserDebugProxy.csproj" />
<ProjectReference Include="..\tests\debugger-test.csproj" ReferenceOutputAssembly="false" />
</ItemGroup>

</Project>
21 changes: 7 additions & 14 deletions src/mono/wasm/debugger/DebuggerTestSuite/Support.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.IO;
using System.Linq;
using System.Net.WebSockets;
using System.Reflection;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
Expand Down Expand Up @@ -130,20 +131,12 @@ protected static string DebuggerTestAppPath

static protected string FindTestPath()
{
//FIXME how would I locate it otherwise?
var test_path = Environment.GetEnvironmentVariable("TEST_SUITE_PATH");
//Lets try to guest
if (test_path != null && Directory.Exists(test_path))
return test_path;

var cwd = Environment.CurrentDirectory;
Console.WriteLine("guessing from {0}", cwd);
//tests run from DebuggerTestSuite/bin/Debug/netcoreapp2.1
var new_path = Path.Combine(cwd, "../../../../bin/debugger-test-suite");
if (File.Exists(Path.Combine(new_path, "debugger-driver.html")))
return new_path;

throw new Exception("Missing TEST_SUITE_PATH env var and could not guess path from CWD");
var asm_dir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
var test_app_path = Path.Combine(asm_dir, "..", "..", "..", "debugger-test", "Debug", "publish");
if (File.Exists(Path.Combine(test_app_path, "debugger-driver.html")))
return test_app_path;

throw new Exception($"Could not figure out debugger-test app path ({test_app_path}) based on the test suite location ({asm_dir})");
}

static string[] PROBE_LIST = {
Expand Down
17 changes: 13 additions & 4 deletions src/mono/wasm/debugger/tests/debugger-test/debugger-test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
<TargetArchitecture>wasm</TargetArchitecture>
<TargetOS>Browser</TargetOS>
<MicrosoftNetCoreAppRuntimePackDir>$(ArtifactsBinDir)microsoft.netcore.app.runtime.browser-wasm\Release\runtimes\browser-wasm\</MicrosoftNetCoreAppRuntimePackDir>
<BuildDir>$(MSBuildThisFileDirectory)obj\$(Configuration)\wasm</BuildDir>
<AppDir>$(MSBuildThisFileDirectory)bin\$(Configuration)\publish</AppDir>
<RuntimeBuildConfig Condition="'$(RuntimeBuildConfig)' == ''">$(Configuration)</RuntimeBuildConfig>
<Configuration>Debug</Configuration>
<AppDir>$(ArtifactsBinDir)debugger-test\$(Configuration)\publish</AppDir>
<OutDir>$(ArtifactsBinDir)debugger-test\$(Configuration)\wasm</OutDir>
<RuntimeConfiguration>Release</RuntimeConfiguration>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<OutputType>Library</OutputType>
<NoWarn>219</NoWarn>
Expand All @@ -15,6 +16,12 @@
<DebugType>portable</DebugType>
</PropertyGroup>

<ItemGroup>
<ExtraFileForPublish Include="debugger-driver.html" />
<ExtraFileForPublish Include="other.js" />
<ExtraFileForPublish Include="runtime-debugger.js" />
</ItemGroup>

<Target Name="RebuildWasmAppBuilder">
<ItemGroup>
<WasmAppBuildProject Include="$(RepoTasksDir)mobile.tasks\WasmAppBuilder\WasmAppBuilder.csproj" />
Expand All @@ -40,11 +47,13 @@
<WasmAppBuilder
AppDir="$(AppDir)"
MicrosoftNetCoreAppRuntimePackDir="$(MicrosoftNetCoreAppRuntimePackDir)"
MainAssembly="$(ArtifactsBinDir)debugger-test/wasm/Debug/debugger-test.dll"
MainAssembly="$(OutDir)/debugger-test.dll"
MainJS="$(MonoProjectRoot)wasm\runtime-test.js"
DebugLevel="1"
AssemblySearchPaths="@(AssemblySearchPaths)"
ExtraAssemblies="$(ArtifactsBinDir)\System.Private.Runtime.InteropServices.JavaScript\$(NetCoreAppCurrent)-Browser-$(RuntimeConfiguration)\System.Private.Runtime.InteropServices.JavaScript.dll"/>

<Copy SourceFiles="@(ExtraFileForPublish)" DestinationFolder="$(AppDir)" />
<Exec Command="chmod a+x $(AppDir)/run-v8.sh" />
</Target>

Expand Down
6 changes: 6 additions & 0 deletions src/mono/wasm/wasm.proj
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,10 @@
SkipUnchangedFiles="true" />
</Target>

<Target Name="RunDebuggerTests"
AfterTargets="Test"
Condition="'$(TargetOS)' == 'Browser'">
<MSBuild Projects="$(MSBuildThisFileDirectory)/debugger/DebuggerTestSuite/DebuggerTestSuite.csproj" Targets="Test" />
</Target>

</Project>