[bcl] Split corlib and System.Core xunit test assemblies for monotouch profiles (#18228)

They cannot deal with large test assemblies so we need to split them.

We're doing this by introducing a new `#skip <PROFILE>` directive in the .sources format which defines where to split the assembly.
The logic is very simple: files up until the first `#skip` are common files which get included in each part, subsequent files are only in the respective part assembly.

Fixes https://github.com/mono/mono/issues/18213
This commit is contained in:
Alexander Köplinger authored and GitHub committed 2019-12-18 21:11:17 +01:00
1 parent 2ff93e4c76
commit 3891fe97d2
10 files changed
+261 -183

No files matched your search

+56 -41
View File
@@ -89,26 +89,32 @@ endif
test_lib = $(PROFILE)_$(ASSEMBLY:$(ASSEMBLY_EXT)=_test.dll)
test_lib_output = $(test_lib_dir)/$(test_lib)
test_sourcefile_base_excludes = $(test_lib).exclude.sources
test_library = $(ASSEMBLY:$(ASSEMBLY_EXT)=)_test$(ASSEMBLY_EXT)
test_response = $(depsdir)/$(PROFILE_PLATFORM)_$(PROFILE)_$(test_library).response
test_makefrag = $(depsdir)/$(PROFILE_PLATFORM)_$(PROFILE)_$(test_library).makefrag
test_pdb = $(test_lib:.dll=.pdb)
test_flags = $(test_nunit_ref) $(TEST_MCS_FLAGS) $(TEST_LIB_MCS_FLAGS)
ifndef NO_BUILD
test_flags += -r:$(the_assembly)
test_assembly_dep = $(the_assembly)
endif
tests_CLEAN_FILES += $(test_lib_output) $(test_lib_output:$(ASSEMBLY_EXT)=.pdb)
tests_CLEAN_FILES += $(test_lib_output) $(test_response) $(test_makefrag)
xtest_sourcefile_base = $(PROFILE_PLATFORM)_$(PROFILE)_$(ASSEMBLY:$(ASSEMBLY_EXT)=_xtest.dll.sources)
xtest_sourcefile_base_excludes_full = $(PROFILE_PLATFORM)_$(PROFILE)_$(ASSEMBLY:$(ASSEMBLY_EXT)=_xtest.dll.exclude.sources)
xtest_sourcefile_base_excludes = $(xtest_sourcefile_base_excludes_full:_%=%)
xunit_test_lib = $(PROFILE)_$(ASSEMBLY:$(ASSEMBLY_EXT)=_xunit-test.dll)
xtest_lib_output = $(test_lib_dir)/$(xunit_test_lib)
xtest_response = $(depsdir)/$(xunit_test_lib).response
xtest_makefrag = $(depsdir)/$(xunit_test_lib).makefrag
xtest_flags = -r:$(the_assembly) $(xunit_libs_ref) $(XTEST_MCS_FLAGS) $(XTEST_LIB_MCS_FLAGS) /unsafe
xtest_library = $(ASSEMBLY:$(ASSEMBLY_EXT)=)_xtest$(ASSEMBLY_EXT)
xtest_response = $(depsdir)/$(PROFILE_PLATFORM)_$(PROFILE)_$(xtest_library).response
xtest_makefrag = $(depsdir)/$(PROFILE_PLATFORM)_$(PROFILE)_$(xtest_library).makefrag
xtest_flags = $(xunit_libs_ref) $(XTEST_MCS_FLAGS) $(XTEST_LIB_MCS_FLAGS) /unsafe
ifndef NO_BUILD
xtest_flags += -r:$(the_assembly)
xtest_assembly_dep = $(the_assembly)
endif
ifeq ($(wildcard $(xtest_sourcefile_base)),)
xtest_sourcefile_base = $(ASSEMBLY:$(ASSEMBLY_EXT)=_xtest.dll.sources)
@@ -140,6 +146,10 @@ test_assemblies :=
ifdef HAVE_CS_TESTS
test_assemblies += $(test_lib_output)
ifdef TEST_SPLIT_ASSEMBLIES
test_assemblies += $(test_lib_output:.dll=.part1.dll) $(test_lib_output:.dll=.part2.dll)
endif
check: run-test
test-local: $(test_assemblies) $(test_lib_dir)/nunit-excludes.txt
run-test-local: run-test-lib
@@ -262,44 +272,34 @@ endif
TEST_FILES =
ifdef HAVE_CS_TESTS
TEST_FILES += `sed -e '/^$$/d' -e 's,^../,,' -e '/^\#.*$$/d' -et -e 's,^,Test/,' $(test_sourcefile_base)`
endif
ifdef HAVE_CS_TESTS
TEST_FILES += `sed -e '/^$$/d' -e 's,^../,,' -e '/^\#.*$$/d' -et -e 's,^,Test/,' $(test_sourcefile_base)`
$(test_lib_dir):
mkdir -p $@
test_library = $(ASSEMBLY:$(ASSEMBLY_EXT)=)_test$(ASSEMBLY_EXT)
test_sourcefile = $(depsdir)/$(PROFILE_PLATFORM)_$(PROFILE)_$(test_library).sources
$(test_sourcefile): $(test_sourcefile_base) $(wildcard *_test.dll.sources) $(wildcard *_test.dll.exclude.sources) $(depsdir)/.stamp
$(GENSOURCES) --basedir:./Test --strict --platformsdir:$(topdir)/build "$@" "$(test_library)" "$(PROFILE_PLATFORM)" "$(PROFILE)"
test_response = $(depsdir)/$(PROFILE_PLATFORM)_$(PROFILE)_$(test_library).response
$(test_response): $(test_sourcefile) $(topdir)/build/tests.make $(depsdir)/.stamp
$(PLATFORM_CHANGE_SEPARATOR_CMD) <$(test_sourcefile) >$@
test_makefrag = $(depsdir)/$(PROFILE_PLATFORM)_$(PROFILE)_$(test_library).makefrag
$(test_makefrag): $(test_sourcefile) $(topdir)/build/tests.make $(depsdir)/.stamp
@echo Creating $@ ...
@sed 's,^,$(build_lib): ,' $< >$@
@if test ! -f $(test_sourcefile).makefrag; then :; else \
cat $(test_sourcefile).makefrag >> $@ ; \
echo '$@: $(test_sourcefile).makefrag' >> $@; \
echo '$(test_sourcefile).makefrag:' >> $@; fi
$(test_lib_output): $(test_assembly_dep) $(test_response) $(test_nunit_dep) $(test_lib_output).nunitlite.config | $(test_lib_dir)
$(TEST_COMPILE) $(LIBRARY_FLAGS) -target:library -out:$@ $(test_flags) $(LOCAL_TEST_COMPILER_ONDOTNET_FLAGS) @$(test_response)
tests_CLEAN_FILES += $(test_sourcefile) $(test_response) $(test_makefrag)
ifdef TEST_SPLIT_ASSEMBLIES
$(test_lib_output:.dll=.part1.dll): $(test_lib_output) $(test_response).part1
$(TEST_COMPILE) $(LIBRARY_FLAGS) -target:library -out:$@ $(test_flags) $(LOCAL_TEST_COMPILER_ONDOTNET_FLAGS) @$(test_response).part1
$(test_lib_output:.dll=.part2.dll): $(test_lib_output) $(test_response).part2
$(TEST_COMPILE) $(LIBRARY_FLAGS) -target:library -out:$@ $(test_flags) $(LOCAL_TEST_COMPILER_ONDOTNET_FLAGS) @$(test_response).part2
tests_CLEAN_FILES += $(test_response).part1 $(test_response).part2
endif
$(test_response): $(test_sourcefile_base) $(wildcard *_test.dll.sources) $(wildcard *_test.dll.exclude.sources) $(topdir)/build/tests.make $(depsdir)/.stamp
$(GENSOURCES) --basedir:./Test --strict --platformsdir:$(topdir)/build "$@" "$(test_library)" "$(PROFILE_PLATFORM)" "$(PROFILE)"
$(test_makefrag): $(test_response)
@echo Creating $@ ...
@sed 's,^,$(test_lib_output) $(test_lib_output:.dll=.part1.dll) $(test_lib_output:.dll=.part2.dll): ,' $< >$@
-include $(test_makefrag)
build-test-lib: $(test_lib_output)
@echo Building testing lib
endif
@@ -336,8 +336,15 @@ ifdef COVERAGE
XTEST_COVERAGE_FLAGS = -O=-aot --profile=coverage:output=$(topdir)/class/lib/$(PROFILE_DIRECTORY)/coverage_xunit_$(ASSEMBLY).xml
endif
xtest_assemblies += $(xtest_lib_output)
ifdef XTEST_SPLIT_ASSEMBLIES
xtest_assemblies += $(xtest_lib_output:.dll=.part1.dll) $(xtest_lib_output:.dll=.part2.dll)
endif
check: run-xunit-test-local
xunit-test-local: $(xtest_lib_output) $(test_lib_dir)/xunit-excludes.txt $(test_lib_dir)/Xunit.NetCore.Extensions.dll $(test_lib_dir)/xunit.execution.dotnet.dll
xunit-test-local: $(xtest_assemblies) $(test_lib_dir)/xunit-excludes.txt $(test_lib_dir)/Xunit.NetCore.Extensions.dll $(test_lib_dir)/xunit.execution.dotnet.dll
run-xunit-test-local: run-xunit-test-lib
$(test_lib_dir)/xunit-excludes.txt: $(topdir)/build/tests.make | $(test_lib_dir)
@@ -360,19 +367,27 @@ run-xunit-test-lib: xunit-test-local
$(XTEST_REMOTE_EXECUTOR): $(topdir)/../external/corefx/src/Common/tests/System/Diagnostics/RemoteExecutorConsoleApp/RemoteExecutorConsoleApp.cs | $(test_lib_dir)
$(TEST_COMPILE) -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll $< -out:$@
$(xtest_lib_output): $(the_assembly) $(xtest_response) $(xunit_libs_dep) $(xunit_src) $(XTEST_REMOTE_EXECUTOR) | $(test_lib_dir)
$(xtest_lib_output): $(xtest_assembly_dep) $(xtest_response) $(xunit_libs_dep) $(xunit_src) $(XTEST_REMOTE_EXECUTOR) | $(test_lib_dir)
$(TEST_COMPILE) $(LIBRARY_FLAGS) $(XTEST_LIB_FLAGS) -target:library -out:$@ $(xtest_flags) @$(xtest_response) $(xunit_src)
xtest_response_preprocessed = $(xtest_response)_preprocessed
ifdef XTEST_SPLIT_ASSEMBLIES
$(xtest_lib_output:.dll=.part1.dll): $(xtest_lib_output) $(xtest_response).part1
$(TEST_COMPILE) $(LIBRARY_FLAGS) $(XTEST_LIB_FLAGS) -target:library -out:$@ $(xtest_flags) @$(xtest_response).part1 $(xunit_src)
$(xtest_lib_output:.dll=.part2.dll): $(xtest_lib_output) $(xtest_response).part2
$(TEST_COMPILE) $(LIBRARY_FLAGS) $(XTEST_LIB_FLAGS) -target:library -out:$@ $(xtest_flags) @$(xtest_response).part2 $(xunit_src)
xtests_CLEAN_FILES += $(xtest_response).part1 $(xtest_response).part2
endif
# This handles .excludes/.sources pairs, as well as resolving the
# includes that occur in .sources files
$(xtest_response): $(xtest_sourcefile_base) $(wildcard *xtest.dll.sources) $(wildcard $(xtest_sourcefile_base_excludes))
$(GENSOURCES) --strict --platformsdir:$(topdir)/build "$@" "$(xtest_sourcefile_base)" "$(xtest_sourcefile_base_excludes)"
# includes that occur in .sources files. It also handles splitting test assemblies into multiple parts.
$(xtest_response): $(xtest_sourcefile_base) $(wildcard *_xtest.dll.sources) $(wildcard *_xtest.dll.exclude.sources) $(topdir)/build/tests.make $(depsdir)/.stamp
$(GENSOURCES) --strict --platformsdir:$(topdir)/build "$@" "$(xtest_library)" "$(PROFILE_PLATFORM)" "$(PROFILE)"
$(xtest_makefrag): $(xtest_response)
$(xtest_makefrag): $(xtest_response) $(xtest_response_parts)
@echo Creating $@ ...
@sed 's,^,$(xtest_lib_output): ,' $< >$@
@sed 's,^,$(xtest_lib_output) $(xtest_lib_output:.dll=.part1.dll) $(xtest_lib_output:.dll=.part2.dll): ,' $< >$@
-include $(xtest_makefrag)
+2
View File
@@ -62,4 +62,6 @@ XTEST_LIB_REFS = System Facades/System.Threading.Tasks Microsoft.CSharp Facades/
XTEST_LIB_FLAGS = -unsafe -d:FEATURE_COMPILE
XTEST_RESX_RESOURCE_STRING = ../../../external/corefx/src/System.Collections.Immutable/src/Resources/Strings.resx
XTEST_SPLIT_ASSEMBLIES := $(filter monotouch%, $(PROFILE))
include ../../build/library.make
@@ -3,12 +3,10 @@
../../../external/corefx/src/CoreFx.Private.TestUtilities/src/System/AssertExtensions.cs
../../../external/corefx/src/Common/tests/System/Threading/Tasks/TaskTimeoutExtensions.cs
# System.Linq
# TODO: ../../../external/corefx/src/System.Linq/tests/*.cs
# System.Linq.Queryable
../../../external/corefx/src/System.Linq.Queryable/tests/*.cs
../../../external/corefx/src/Common/tests/System/Linq/SkipTakeData.cs
#split monotouch
#split monotouch_tv
#split monotouch_watch
# System.Linq.Expressions
../../../external/corefx/src/System.Linq.Expressions/tests/Array/*.cs:NewArrayBoundsTests.cs,ArrayAccessTests.cs,ArrayIndexTests.cs
@@ -56,7 +54,19 @@
../../../external/corefx/src/System.Linq.Expressions/tests/Unary/IncDecAssign/*.cs
../../../external/corefx/src/System.Linq.Expressions/tests/*.cs:StackSpillerTests.cs,ReadOnlyCollectionBuilderTests.cs
# System.Linq.Expressions
#split monotouch
#split monotouch_tv
#split monotouch_watch
# System.Linq
# TODO: ../../../external/corefx/src/System.Linq/tests/*.cs
# System.Linq.Queryable
../../../external/corefx/src/System.Linq.Queryable/tests/*.cs
../../../external/corefx/src/Common/tests/System/Linq/SkipTakeData.cs
# System.Linq.Parallel
../../../external/corefx/src/System.Linq.Parallel/tests/Combinatorial/*.cs
../../../external/corefx/src/System.Linq.Parallel/tests/Helpers/*.cs
../../../external/corefx/src/System.Linq.Parallel/tests/QueryOperators/*.cs:DefaultIfEmptyTests.cs,SingleSingleOrDefaultTests.cs
@@ -2,16 +2,15 @@ thisdir = class/System.Net.Http/FunctionalTests
SUBDIRS =
include ../../../build/rules.make
ASSEMBLY = System.Net.Http.FunctionalTests
LIBRARY = System.Net.Http.FunctionalTests.dll
NO_BUILD = yes
NO_INSTALL = yes
XTEST_LIB_REFS = System System.Core Facades/System.Threading.Tasks
XTEST_LIB_REFS = System System.Core Facades/System.Threading.Tasks System.Net.Http
USE_XTEST_REMOTE_EXECUTOR = YES
XTEST_LIB_FLAGS = /resource:../../System/Test/TestData/testservereku.contoso.com.pfx
the_assembly = $(topdir)/class/lib/$(PROFILE_DIRECTORY)/System.Net.Http.dll
include ../../../build/tests.make
include ../../../build/library.make
TEST_RUNTIME := MONO_URI_DOTNETRELATIVEORABSOLUTE=true $(TEST_RUNTIME)
+4 -4
View File
@@ -2,15 +2,15 @@ thisdir = class/System.Net.Http/UnitTests
SUBDIRS =
include ../../../build/rules.make
ASSEMBLY = System.Net.Http.UnitTests
LIBRARY = System.Net.Http.UnitTests.dll
NO_BUILD = yes
NO_INSTALL = yes
XTEST_LIB_REFS = System System.Core Facades/System.Threading.Tasks
USE_XTEST_REMOTE_EXECUTOR = YES
XTEST_MCS_FLAGS = -nowarn:436
include ../../../build/tests.make
xtest_flags = $(xunit_libs_ref) $(XTEST_MCS_FLAGS) $(XTEST_LIB_MCS_FLAGS) /unsafe
include ../../../build/library.make
clean-local:
-rm -f $(tests_CLEAN_FILES) $(CLEAN_FILES)
Whitespace-only changes.
+1
View File
@@ -173,6 +173,7 @@ LIB_MCS_FLAGS += -d:FEATURE_CRYPTO_CONFIGURABLE
TEST_MCS_FLAGS += -d:FEATURE_CRYPTO_CONFIGURABLE
endif
XTEST_SPLIT_ASSEMBLIES := $(filter monotouch%, $(PROFILE))
CC_PROFILE := $(filter monotouch% xammac, $(PROFILE))
ifdef CC_PROFILE
+121 -108
View File
@@ -15,12 +15,19 @@ corefx/GlobalizationMode.cs
../../../external/corefx/src/Common/tests/System/Security/Cryptography/ByteUtils.cs
../../../external/corefx/src/Common/tests/System/ShouldNotBeInvokedException.cs
../../../external/corefx/src/System.Reflection/tests/Common.cs
../../../external/corefx/src/System.Reflection/tests/TypeInfoTests.cs
#split monotouch
#split monotouch_tv
#split monotouch_watch
#../../../external/corefx/src/System.Globalization/tests/CompareInfo/*.cs:
../../../external/corefx/src/System.Reflection.Emit/tests/Utilities.cs
../../../external/corefx/src/System.Reflection/tests/Common.cs
../../../external/corefx/src/System.Reflection/tests/*.cs:AssemblyTests.cs,AssemblyTests.netcoreapp.cs,AssemblyNameTests.cs,MethodInfoTests.cs
../../../external/corefx/src/System.Reflection.Extensions/tests/Definitions/PropertyDefinitions.cs
../../../external/corefx/src/System.Reflection.Extensions/tests/*.cs
@@ -207,56 +214,74 @@ corefx/GlobalizationMode.cs
# FIXME: this is internal in corlib
../../../external/corefx/src/Common/src/System/MutableDecimal.cs
# System.Collections
../../../external/corefx/src/Common/tests/System/Collections/CollectionAsserts.cs
../../../external/corefx/src/Common/tests/System/Collections/TestBase.NonGeneric.cs
../../../external/corefx/src/Common/tests/System/Collections/TestBase.Generic.cs
../../../external/corefx/src/Common/tests/System/Collections/TestingTypes.cs
../../../external/corefx/src/Common/tests/System/Collections/IList.NonGeneric.Tests.cs
../../../external/corefx/src/Common/tests/System/Collections/IList.Generic.Tests.cs
../../../external/corefx/src/Common/tests/System/Collections/ICollection.NonGeneric.Tests.cs
../../../external/corefx/src/Common/tests/System/Collections/ICollection.Generic.Tests.cs
../../../external/corefx/src/Common/tests/System/Collections/IDictionary.NonGeneric.Tests.cs
../../../external/corefx/src/Common/tests/System/Collections/IDictionary.Generic.Tests.cs
#../../../external/corefx/src/Common/tests/System/Collections/IEnumerable.NonGeneric.Serialization.Tests.cs
../../../external/corefx/src/Common/tests/System/Collections/IEnumerable.NonGeneric.Tests.cs
#../../../external/corefx/src/Common/tests/System/Collections/IEnumerable.Generic.Serialization.Tests.cs
../../../external/corefx/src/Common/tests/System/Collections/IEnumerable.Generic.Tests.cs
../../../external/corefx/src/Common/tests/System/Collections/ISet.Generic.Tests.cs
../../../external/corefx/src/Common/tests/System/Collections/IGenericSharedAPI.Tests.cs
../../../external/corefx/src/Common/tests/System/EnumTypes.cs
../../../external/corefx/src/Common/tests/System/ObjectCloner.cs
../../../external/corefx/src/Common/tests/System/Diagnostics/DebuggerAttributes.cs
../../../external/corefx/src/System.Collections/tests/Generic/SortedSet/*.cs:SortedSet.TreeSubSet.Tests.cs
../../../external/corefx/src/System.Collections/tests/Generic/Stack/*.cs
../../../external/corefx/src/System.Collections/tests/Generic/SortedList/*.cs
../../../external/corefx/src/System.Collections/tests/Generic/SortedDictionary/*.cs
../../../external/corefx/src/System.Collections/tests/Generic/Queue/*.cs
../../../external/corefx/src/System.Collections/tests/Generic/List/*.cs
../../../external/corefx/src/System.Collections/tests/Generic/LinkedList/*.cs
../../../external/corefx/src/System.Collections/tests/Generic/Dictionary/HashCollisionScenarios/*.cs
../../../external/corefx/src/System.Collections/tests/Generic/Dictionary/*.cs
../../../external/corefx/src/System.Collections/tests/Generic/Comparers/*.cs:EqualityComparer.Tests.cs
../../../external/corefx/src/System.Collections/tests/BitArray/*.cs:BitArray_GetSetTests.cs
../../../external/corefx/src/System.Collections/tests/*.cs
# System.Runtime.Extensions
../../../external/corefx/src/System.Runtime.Extensions/tests/System/Diagnostics/*.cs
../../../external/corefx/src/System.Runtime.Extensions/tests/System/Runtime/Versioning/*.cs:VersioningHelperTests.cs
../../../external/corefx/src/System.Runtime.Extensions/tests/System/*.cs:AppDomainTests.cs,Environment.Exit.cs,Environment.GetCommandLineArgs.cs,Environment.GetEnvironmentVariable.cs,Environment.SetEnvironmentVariable.cs,EnvironmentTests.cs,Environment.StackTrace.cs,MarshalByRefObjectTest.cs,StringComparer.cs,StringComparer.netcoreapp.cs,UnloadingAndProcessExitTests.netcoreapp.cs,Environment.UserDomainName.cs,Environment.MachineName.cs
# System.Collections.NonGeneric
#../../../external/corefx/src/System.Collections.NonGeneric/tests/ArrayList/*.cs
../../../external/corefx/src/System.Collections.NonGeneric/tests/Hashtable/*.cs
../../../external/corefx/src/System.Collections.NonGeneric/tests/*.cs:SortedListTests.cs,CollectionBaseTests.cs,DictionaryBaseTests.cs,ArrayListTests.cs,ReadOnlyCollectionBaseTests.cs
# System.Runtime.InteropServices
../../../external/corefx/src/System.Runtime.InteropServices/tests/System/Runtime/CompilerServices/*.cs
../../../external/corefx/src/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/*.cs:MarshalTests.cs,GCHandleTests.cs,SafeBufferTests.cs,ComEventsHelperTests.cs,RuntimeEnvironmentTests.cs,DispatchWrapperTests.cs,ArrayWithOffsetTests.cs,SetWin32ContextInIDispatchAttributeTests.cs,ComAwareEventInfoTests.cs,IDispatchImplAttributeTests.cs,ComAwareEventInfoTests.Windows.cs,MarshalTests.Windows.cs
# System.Collections.Concurrent
../../../external/corefx/src/System.Collections.Concurrent/tests/ConcurrentDictionary/*.cs
../../../external/corefx/src/System.Collections.Concurrent/tests/*.cs:ProducerConsumerCollectionTests.cs,EtwTests.cs,ConcurrentBagTests.cs,ConcurrentQueueTests.cs,ConcurrentStackTests.cs
# System.IO.MemoryStream
../../../external/corefx/src/System.IO/tests/MemoryStream/*.cs
../../../external/corefx/src/Common/tests/System/IO/DelegateStream.cs
# System.Collections.Specialized
../../../external/corefx/src/System.Collections.Specialized/tests/StringDictionary/*.cs
../../../external/corefx/src/System.Collections.Specialized/tests/NameObjectCollectionBase/*.cs:NameObjectCollectionBase.KeysTests.cs,NameObjectCollectionBase.CopyToTests.cs
#../../../external/corefx/src/System.Collections.Specialized/tests/NameValueCollection/*.cs
../../../external/corefx/src/System.Collections.Specialized/tests/ListDictionary/*.cs
../../../external/corefx/src/System.Collections.Specialized/tests/HybridDictionary/*.cs
../../../external/corefx/src/System.Collections.Specialized/tests/OrderedDictionary/*.cs
../../../external/corefx/src/System.Collections.Specialized/tests/*.cs:StringCollectionTests.cs
# System.IO.UnmanagedMemoryStream
../../../external/corefx/src/System.IO.UnmanagedMemoryStream/tests/*.cs
# System.IO.TextReader/StreamReader
../../../external/corefx/src/System.IO/tests/TextReader/*.cs
../../../external/corefx/src/System.IO/tests/StreamReader/*.cs
../../../external/corefx/src/System.IO/tests/TestDataProvider/TestDataProvider.cs
# System.IO.Stream
../../../external/corefx/src/Common/tests/System/IO/CallTrackingStream.cs
../../../external/corefx/src/System.IO/tests/Stream/*.cs
# System.IO.BufferedStream
../../../external/corefx/src/System.IO/tests/StreamWriter/StreamWriter.CloseTests.cs
../../../external/corefx/src/System.IO/tests/StreamWriter/StreamWriter.WriteTests.cs
../../../external/corefx/src/System.IO/tests/StreamWriter/StreamWriter.FlushTests.cs
../../../external/corefx/src/System.IO/tests/BinaryWriter/BinaryWriterTests.cs
../../../external/corefx/src/System.IO/tests/BinaryWriter/BinaryWriter.WriteTests.cs
../../../external/corefx/src/System.IO/tests/BinaryWriter/BinaryWriter.WriteByteCharTests.cs
../../../external/corefx/src/System.IO/tests/StreamReader/StreamReaderTests.cs
../../../external/corefx/src/System.IO/tests/TestDataProvider/TestDataProvider.cs
../../../external/corefx/src/Common/tests/System/IO/WrappedMemoryStream.cs
../../../external/corefx/src/System.IO/tests/BufferedStream/*.cs
# FileSystem Helper (not used on Windows)
../../../external/corefx/src/System.IO.FileSystem/tests/FileSystemTest.Unix.cs
# System.IO.FileInfo
../../../external/corefx/src/Common/tests/System/IO/TempFile.cs
../../../external/corefx/src/Common/tests/System/IO/PathFeatures.cs
../../../external/corefx/src/System.IO.FileSystem/tests/TestData.cs
../../../external/corefx/src/System.IO.FileSystem/tests/FSAssert.cs
../../../external/corefx/src/CoreFx.Private.TestUtilities/src/System/AdminHelpers.cs
../../../external/corefx/src/CoreFx.Private.TestUtilities/src/System/TheoryExtensions.cs
../../../external/corefx/src/System.IO.FileSystem/tests/Base/*.cs:StaticGetSetTimes.cs
../../../external/corefx/src/System.IO.FileSystem/tests/File/*.cs:GetSetTimes.cs
../../../external/corefx/src/System.IO.FileSystem/tests/FileStream/ctor_*.cs
../../../external/corefx/src/System.IO.FileSystem/tests/PortedCommon/*.cs
../../../external/corefx/src/System.IO.FileSystem/tests/FileSystemTest.cs
../../../external/corefx/src/System.IO.FileSystem/tests/FileInfo/*.cs:GetSetTimes.cs
# System.IO.Directory
../../../external/corefx/src/System.IO.FileSystem/tests/Directory/*.cs:GetSetTimes.cs
# System.IO.DirectoryInfo
../../../external/corefx/src/System.IO.FileSystem/tests/DirectoryInfo/*.cs:GetSetTimes.cs
# System.IO.TextWriter/StreamWriter
../../../external/corefx/src/System.IO/tests/TextReader/*.cs
../../../external/corefx/src/System.IO/tests/StreamReader/*.cs
#split monotouch
#split monotouch_tv
#split monotouch_watch
# System.Runtime
../../../external/corefx/src/System.Runtime/tests/System/AccessViolationExceptionTests.cs
@@ -341,66 +366,54 @@ corefx/GlobalizationMode.cs
../../../external/corefx/src/System.Runtime/tests/System/Text/*.cs
../../../external/corefx/src/System.Runtime/tests/System/Runtime/CompilerServices/*.cs:RuntimeHelpersTests.netcoreapp.cs,ConditionalWeakTableTests.netcoreapp.cs,ConditionalWeakTableTests.cs
# System.Runtime.Extensions
../../../external/corefx/src/System.Runtime.Extensions/tests/System/Diagnostics/*.cs
../../../external/corefx/src/System.Runtime.Extensions/tests/System/Runtime/Versioning/*.cs:VersioningHelperTests.cs
../../../external/corefx/src/System.Runtime.Extensions/tests/System/*.cs:AppDomainTests.cs,Environment.Exit.cs,Environment.GetCommandLineArgs.cs,Environment.GetEnvironmentVariable.cs,Environment.SetEnvironmentVariable.cs,EnvironmentTests.cs,Environment.StackTrace.cs,MarshalByRefObjectTest.cs,StringComparer.cs,StringComparer.netcoreapp.cs,UnloadingAndProcessExitTests.netcoreapp.cs,Environment.UserDomainName.cs,Environment.MachineName.cs
# System.Collections
../../../external/corefx/src/Common/tests/System/Collections/CollectionAsserts.cs
../../../external/corefx/src/Common/tests/System/Collections/TestBase.NonGeneric.cs
../../../external/corefx/src/Common/tests/System/Collections/TestBase.Generic.cs
../../../external/corefx/src/Common/tests/System/Collections/TestingTypes.cs
../../../external/corefx/src/Common/tests/System/EnumTypes.cs
../../../external/corefx/src/Common/tests/System/ObjectCloner.cs
../../../external/corefx/src/Common/tests/System/Diagnostics/DebuggerAttributes.cs
../../../external/corefx/src/Common/tests/System/Collections/IList.NonGeneric.Tests.cs
../../../external/corefx/src/Common/tests/System/Collections/IList.Generic.Tests.cs
../../../external/corefx/src/Common/tests/System/Collections/ICollection.NonGeneric.Tests.cs
../../../external/corefx/src/Common/tests/System/Collections/ICollection.Generic.Tests.cs
../../../external/corefx/src/Common/tests/System/Collections/IDictionary.NonGeneric.Tests.cs
../../../external/corefx/src/Common/tests/System/Collections/IDictionary.Generic.Tests.cs
#../../../external/corefx/src/Common/tests/System/Collections/IEnumerable.NonGeneric.Serialization.Tests.cs
../../../external/corefx/src/Common/tests/System/Collections/IEnumerable.NonGeneric.Tests.cs
#../../../external/corefx/src/Common/tests/System/Collections/IEnumerable.Generic.Serialization.Tests.cs
../../../external/corefx/src/Common/tests/System/Collections/IEnumerable.Generic.Tests.cs
../../../external/corefx/src/Common/tests/System/Collections/ISet.Generic.Tests.cs
../../../external/corefx/src/Common/tests/System/Collections/IGenericSharedAPI.Tests.cs
../../../external/corefx/src/System.Collections/tests/Generic/SortedSet/*.cs:SortedSet.TreeSubSet.Tests.cs
../../../external/corefx/src/System.Collections/tests/Generic/Stack/*.cs
../../../external/corefx/src/System.Collections/tests/Generic/SortedList/*.cs
../../../external/corefx/src/System.Collections/tests/Generic/SortedDictionary/*.cs
../../../external/corefx/src/System.Collections/tests/Generic/Queue/*.cs
../../../external/corefx/src/System.Collections/tests/Generic/List/*.cs
../../../external/corefx/src/System.Collections/tests/Generic/LinkedList/*.cs
../../../external/corefx/src/System.Collections/tests/Generic/Dictionary/HashCollisionScenarios/*.cs
../../../external/corefx/src/System.Collections/tests/Generic/Dictionary/*.cs
../../../external/corefx/src/System.Collections/tests/Generic/Comparers/*.cs:EqualityComparer.Tests.cs
../../../external/corefx/src/System.Collections/tests/BitArray/*.cs:BitArray_GetSetTests.cs
../../../external/corefx/src/System.Collections/tests/*.cs
# System.Runtime.InteropServices
../../../external/corefx/src/System.Runtime.InteropServices/tests/System/Runtime/CompilerServices/*.cs
../../../external/corefx/src/System.Runtime.InteropServices/tests/System/Runtime/InteropServices/*.cs:MarshalTests.cs,GCHandleTests.cs,SafeBufferTests.cs,ComEventsHelperTests.cs,RuntimeEnvironmentTests.cs,DispatchWrapperTests.cs,ArrayWithOffsetTests.cs,SetWin32ContextInIDispatchAttributeTests.cs,ComAwareEventInfoTests.cs,IDispatchImplAttributeTests.cs,ComAwareEventInfoTests.Windows.cs,MarshalTests.Windows.cs
# System.Collections.NonGeneric
#../../../external/corefx/src/System.Collections.NonGeneric/tests/ArrayList/*.cs
../../../external/corefx/src/System.Collections.NonGeneric/tests/Hashtable/*.cs
../../../external/corefx/src/System.Collections.NonGeneric/tests/*.cs:SortedListTests.cs,CollectionBaseTests.cs,DictionaryBaseTests.cs,ArrayListTests.cs,ReadOnlyCollectionBaseTests.cs
# System.IO.MemoryStream
../../../external/corefx/src/System.IO/tests/MemoryStream/*.cs
../../../external/corefx/src/Common/tests/System/IO/DelegateStream.cs
# System.Collections.Concurrent
../../../external/corefx/src/System.Collections.Concurrent/tests/ConcurrentDictionary/*.cs
../../../external/corefx/src/System.Collections.Concurrent/tests/*.cs:ProducerConsumerCollectionTests.cs,EtwTests.cs,ConcurrentBagTests.cs,ConcurrentQueueTests.cs,ConcurrentStackTests.cs
# System.IO.UnmanagedMemoryStream
../../../external/corefx/src/System.IO.UnmanagedMemoryStream/tests/*.cs
# System.Collections.Specialized
../../../external/corefx/src/System.Collections.Specialized/tests/StringDictionary/*.cs
../../../external/corefx/src/System.Collections.Specialized/tests/NameObjectCollectionBase/*.cs:NameObjectCollectionBase.KeysTests.cs,NameObjectCollectionBase.CopyToTests.cs
#../../../external/corefx/src/System.Collections.Specialized/tests/NameValueCollection/*.cs
../../../external/corefx/src/System.Collections.Specialized/tests/ListDictionary/*.cs
../../../external/corefx/src/System.Collections.Specialized/tests/HybridDictionary/*.cs
../../../external/corefx/src/System.Collections.Specialized/tests/OrderedDictionary/*.cs
../../../external/corefx/src/System.Collections.Specialized/tests/*.cs:StringCollectionTests.cs
# System.IO.TextReader/StreamReader
../../../external/corefx/src/System.IO/tests/TextReader/*.cs
../../../external/corefx/src/System.IO/tests/StreamReader/*.cs
../../../external/corefx/src/System.IO/tests/TestDataProvider/TestDataProvider.cs
# System.IO.Stream
../../../external/corefx/src/Common/tests/System/IO/CallTrackingStream.cs
../../../external/corefx/src/System.IO/tests/Stream/*.cs
# System.IO.BufferedStream
../../../external/corefx/src/System.IO/tests/StreamWriter/StreamWriter.CloseTests.cs
../../../external/corefx/src/System.IO/tests/StreamWriter/StreamWriter.WriteTests.cs
../../../external/corefx/src/System.IO/tests/StreamWriter/StreamWriter.FlushTests.cs
../../../external/corefx/src/System.IO/tests/BinaryWriter/BinaryWriterTests.cs
../../../external/corefx/src/System.IO/tests/BinaryWriter/BinaryWriter.WriteTests.cs
../../../external/corefx/src/System.IO/tests/BinaryWriter/BinaryWriter.WriteByteCharTests.cs
../../../external/corefx/src/System.IO/tests/StreamReader/StreamReaderTests.cs
../../../external/corefx/src/System.IO/tests/TestDataProvider/TestDataProvider.cs
../../../external/corefx/src/Common/tests/System/IO/WrappedMemoryStream.cs
../../../external/corefx/src/System.IO/tests/BufferedStream/*.cs
# FileSystem Helper (not used on Windows)
../../../external/corefx/src/System.IO.FileSystem/tests/FileSystemTest.Unix.cs
# System.IO.FileInfo
../../../external/corefx/src/Common/tests/System/IO/TempFile.cs
../../../external/corefx/src/Common/tests/System/IO/PathFeatures.cs
../../../external/corefx/src/System.IO.FileSystem/tests/TestData.cs
../../../external/corefx/src/System.IO.FileSystem/tests/FSAssert.cs
../../../external/corefx/src/CoreFx.Private.TestUtilities/src/System/AdminHelpers.cs
../../../external/corefx/src/CoreFx.Private.TestUtilities/src/System/TheoryExtensions.cs
../../../external/corefx/src/System.IO.FileSystem/tests/Base/*.cs:StaticGetSetTimes.cs
../../../external/corefx/src/System.IO.FileSystem/tests/File/*.cs:GetSetTimes.cs
../../../external/corefx/src/System.IO.FileSystem/tests/FileStream/ctor_*.cs
../../../external/corefx/src/System.IO.FileSystem/tests/PortedCommon/*.cs
../../../external/corefx/src/System.IO.FileSystem/tests/FileSystemTest.cs
../../../external/corefx/src/System.IO.FileSystem/tests/FileInfo/*.cs:GetSetTimes.cs
# System.IO.Directory
../../../external/corefx/src/System.IO.FileSystem/tests/Directory/*.cs:GetSetTimes.cs
# System.IO.DirectoryInfo
../../../external/corefx/src/System.IO.FileSystem/tests/DirectoryInfo/*.cs:GetSetTimes.cs
# System.IO.TextWriter/StreamWriter
../../../external/corefx/src/System.IO/tests/TextReader/*.cs
../../../external/corefx/src/System.IO/tests/StreamReader/*.cs
+56 -18
View File
@@ -116,9 +116,6 @@ public static class Program {
if (SourcesParser.TraceLevel > 0)
Console.Error.WriteLine ($"// Writing sources from {sourcesFile} minus {excludesFile}, to {outFile}.");
} else if (args.Count == 4) {
if (baseDir != null)
Console.Error.WriteLine ($"// WARNING: baseDir has no effect in this mode");
var libraryFullName = Path.GetFullPath (args[1]);
var platformName = args[2].Trim ();
var profileName = args[3].Trim ();
@@ -135,13 +132,12 @@ public static class Program {
throw new Exception ();
}
var fileNames = result.GetMatches ()
var files = result.GetMatches ()
.OrderBy (e => e.RelativePath, StringComparer.Ordinal)
.Select (e => e.RelativePath)
.Distinct ()
.Distinct (new MatchEntryEqualityComparer ())
.ToList ();
var unexpectedEmptyResult = (fileNames.Count == 0);
var unexpectedEmptyResult = (files.Count == 0);
// HACK: We have sources files that are literally empty, so as long as *some* sources files were
// parsed during this invocation and they are all empty, producing no matching file names is not
@@ -150,7 +146,7 @@ public static class Program {
unexpectedEmptyResult = false;
if ((result.ErrorCount > 0) || unexpectedEmptyResult) {
Console.Error.WriteLine ($"// gensources produced {result.ErrorCount} error(s) and a set of {fileNames.Count} filename(s)");
Console.Error.WriteLine ($"// gensources produced {result.ErrorCount} error(s) and a set of {files.Count} filename(s)");
Console.Error.WriteLine ($"// Invoked with '{Environment.CommandLine}'");
Console.Error.WriteLine ($"// Working directory was '{Environment.CurrentDirectory}'");
@@ -163,17 +159,29 @@ public static class Program {
}
}
TextWriter output;
if (useStdout)
output = Console.Out;
else
output = new StreamWriter (outFile);
int parts = files.Count == 0 ? 0 : files.Max (f => f.SplitNumber);
if (useStdout && parts > 0)
throw new InvalidOperationException ("useStdout can't be used together with assembly splitting");
using (output) {
foreach (var fileName in fileNames)
output.WriteLine (fileName);
TextWriter[] outputs = new TextWriter[parts + 1];
for (int i = 0; i < parts + 1; i++) { // we create one file with all sources and part assemblies with only common+specific ones
outputs[i] = useStdout ? Console.Out : new StreamWriter (i == 0 ? outFile : $"{outFile}.part{i}");
}
foreach (var fileName in files) {
if (fileName.SplitNumber == 0) { // split number 0 is the special case: common files that should be included in all output parts
foreach (var output in outputs)
output.WriteLine (fileName.RelativePath);
}
else { // all other split numbers should only be included in the full assembly and the specific part assembly
outputs[0].WriteLine (fileName.RelativePath);
outputs[fileName.SplitNumber].WriteLine (fileName.RelativePath);
}
}
foreach (var output in outputs)
output.Dispose();
return 0;
}
}
@@ -195,11 +203,25 @@ public class SourcesFile {
public struct ParseEntry {
public string Directory;
public string Pattern;
public int SplitNumber;
}
public struct MatchEntry {
public SourcesFile SourcesFile;
public string RelativePath;
public int SplitNumber;
}
public class MatchEntryEqualityComparer : IEqualityComparer<MatchEntry> {
public bool Equals (MatchEntry x, MatchEntry y)
{
return (x.RelativePath == y.RelativePath);
}
public int GetHashCode (MatchEntry obj)
{
return obj.RelativePath?.GetHashCode() ?? 0;
}
}
public class TargetParseResult {
@@ -309,6 +331,7 @@ public class ParseResult {
yield return new MatchEntry {
SourcesFile = sourcesFile,
RelativePath = relativePath,
SplitNumber = entry.SplitNumber
};
}
} else {
@@ -329,6 +352,7 @@ public class ParseResult {
yield return new MatchEntry {
SourcesFile = sourcesFile,
RelativePath = relativePath,
SplitNumber = entry.SplitNumber
};
}
}
@@ -403,6 +427,7 @@ public class SourcesParser {
public string HostPlatform;
public string ProfileName;
public string ExclusionsFileName;
public int CurrentSplitNumber;
public int SourcesFilesParsed, ExclusionsFilesParsed;
}
@@ -413,6 +438,7 @@ public class SourcesParser {
public readonly string BaseDirectory;
private int ParseDepth = 0;
private string TargetProfileName = "";
public SourcesParser (
string platformsFolder, string profilesFolder, string baseDir
@@ -442,6 +468,7 @@ public class SourcesParser {
}
public ParseResult Parse (string libraryDirectory, string libraryName, string hostPlatform, string profile) {
TargetProfileName = profile;
var state = new State {
Result = new ParseResult (libraryDirectory),
ProfileName = profile,
@@ -581,6 +608,7 @@ public class SourcesParser {
bool asExclusionsList, string directive
) {
var include = "#include ";
var split = "#split ";
if (directive.StartsWith (include)) {
var includeName = directive.Substring (include.Length).Trim ();
var fileName = Path.Combine (includeDirectory, includeName);
@@ -598,6 +626,14 @@ public class SourcesParser {
}
file.Includes.Add (newFile);
} else if (directive.StartsWith (split)) {
if (asExclusionsList) throw new InvalidOperationException ("split directive is not valid for exclusion lists");
var profileName = directive.Substring (split.Length).Trim ();
if (profileName == TargetProfileName) {
state.CurrentSplitNumber++;
}
}
}
@@ -715,7 +751,8 @@ public class SourcesParser {
foreach (var pattern in explicitExclusions) {
result.Exclusions.Add (new ParseEntry {
Directory = pathDirectory,
Pattern = Path.Combine (mainPatternDirectory, pattern)
Pattern = Path.Combine (mainPatternDirectory, pattern),
SplitNumber = state.CurrentSplitNumber
});
}
}
@@ -723,7 +760,8 @@ public class SourcesParser {
(asExclusionsList ? result.Exclusions : result.Sources)
.Add (new ParseEntry {
Directory = pathDirectory,
Pattern = parts[0]
Pattern = parts[0],
SplitNumber = state.CurrentSplitNumber
});
}
}