Removing the TestAllOnes, TestAllZeros, and TestMixOnesZeros methods from the Sse41...
[mono-project.git] / netcore / Makefile
blob496a35e07ced7505f5fa423031c70b6ee712f8a6
1 include ../mcs/build/config.make
4 # NETCORETESTS_VERSION and NETCOREAPP_VERSION must be updated in sync, we are using coreclr repo for that but that's fine for now
7 # Extracted MicrosoftPrivateCoreFxNETCoreAppVersion from https://github.com/dotnet/coreclr/blob/master/eng/Versions.props#L18
8 NETCORETESTS_VERSION := 4.6.0-preview6.19271.5
10 # Extracted MicrosoftNETCoreAppVersion from https://github.com/dotnet/coreclr/blob/master/eng/Versions.props#L22
11 NETCOREAPP_VERSION := 3.0.0-preview6-27720-09
13 # Extracted from https://dotnetcli.blob.core.windows.net/dotnet/aspnetcore/Runtime/master/latest.version
14 ASPNETCOREAPP_VERSION := 3.0.0-preview-18614-0151
16 include roslyn.make
18 ifeq ($(HOST_PLATFORM),win32)
19 NETCORESDK_EXT = zip
20 UNZIPCMD = python -c "import zipfile,sys; zipfile.ZipFile(sys.argv[1], 'r').extractall()"
21 XUNIT_FLAGS =
22 TESTS_PLATFORM = Windows_NT.x64
23 endif
25 ifeq ($(HOST_PLATFORM),macos)
26 NETCORESDK_EXT = tar.gz
27 UNZIPCMD = tar -xvf
28 XUNIT_FLAGS = -notrait category=nonosxtests
29 TESTS_PLATFORM = OSX.x64
30 endif
32 ifeq ($(HOST_PLATFORM),linux)
33 NETCORESDK_EXT = tar.gz
34 UNZIPCMD = tar -xvf
35 XUNIT_FLAGS = -notrait category=nonlinuxtests
36 TESTS_PLATFORM = Linux.x64
37 endif
39 NETCORESDK_FILE := dotnet-runtime-$(NETCOREAPP_VERSION)-$(RID).$(NETCORESDK_EXT)
40 ASPNETCORESDK_FILE := aspnetcore-runtime-$(ASPNETCOREAPP_VERSION)-$(RID).$(NETCORESDK_EXT)
41 NETCORE_URL := https://dotnetcli.blob.core.windows.net/dotnet/Runtime/$(NETCOREAPP_VERSION)/$(NETCORESDK_FILE)
42 ASPNETCORE_URL := https://dotnetcli.blob.core.windows.net/dotnet/aspnetcore/Runtime/$(ASPNETCOREAPP_VERSION)/$(ASPNETCORESDK_FILE)
43 FEED_BASE_URL := https://dotnetfeed.blob.core.windows.net/dotnet-core
44 TEST_ASSETS_URL = $(FEED_BASE_URL)/corefx-tests/$(NETCORETESTS_VERSION)/$(TESTS_PLATFORM)/netcoreapp/corefx-test-assets.xml
46 # used to calculate exact version number for generating nupkg
47 BLAME = $(shell git blame ../configure.ac | grep AC_INIT | cut -f1 -d' ')
48 VERSTUB = .$(shell git rev-list --count $(BLAME)..HEAD)
50 $(NETCORESDK_FILE):
51 curl $(NETCORE_URL) --output $(NETCORESDK_FILE)
52 rm -rf shared/Microsoft.NETCore.App
53 $(UNZIPCMD) $(NETCORESDK_FILE)
55 # AspNetCoreApp contains its own .NET Core Runtime but we don't need it so let's remove it
56 # and update version in Microsoft.AspNetCore.App.runtimeconfig.json to NETCOREAPP_VERSION
57 $(ASPNETCORESDK_FILE):
58 curl $(ASPNETCORE_URL) --output $(ASPNETCORESDK_FILE)
59 $(UNZIPCMD) $(ASPNETCORESDK_FILE)
60 sed -e 's/.*version.*/\"version\": \"$(NETCOREAPP_VERSION)\"/' < shared/Microsoft.AspNetCore.App/$(ASPNETCOREAPP_VERSION)/Microsoft.AspNetCore.App.runtimeconfig.json > 2 && mv 2 shared/Microsoft.AspNetCore.App/$(ASPNETCOREAPP_VERSION)/Microsoft.AspNetCore.App.runtimeconfig.json
62 update-corefx: corefx/.stamp-dl-corefx-$(NETCORETESTS_VERSION)
64 corefx/.stamp-dl-corefx-$(NETCORETESTS_VERSION): corefx-restore.csproj
65 dotnet build corefx-restore.csproj --runtime $(RID) --packages corefx/packages -p:MicrosoftPrivateCoreFxNETCoreAppVersion=$(NETCORETESTS_VERSION) -p:OutputPath=corefx/restore/
66 touch $@
68 update-roslyn: roslyn-restore.csproj roslyn.make
69 dotnet restore roslyn-restore.csproj -p:RoslynVersion=$(ROSLYN_VERSION) --packages roslyn/packages -p:OutputPath=roslyn/restore/
71 update-corefx-tests: corefx/.stamp-dl-corefx-tests-$(NETCORETESTS_VERSION)
73 corefx/.stamp-dl-corefx-tests-$(NETCORETESTS_VERSION):
74 curl $(TEST_ASSETS_URL) --output corefx-test-assets.xml
75 python dl-test-assets.py corefx-test-assets.xml $(FEED_BASE_URL) corefx/tests
76 touch $@
78 run-sample: prepare
79 dotnet build sample/HelloWorld
80 MONO_ENV_OPTIONS="--debug" COMPlus_DebugWriteToStdErr=1 ./dotnet --fx-version "$(NETCOREAPP_VERSION)" sample/HelloWorld/bin/Debug/netcoreapp3.0/HelloWorld.dll
82 run-aspnet-sample: prepare
83 rm -rf sample/AspNetCore/{bin,obj}
84 dotnet publish sample/AspNetCore -c Debug -r $(RID)
85 cp ../mono/mini/.libs/libmonosgen-2.0$(PLATFORM_AOT_SUFFIX) sample/AspNetCore/bin/Debug/netcoreapp3.0/$(RID)/publish/$(PLATFORM_AOT_PREFIX)coreclr$(PLATFORM_AOT_SUFFIX)
86 cp ../mcs/class/System.Private.CoreLib/bin/$(COREARCH)/System.Private.CoreLib.dll sample/AspNetCore/bin/Debug/netcoreapp3.0/$(RID)/publish/
87 COMPlus_DebugWriteToStdErr=1 ./dotnet --fx-version "$(ASPNETCOREAPP_VERSION)" sample/AspNetCore/bin/Debug/netcoreapp3.0/$(RID)/publish/AspNetCore.dll
89 # COREHOST_TRACE=1
90 SHAREDRUNTIME := shared/Microsoft.NETCore.App/$(NETCOREAPP_VERSION)
92 # CORLIB_BUILD_FLAGS="-c Debug" to compile System.Private.CoreLib.dll in debug mode
93 bcl:
94 $(MAKE) -C ../mcs/build/ common/Consts.cs
95 $(MAKE) -C ../mcs/class/System.Private.CoreLib
96 cp ../mcs/class/System.Private.CoreLib/bin/$(COREARCH)/System.Private.CoreLib.{dll,pdb} $(SHAREDRUNTIME)
98 runtime:
99 $(MAKE) -C ../mono
100 cp ../mono/mini/.libs/libmonosgen-2.0$(PLATFORM_AOT_SUFFIX) $(SHAREDRUNTIME)/$(PLATFORM_AOT_PREFIX)coreclr$(PLATFORM_AOT_SUFFIX)
102 link-mono:
103 cp ../mono/mini/.libs/libmonosgen-2.0$(PLATFORM_AOT_SUFFIX) $(SHAREDRUNTIME)/$(PLATFORM_AOT_PREFIX)coreclr$(PLATFORM_AOT_SUFFIX)
104 cp ../mcs/class/System.Private.CoreLib/bin/$(COREARCH)/System.Private.CoreLib.{dll,pdb} $(SHAREDRUNTIME)
106 prepare: $(ASPNETCORESDK_FILE) $(NETCORESDK_FILE) update-corefx update-roslyn link-mono
108 nupkg:
109 dotnet pack roslyn-restore.csproj -p:NuspecFile=runtime.nuspec -p:NuspecProperties=\"RID=$(RID)\;VERSION=$(VERSION)$(VERSTUB)\;PLATFORM_AOT_SUFFIX=$(PLATFORM_AOT_SUFFIX)\;COREARCH=$(COREARCH)\;PLATFORM_AOT_PREFIX=$(PLATFORM_AOT_PREFIX)\" --output ../artifacts/ --no-build
110 dotnet pack roslyn-restore.csproj -p:NuspecFile=metapackage.nuspec -p:NuspecProperties=\"RID=$(RID)\;VERSION=$(VERSION)$(VERSTUB)\;PLATFORM_AOT_SUFFIX=$(PLATFORM_AOT_SUFFIX)\;COREARCH=$(COREARCH)\;PLATFORM_AOT_PREFIX=$(PLATFORM_AOT_PREFIX)\" --output ../artifacts/ --no-build
112 clean:
113 rm -rf sdk shared host dotnet tests obj corefx roslyn LICENSE.txt ThirdPartyNotices.txt $(NETCORESDK_FILE) $(ASPNETCORESDK_FILE)
116 # Running tests:
118 # We have two modes to run then with xtest-Foo.Test to be the prefered one because it runs all tests and simple runner
119 # with rules like tes-Foo which runs limited set of test
122 # e.g. `make xtest-System.Collections.Tests`
123 # '-parallel none -verbose' and MONO_ENV_OPTIONS="--debug" for debug
124 xtest-%: prepare update-corefx-tests
125 echo -n "***************** $* *********************"
126 cp corefx/restore/corefx-restore.deps.json corefx/tests/extracted/$*/xunit.console.deps.json
127 cp corefx/restore/corefx-restore.deps.json corefx/tests/extracted/$*/Microsoft.DotNet.RemoteExecutorHost.deps.json
128 cp corefx/restore/corefx-restore.runtimeconfig.dev.json corefx/tests/extracted/$*/xunit.console.runtimeconfig.dev.json
129 cp corefx/restore/corefx-restore.runtimeconfig.dev.json corefx/tests/extracted/$*/Microsoft.DotNet.RemoteExecutorHost.runtimeconfig.dev.json
130 cp corefx/restore/corefx-restore.dll corefx/tests/extracted/$*/corefx-restore.dll
131 sed -i -e 's/9.9.9/$(NETCOREAPP_VERSION)/g' corefx/tests/extracted/$*/*.runtimeconfig.json
132 cd corefx/tests/extracted/$* && \
133 COMPlus_DebugWriteToStdErr=1 $(CURDIR)/./dotnet --fx-version "$(NETCOREAPP_VERSION)" xunit.console.dll $*.dll \
134 -html ../../TestResult-$*.html -nunit ../../TestResult-$*-netcore-xunit.xml \
135 $(XUNIT_FLAGS) @../../../../CoreFX.issues.rsp \
136 $(FIXTURE) || true
138 # these tests won't be included in `xtestall`
139 EXCLUDED_COREFX_TESTS =
141 xtestall: update-corefx-tests $(foreach workingtest, $(foreach test, $(wildcard corefx/tests/extracted/*), \
142 $(filter-out $(EXCLUDED_COREFX_TESTS), $(notdir $(test)))), $(addprefix xtest-, $(workingtest)))
144 # build a test assembly in COREFX_ROOT and copy it to corefx/tests/extracted
145 # e.g. `make build-local-corefx-test-System.Runtime COREFX_ROOT=/prj/corefx-master`
146 build-local-corefx-test-%: check-env
147 cd $(COREFX_ROOT)/src/$*/tests && dotnet build -o "$(CURDIR)/corefx/tests/extracted/tmp"
148 cp $(CURDIR)/corefx/tests/extracted/tmp/$*.Tests.{dll,pdb} $(CURDIR)/corefx/tests/extracted/$*.Tests/
149 rm -rf $(CURDIR)/corefx/tests/extracted/tmp
152 # console test runner (obsolete)
154 TEST_SUITES = \
155 System.Runtime.Tests \
156 System.Runtime.CompilerServices.Unsafe.Tests \
157 System.Collections.Tests
159 # The binary directory under $(COREFIX_BINDIR)
160 System.Runtime.CompilerServices.Unsafe.Tests_PROFILE = netstandard-Debug
161 System.Runtime.Tests_PROFILE = netcoreapp-Unix-Debug
162 System.Collections.Tests_PROFILE = netcoreapp-Debug
163 System.Reflection.Emit.Tests_PROFILE = netcoreapp-Debug
164 System.Reflection.Emit.ILGeneration.Tests_PROFILE = netcoreapp-Debug
165 System.Reflection.Emit.Lightweight.Tests_PROFILE = netcoreapp-Debug
166 System.Threading.Tests_PROFILE = netcoreapp-Debug
167 System.Threading.Thread.Tests_PROFILE = netcoreapp-Debug
169 COREFX_BINDIR=$(COREFX_ROOT)/artifacts/bin
171 check-env:
172 @if [ "x$(COREFX_ROOT)" == "x" ]; then echo "Set COREFX_ROOT to the root of the fully built corefx repo."; exit 1; fi
174 build-%: check-env
175 cd gen-xunit-runner && dotnet run ../tests $(COREFX_ROOT) $(COREFX_BINDIR)/$*/$($*_PROFILE)/$*.dll $(XUNIT_FLAGS) @../CoreFX.issues.rsp $(XUNIT_ARGS)
176 cp $(COREFX_BINDIR)/RemoteExecutorConsoleApp/netstandard-Debug/RemoteExecutorConsoleApp.* tests/$*
177 cp $(COREFX_BINDIR)/System.Runtime.Tests/netcoreapp-Unix-Debug/TestLoadAssembly.dll tests/$*
178 sed -e 's/9.9.9/$(VERSION)/g' < tests/$*/RemoteExecutorConsoleApp.runtimeconfig.json > 2 && mv 2 tests/$*/RemoteExecutorConsoleApp.runtimeconfig.json
179 cd tests/$* && dotnet build
181 run-%: check-env
182 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
184 build-base: $(addprefix build-, $(TEST_SUITES))
186 check: $(addprefix run-, $(TEST_SUITES))
188 distdir: