[wasm] Fix Uint8ClampedArray.From(byte[]) invalid cast (#13790)
[mono-project.git] / netcore / Makefile.am
blob283515a65c8bc4c1159d587c7496434686d30ee5
2 # NETCORETESTS_VERSION and NETCOREAPP_VERSION must be updated in sync, we are using coreclr repo for that but that's fine for now
5 # Extracted MicrosoftPrivateCoreFxNETCoreAppVersion from https://github.com/dotnet/coreclr/blob/master/eng/Versions.props#L11
6 NETCORETESTS_VERSION := 4.6.0-preview4.19202.4
8 # Extracted MicrosoftNETCoreAppVersion from https://github.com/dotnet/coreclr/blob/master/eng/Versions.props#L13
9 NETCOREAPP_VERSION := 3.0.0-preview4-27529-11
11 NETCORESDK_FILE := dotnet-runtime-$(NETCOREAPP_VERSION)-osx-x64.tar.gz
12 URL := https://dotnetcli.blob.core.windows.net/dotnet/Runtime/$(NETCOREAPP_VERSION)/$(NETCORESDK_FILE)
14 $(NETCORESDK_FILE):
15         curl $(URL) --output $(NETCORESDK_FILE)
16         tar -xvf $(NETCORESDK_FILE)
18 build-sample:
19         dotnet build sample/HelloWorld
21 run-sample:
22         COMPlus_DebugWriteToStdErr=1 ./dotnet --fx-version "$(NETCOREAPP_VERSION)" sample/HelloWorld/bin/Debug/netcoreapp3.0/HelloWorld.dll
24 # COREHOST_TRACE=1 
25 SHAREDRUNTIME := shared/Microsoft.NETCore.App/$(NETCOREAPP_VERSION)
27 bcl:
28         $(MAKE) -C ../mcs/class/System.Private.CoreLib
29         cp ../mcs/class/System.Private.CoreLib/bin/x64/System.Private.CoreLib.dll $(SHAREDRUNTIME)
31 runtime:
32         $(MAKE) -C ../mono
33         cp ../mono/mini/.libs/libmonosgen-2.0.dylib $(SHAREDRUNTIME)/libcoreclr.dylib
35 link-mono:
36         cp ../mono/mini/.libs/libmonosgen-2.0.dylib $(SHAREDRUNTIME)/libcoreclr.dylib
37         cp ../mcs/class/System.Private.CoreLib/bin/x64/System.Private.CoreLib.{dll,pdb} $(SHAREDRUNTIME)
39 prepare: $(NETCORESDK_FILE) link-mono
41 nupkg:
42         nuget pack runtime.nuspec -properties VERSION=@VERSION@\;RID=@RID@\;PLATFORM_AOT_SUFFIX=@PLATFORM_AOT_SUFFIX@
44 COREFX_BINDIR=$(COREFX_ROOT)/artifacts/bin
46 check-env:
47         @if [ "x$(COREFX_ROOT)" == "x" ]; then echo "Set COREFX_ROOT to the root of the fully built corefx repo."; exit 1; fi
49 clean:
50         rm -rf sdk shared host dotnet tests LICENSE.txt ThirdPartyNotices.txt $(NETCORESDK_FILE)
53 # Running tests:
55 # We have two modes to run then with xtest-Foo.Test to be the prefered one because it runs all tests and simple runner
56 # with rules like tes-Foo which runs limited set of test
59 # e.g. `make xtest-System.Collections.Tests COREFX_ROOT=/prj/corefx`
60 # '-parallel none -verbose' for debug, `-parallel all` to run all tests in parallel
61 # we need COREFX_ROOT only for xunit.console.deps.json and CoreFx.Private.TestUtilities.dll
62 xtest-%: prepare check-env dl-test-assets
63         echo -n "***************** $* *********************"
64         cp $(COREFX_BINDIR)/runtime/netcoreapp-OSX-Debug-x64/Newtonsoft.Json.dll assets/extracted/$*/
65         cp $(COREFX_BINDIR)/runtime/netcoreapp-OSX-Debug-x64/xunit.console.deps.json assets/extracted/$*/
66         cp $(COREFX_BINDIR)/runtime/netcoreapp-OSX-Debug-x64/CoreFx.Private.TestUtilities.dll assets/extracted/$*/
67         sed -i -e 's/9.9.9/$(NETCOREAPP_VERSION)/g' assets/extracted/$*/*.runtimeconfig.json
68         cd assets/extracted/$* && \
69         COMPlus_DebugWriteToStdErr=1 $(CURDIR)/./dotnet --fx-version "$(NETCOREAPP_VERSION)" xunit.console.dll $*.dll \
70                 -notrait category=outerloop -notrait category=nonosxtests -notrait category=failing \
71                 -notrait category=nonnetcoreapptests \
72                 -html ../../../TestResult-$*.html -nunit ../../TestResult-$*-netcore-xunit.xml \
73                 $(shell if [ -a $(CURDIR)/excludes-$*.rsp ]; then grep -v '^#\|^$$' $(CURDIR)/excludes-$*.rsp; fi;) \
74                 $(FIXTURE) || true
76 # these tests won't be included in `xtestall` (some of them crash runtime, some hang)
77 EXCLUDED_COREFX_TESTS = \
78         System.Diagnostics.Tracing.Tests \
79         System.Net.Http.Functional.Tests \
80         System.Net.HttpListener.Tests \
81         System.Net.NameResolution.Functional.Tests \
82         System.Net.Sockets.Tests
84 # Tests suites which pass
85 PASSING_COREFX_TESTS = \
86         System.Collections.Immutable.Tests \
87         System.Reflection.Extensions.Tests \
88         System.Runtime.CompilerServices.Unsafe.Tests \
89         System.Runtime.CompilerServices.VisualC.Tests \
90         System.Runtime.InteropServices.RuntimeInformation.Tests
92 xtestall: dl-test-assets $(foreach workingtest, $(foreach test, $(wildcard assets/extracted/*), \
93                 $(filter-out $(EXCLUDED_COREFX_TESTS), $(notdir $(test)))), $(addprefix xtest-, $(workingtest)))
95 xtestpass: dl-test-assets $(foreach workingtest, $(foreach test, $(wildcard assets/extracted/*), \
96                 $(filter $(PASSING_COREFX_TESTS), $(notdir $(test)))), $(addprefix xtest-, $(workingtest)))
98 FEED_BASE_URL := https://dotnetfeed.blob.core.windows.net/dotnet-core
99 TEST_ASSETS_URL = $(FEED_BASE_URL)/corefx-tests/$(NETCORETESTS_VERSION)/OSX.x64/netcoreapp/corefx-test-assets.xml
100 corefx-test-assets.xml:
101         curl $(TEST_ASSETS_URL) --output corefx-test-assets.xml
103 dl-test-assets: corefx-test-assets.xml .stamp-dl-test-assets
105 .stamp-dl-test-assets:
106         python dl-test-assets.py corefx-test-assets.xml $(FEED_BASE_URL) assets
107         touch $@
110 # console test runner (obsolete)
112 TEST_SUITES = \
113         System.Runtime.Tests \
114         System.Runtime.CompilerServices.Unsafe.Tests \
115         System.Collections.Tests
117 # The binary directory under $(COREFIX_BINDIR)
118 System.Runtime.CompilerServices.Unsafe.Tests_PROFILE = netstandard-Debug
119 System.Runtime.Tests_PROFILE = netcoreapp-Unix-Debug
120 System.Runtime.Tests_XUNIT_ARGS = @../excludes-System.Runtime.Tests.rsp
121 System.Collections.Tests_PROFILE = netcoreapp-Debug
122 System.Reflection.Emit.Tests_PROFILE = netcoreapp-Debug
123 System.Reflection.Emit.Tests_XUNIT_ARGS = @../excludes-System.Reflection.Emit.Tests.rsp
124 System.Reflection.Emit.ILGeneration.Tests_PROFILE = netcoreapp-Debug
125 System.Reflection.Emit.Lightweight.Tests_PROFILE = netcoreapp-Debug
126 System.Threading.Tests_PROFILE = netcoreapp-Debug
127 System.Threading.Thread.Tests_PROFILE = netcoreapp-Debug
129 build-%: check-env
130         cd gen-xunit-runner && dotnet run ../tests $(COREFX_ROOT) $(COREFX_BINDIR)/$*/$($*_PROFILE)/$*.dll -notrait category=nonosxtests -notrait category=failing -notrait category=Outerloop -notrait category=nonnetcoreapptests $($*_XUNIT_ARGS) $(XUNIT_ARGS)
131         cp $(COREFX_BINDIR)/RemoteExecutorConsoleApp/netstandard-Debug/RemoteExecutorConsoleApp.* tests/$*
132         cp $(COREFX_BINDIR)/System.Runtime.Tests/netcoreapp-Unix-Debug/TestLoadAssembly.dll tests/$*
133         sed -e 's/9.9.9/$(VERSION)/g' < tests/$*/RemoteExecutorConsoleApp.runtimeconfig.json > 2 && mv 2 tests/$*/RemoteExecutorConsoleApp.runtimeconfig.json
134         cd tests/$* && dotnet build
136 run-%: check-env
137         cd tests/$* && MONO_PATH=bin/Debug/netcoreapp3.0 MONO_ENV_OPTIONS="--debug --explicit-null-checks" COMPlus_DebugWriteToStdErr=1 ../../dotnet bin/Debug/netcoreapp3.0/$*-runner.dll
139 build-base: $(addprefix build-, $(TEST_SUITES))
141 check: $(addprefix run-, $(TEST_SUITES))