3 # Rules for building unit tests.
5 # Includers of this file must define the following values:
14 TEST_COMPILE
= $(subst $(test_remove
),,$(CSCOMPILE
))
17 TEST_RUNTIME_WRAPPERS_PATH
= $(shell dirname
$(RUNTIME
))/_tmpinst
/bin
22 test_lib_dir
= $(topdir
)/class
/lib
/$(PROFILE
)/tests
24 test_nunit_lib
= nunitlite.dll
25 xunit_core
:= xunit.core xunit.execution.dotnet xunit.abstractions xunit.assert Xunit.NetCore.Extensions
26 xunit_deps
:= netstandard System.Runtime
27 xunit_src
:= $(patsubst %,$(topdir
)/..
/external
/xunit-binaries
/%,BenchmarkAttribute.cs BenchmarkDiscover.cs
) $(topdir
)/..
/mcs
/class
/test-helpers
/PlatformDetection.cs
29 ifeq ($(USE_XTEST_REMOTE_EXECUTOR
), YES
)
30 XTEST_REMOTE_EXECUTOR
= $(test_lib_dir
)/RemoteExecutorConsoleApp.exe
32 ifeq ($(BUILD_PLATFORM
), win32
)
33 XTEST_REMOTE_EXECUTOR_ABSPATH
= $(shell cygpath
-w
$(abspath
$(XTEST_REMOTE_EXECUTOR
)))
35 XTEST_REMOTE_EXECUTOR_ABSPATH
= $(abspath
$(XTEST_REMOTE_EXECUTOR
))
38 xunit_src
+= $(topdir
)/..
/mcs
/class
/test-helpers
/AdminHelper.cs \
39 $(topdir
)/..
/external
/corefx
/src
/CoreFx.Private.TestUtilities
/src
/System
/IO
/FileCleanupTestBase.cs \
40 $(topdir
)/..
/external
/corefx
/src
/CoreFx.Private.TestUtilities
/src
/System
/Diagnostics
/RemoteExecutorTestBase.cs \
41 $(topdir
)/..
/external
/corefx
/src
/Common
/src
/System
/PasteArguments.cs \
42 $(topdir
)/..
/external
/corefx
/src
/Common
/src
/System
/PasteArguments.Unix.cs
45 xunit_src
+= $(topdir
)/..
/mcs
/class
/test-helpers
/RemoteExecutorTestBase.Mobile.cs
47 ifeq ($(PROFILE
), xammac_net_4_5
)
48 xunit_src
+= $(topdir
)/..
/mcs
/class
/test-helpers
/RemoteExecutorTestBase.Mobile.cs
50 xunit_src
+= $(topdir
)/..
/mcs
/class
/test-helpers
/RemoteExecutorTestBase.Mono.cs
$(topdir
)/..
/external
/corefx
/src
/CoreFx.Private.TestUtilities
/src
/System
/Diagnostics
/RemoteExecutorTestBase.Process.cs
54 endif # ($(USE_XTEST_REMOTE_EXECUTOR), YES)
58 xunit_libs_ref
= $(patsubst %,-r
:$(topdir
)/..
/external
/xunit-binaries
/%.dll
,$(xunit_core
))
59 xunit_libs_ref
+= $(patsubst %,-r
:$(topdir
)/class
/lib
/$(PROFILE
)/Facades
/%.dll
,$(xunit_deps
))
61 xunit_libs_dep
= $(xunit_class_deps
:%=$(topdir
)/class
/lib
/$(PROFILE
)/%.dll
)
62 xunit_libs_ref
+= $(xunit_libs_dep
:%=-r
:%)
64 TEST_LIB_REFS_ALL
= $(TEST_LIB_REFS
) $(DEFAULT_REFERENCES
)
66 ifdef TARGET_NET_REFERENCE
67 # System*, mscorlib references come from the TARGET_NET_REFERENCE dir, others from the profile dir
68 TEST_LIB_REFS_MONO
= $(call _FILTER_OUT
,System
,$(call _FILTER_OUT
,mscorlib
,$(TEST_LIB_REFS_ALL
)))
69 TEST_LIB_REFS_SYSTEM
= $(filter-out $(TEST_LIB_REFS_MONO
),$(TEST_LIB_REFS_ALL
))
71 TEST_LIB_MCS_FLAGS
= $(patsubst %,-r
:$(topdir
)/..
/external
/binary-reference-assemblies
/$(TARGET_NET_REFERENCE
)/%.dll
,$(TEST_LIB_REFS_SYSTEM
))
72 TEST_LIB_MCS_FLAGS
+= $(patsubst %,-r
:$(topdir
)/class
/lib
/$(PROFILE_DIRECTORY
)/%.dll
,$(TEST_LIB_REFS_MONO
))
74 TEST_LIB_MCS_FLAGS
= $(patsubst %,-r
:$(topdir
)/class
/lib
/$(PROFILE_DIRECTORY
)/%.dll
,$(TEST_LIB_REFS_ALL
))
77 XTEST_LIB_MCS_FLAGS
= $(patsubst %,-r
:$(topdir
)/class
/lib
/$(PROFILE
)/%.dll
,$(XTEST_LIB_REFS
) $(DEFAULT_REFERENCES
))
79 test_nunit_dep
= $(test_nunit_lib
:%=$(topdir
)/class
/lib
/$(PROFILE
)/%)
80 test_nunit_ref
= $(test_nunit_dep
:%=-r
:%)
81 tests_CLEAN_FILES
+= TestResult
*.xml
83 test_sourcefile_base
= $(PROFILE
)_
$(ASSEMBLY
:$(ASSEMBLY_EXT
)=_test.dll.sources
)
85 ifeq ($(wildcard $(test_sourcefile_base
)),)
86 test_sourcefile_base
= $(ASSEMBLY
:$(ASSEMBLY_EXT
)=_test.dll.sources
)
89 test_lib
= $(PROFILE
)_
$(ASSEMBLY
:$(ASSEMBLY_EXT
)=_test.dll
)
90 test_lib_output
= $(test_lib_dir
)/$(test_lib
)
92 test_library
= $(ASSEMBLY
:$(ASSEMBLY_EXT
)=)_test
$(ASSEMBLY_EXT
)
93 test_response
= $(depsdir
)/$(PROFILE_PLATFORM
)_
$(PROFILE
)_
$(test_library
).response
94 test_makefrag
= $(depsdir
)/$(PROFILE_PLATFORM
)_
$(PROFILE
)_
$(test_library
).makefrag
96 test_flags
= $(test_nunit_ref
) $(TEST_MCS_FLAGS
) $(TEST_LIB_MCS_FLAGS
)
98 test_flags
+= -r
:$(the_assembly
)
99 test_assembly_dep
= $(the_assembly
)
102 tests_CLEAN_FILES
+= $(test_lib_output
) $(test_response
) $(test_makefrag
)
104 xtest_sourcefile_base
= $(PROFILE_PLATFORM
)_
$(PROFILE
)_
$(ASSEMBLY
:$(ASSEMBLY_EXT
)=_xtest.dll.sources
)
106 xunit_test_lib
= $(PROFILE
)_
$(ASSEMBLY
:$(ASSEMBLY_EXT
)=_xunit-test.dll
)
107 xtest_lib_output
= $(test_lib_dir
)/$(xunit_test_lib
)
109 xtest_library
= $(ASSEMBLY
:$(ASSEMBLY_EXT
)=)_xtest
$(ASSEMBLY_EXT
)
110 xtest_response
= $(depsdir
)/$(PROFILE_PLATFORM
)_
$(PROFILE
)_
$(xtest_library
).response
111 xtest_makefrag
= $(depsdir
)/$(PROFILE_PLATFORM
)_
$(PROFILE
)_
$(xtest_library
).makefrag
112 xtest_flags
= $(xunit_libs_ref
) $(XTEST_MCS_FLAGS
) $(XTEST_LIB_MCS_FLAGS
) /unsafe
115 xtest_flags
+= -r
:$(the_assembly
)
116 xtest_assembly_dep
= $(the_assembly
)
119 ifeq ($(wildcard $(xtest_sourcefile_base
)),)
120 xtest_sourcefile_base
= $(ASSEMBLY
:$(ASSEMBLY_EXT
)=_xtest.dll.sources
)
121 tests_CLEAN_FILES
+= $(xtest_lib_output
) $(xtest_response
) $(xtest_makefrag
)
125 HAVE_CS_TESTS
:= $(wildcard $(test_sourcefile_base
))
128 HAVE_CS_XTESTS
:= $(wildcard $(xtest_sourcefile_base
))
133 $(test_nunit_dep
): $(topdir
)/build
/deps
/nunit-
$(PROFILE
).stamp
134 @if
test -f
$@
; then
:; else rm -f
$<; $(MAKE
) $<; fi
136 $(topdir
)/build
/deps
/nunit-
$(PROFILE
).stamp
:
137 $(MAKE
) -C
${topdir}/tools
/nunit-lite
140 tests_CLEAN_FILES
+= $(topdir
)/build
/deps
/nunit-
$(PROFILE
).stamp
147 test_assemblies
+= $(test_lib_output
)
149 ifdef TEST_SPLIT_ASSEMBLIES
150 test_assemblies
+= $(test_lib_output
:.dll
=.part1.dll
) $(test_lib_output
:.dll
=.part2.dll
) $(test_lib_output
:.dll
=.part3.dll
)
154 test-local
: $(test_assemblies
) $(test_lib_dir
)/nunit-excludes.txt
155 run-test-local
: run-test-lib
156 run-test-ondotnet-local
: run-test-ondotnet-lib
158 TEST_HARNESS_EXCLUDES
= $(PLATFORM_TEST_HARNESS_EXCLUDES
) $(PROFILE_TEST_HARNESS_EXCLUDES
) NotWorking CAS
160 ifdef TEST_WITH_INTERPRETER
161 TEST_HARNESS_EXCLUDES
+= NotWorkingRuntimeInterpreter
167 FIXTURE_ARG
= -test=$(FIXTURE
)
171 TESTNAME_ARG
= -test=$(TESTNAME
)
174 ifdef TEST_HARNESS_VERBOSE
178 ifdef ALWAYS_AOT_TESTS
179 test-local-aot-compile
: $(topdir
)/build
/deps
/nunit-
$(PROFILE
).stamp
$(test_assemblies
)
180 PATH
="$(TEST_RUNTIME_WRAPPERS_PATH):$(PATH)" MONO_REGISTRY_PATH
="$(HOME)/.mono/registry" MONO_TESTS_IN_PROGRESS
="yes" $(TEST_RUNTIME
) $(TEST_RUNTIME_FLAGS
) $(AOT_BUILD_FLAGS
) $(test_assemblies
)
183 test-local-aot-compile
: $(topdir
)/build
/deps
/nunit-
$(PROFILE
).stamp
$(test_assemblies
)
185 endif # ALWAYS_AOT_TESTS
188 TEST_COVERAGE_FLAGS
= -O
=-aot
--profile
=coverage
:output
=$(topdir
)/class
/lib
/$(PROFILE_DIRECTORY
)/coverage_nunit_
$(ASSEMBLY
).xml
191 NUNITLITE_CONFIG_FILE
=$(topdir
)/class
/lib
/$(PROFILE
)/$(PARENT_PROFILE
)nunit-lite-console.exe.config
193 $(test_lib_output
).nunitlite.config
: $(topdir
)/tools
/nunit-lite
/nunit-lite-console
/nunit-lite-console.exe.config.tmpl
$(TEST_NUNITLITE_APP_CONFIG_GLOBAL
) $(TEST_NUNITLITE_APP_CONFIG_RUNTIME
) $(TEST_NUNITLITE_APP_CONFIG_SUPPLEMENTAL
) |
$(test_lib_dir
)
194 cp
-f
$(topdir
)/tools
/nunit-lite
/nunit-lite-console
/nunit-lite-console.exe.config.tmpl
$(test_lib_output
).nunitlite.config
195 ifdef TEST_NUNITLITE_APP_CONFIG_GLOBAL
196 sed
-i
-e
"/__INSERT_CUSTOM_APP_CONFIG_GLOBAL__/r $(TEST_NUNITLITE_APP_CONFIG_GLOBAL)" $(test_lib_output
).nunitlite.config
198 ifdef TEST_NUNITLITE_APP_CONFIG_RUNTIME
199 sed
-i
-e
"/__INSERT_CUSTOM_APP_CONFIG_RUNTIME__/r $(TEST_NUNITLITE_APP_CONFIG_RUNTIME)" $(test_lib_output
).nunitlite.config
201 ifdef TEST_NUNITLITE_APP_CONFIG_SUPPLEMENTAL
202 cp
-f
$(TEST_NUNITLITE_APP_CONFIG_SUPPLEMENTAL
) $(test_lib_output
).nunitlite.config.
$(TEST_NUNITLITE_APP_CONFIG_SUPPLEMENTAL
)
205 copy-nunitlite-appconfig
: $(test_lib_output
).nunitlite.config
206 cp
-f
$(test_lib_output
).nunitlite.config
$(NUNITLITE_CONFIG_FILE
)
208 ifdef PLATFORM_AOT_SUFFIX
210 DEDUP_DUMMY_CS
=$(topdir
)/class
/lib
/$(PROFILE
)/DedupInflatedMethods.cs
211 DEDUP_DUMMY
=$(topdir
)/class
/lib
/$(PROFILE
)/DedupInflatedMethods.dll
214 echo
" // Empty Assembly \n\n" > $(DEDUP_DUMMY_CS
)
215 $(CSCOMPILE
) -t
:library
-out
:$(DEDUP_DUMMY
) $(DEDUP_DUMMY_CS
)
218 MKBUNDLE_TEST_BIN
= $(TEST_HARNESS
).static
219 MKBUNDLE_EXE
= $(topdir
)/class
/lib
/$(PROFILE
)/mkbundle.exe
220 # Pattern based on the one in AOT_PROFILE_ASSEMBLIES
221 # It's easier if you read it backwards.
222 # What we do here is get the files in the profile directory that end in "test.dll" or are prefixed with nunit (filter)
223 # and then strip out everything that we expect to live outside the top level (filter-out)
224 TEST_ASSEMBLIES
:=$(sort $(patsubst .
//%,%,$(filter-out %.exe.static
%.dll.dll
%.exe.dll
%bare
% %plaincore
% %secxml
% %Facades
% %ilasm
%,$(filter %.dll
,$(wildcard $(topdir
)/class
/lib
/$(PROFILE
)/tests
/*)))))
226 $(MKBUNDLE_EXE
): $(topdir
)/tools
/mkbundle
/mkbundle.cs
227 $(MAKE
) -C
$(topdir
)/tools
/mkbundle
230 $(Q_AOT
) $(MAKE
) -C
$(topdir
)/class do-test
231 $(Q_AOT
) $(MAKE
) -C
$(topdir
)/tools
/mkbundle
232 $(Q_AOT
) $(MAKE
) $(MKBUNDLE_TEST_BIN
) # recursive make re-computes variables for TEST_ASSEMBLIES
235 MKBUNDLE_DEDUP_COND
:= $(DEDUP_DUMMY
)
236 DEDUP_ARGS
=--aot-dedup
$(DEDUP_DUMMY
)
239 $(MKBUNDLE_TEST_BIN
): $(TEST_ASSEMBLIES
) $(TEST_HARNESS
) $(MKBUNDLE_EXE
) $(MKBUNDLE_DEDUP_COND
)
240 $(Q_AOT
) MONO_PATH
="$(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)" PKG_CONFIG_PATH
="$(topdir)/../data" $(RUNTIME
) $(RUNTIME_FLAGS
) $(MKBUNDLE_EXE
) -L
$(topdir
)/class
/lib
/$(PROFILE
) -v
--deps
$(TEST_HARNESS
) $(TEST_ASSEMBLIES
) -o
$(MKBUNDLE_TEST_BIN
) --aot-mode
$(AOT_MODE
) --aot-runtime
$(RUNTIME
) --aot-args
$(AOT_BUILD_ATTRS
) --in-tree
$(topdir
)/..
--managed-linker
$(topdir
)/class
/lib
/$(BUILD_TOOLS_PROFILE
)/monolinker.exe
--config
$(topdir
)/..
/data
/config
--i18n
all $(DEDUP_ARGS
) --keeptemp
242 endif # PLATFORM_AOT_SUFFIX
244 ifneq ($(wildcard $(MKBUNDLE_TEST_BIN
)),)
245 TEST_HARNESS_EXEC
=$(MKBUNDLE_TEST_BIN
)
246 TEST_HARNESS_EXCLUDES
:=$(TEST_HARNESS_EXCLUDES
) StaticLinkedAotNotWorking
248 TEST_HARNESS_EXEC
=$(TEST_RUNTIME
) $(TEST_RUNTIME_FLAGS
) $(TEST_COVERAGE_FLAGS
) $(AOT_RUN_FLAGS
) $(TEST_HARNESS
)
251 $(test_lib_dir
)/nunit-excludes.txt
: $(topdir
)/build
/tests.make |
$(test_lib_dir
)
253 @
$(foreach entry
,$(TEST_HARNESS_EXCLUDES
),echo
"$(entry)" >> $@
;)
255 ## FIXME: i18n problem in the 'sed' command below
256 run-test-lib
: test-local test-local-aot-compile copy-nunitlite-appconfig
258 PATH
="$(TEST_RUNTIME_WRAPPERS_PATH):$(PATH)" MONO_REGISTRY_PATH
="$(HOME)/.mono/registry" MONO_TESTS_IN_PROGRESS
="yes" DBG_RUNTIME_ARGS
="$(TEST_RUNTIME_FLAGS)" $(TEST_HARNESS_EXEC
) $(test_assemblies
) $(NOSHADOW_FLAG
) $(TEST_HARNESS_FLAGS
) $(LOCAL_TEST_HARNESS_FLAGS
) -exclude
=$(subst $(space
),$(comma
),$(TEST_HARNESS_EXCLUDES
)) $(LABELS_ARG
) -format
:nunit2
-result
:TestResult-
$(PROFILE
).xml
$(FIXTURE_ARG
) $(TESTNAME_ARG
)|| ok
=false
; \
259 if
[ ! -f
"TestResult-$(PROFILE).xml" ]; then echo
"<?xml version='1.0' encoding='utf-8'?><test-results failures='1' total='1' not-run='0' name='bcl-tests' date='$$(date +%F)' time='$$(date +%T)'><test-suite name='$(strip $(test_assemblies))' success='False' time='0'><results><test-case name='$(notdir $(strip $(test_assemblies))).crash' executed='True' success='False' time='0'><failure><message>The test runner didn't produce a test result XML, probably due to a crash of the runtime. Check the log for more details.</message><stack-trace></stack-trace></failure></test-case></results></test-suite></test-results>" > TestResult-
$(PROFILE
).xml
; fi
; \
262 ## Instructs compiler to compile to target .net execution, it can be usefull in rare cases when runtime detection is not possible
263 run-test-ondotnet-lib
: LOCAL_TEST_COMPILER_ONDOTNET_FLAGS
:=-d
:RUN_ONDOTNET
264 run-test-ondotnet-lib
: test-local
266 $(TEST_HARNESS
) $(test_assemblies
) $(NOSHADOW_FLAG
) $(TEST_HARNESS_FLAGS
) $(LOCAL_TEST_HARNESS_ONDOTNET_FLAGS
) /exclude
:$(subst $(space
),$(comma
),$(TEST_HARNESS_EXCLUDES
) NotDotNet
) $(LABELS_ARG
) -format
:nunit2
-result
:TestResult-ondotnet-
$(PROFILE
).xml
$(FIXTURE_ARG
) $(TESTNAME_ARG
) || ok
=false
; \
276 TEST_FILES
+= `sed -e '/^$$/d' -e 's,^../,,' -e '/^\#.*$$/d' -et -e 's,^,Test/,' $(test_sourcefile_base)`
281 $(test_lib_output
): $(test_assembly_dep
) $(test_response
) $(test_nunit_dep
) $(test_lib_output
).nunitlite.config |
$(test_lib_dir
)
282 $(TEST_COMPILE
) $(LIBRARY_FLAGS
) -target
:library
-out
:$@
$(test_flags
) $(LOCAL_TEST_COMPILER_ONDOTNET_FLAGS
) @
$(test_response
)
284 ifdef TEST_SPLIT_ASSEMBLIES
285 $(test_lib_output
:.dll
=.part1.dll
): $(test_lib_output
) $(test_response
).part1
286 $(TEST_COMPILE
) $(LIBRARY_FLAGS
) -target
:library
-out
:$@
$(test_flags
) $(LOCAL_TEST_COMPILER_ONDOTNET_FLAGS
) @
$(test_response
).part1
288 $(test_lib_output
:.dll
=.part2.dll
): $(test_lib_output
) $(test_response
).part2
289 $(TEST_COMPILE
) $(LIBRARY_FLAGS
) -target
:library
-out
:$@
$(test_flags
) $(LOCAL_TEST_COMPILER_ONDOTNET_FLAGS
) @
$(test_response
).part2
291 $(test_lib_output
:.dll
=.part3.dll
): $(test_lib_output
) $(test_response
).part3
292 ifneq ($(wildcard $(test_response
).part3
),)
293 $(TEST_COMPILE
) $(LIBRARY_FLAGS
) -target
:library
-out
:$@
$(test_flags
) $(LOCAL_TEST_COMPILER_ONDOTNET_FLAGS
) @
$(test_response
).part3
296 # part3 is optional so we need this empty target to silence make if it doesn't exist
297 $(test_response
).part3
: ;
299 tests_CLEAN_FILES
+= $(test_response
).part1
$(test_response
).part2
$(test_response
).part3
302 $(test_response
): $(test_sourcefile_base
) $(wildcard *_test.dll.sources
) $(wildcard *_test.dll.exclude.sources
) $(topdir
)/build
/tests.make
$(depsdir
)/.stamp
303 $(GENSOURCES
) --basedir
:.
/Test
--strict
--platformsdir
:$(topdir
)/build
"$@" "$(test_library)" "$(PROFILE_PLATFORM)" "$(PROFILE)"
305 $(test_makefrag
): $(test_response
)
306 @echo Creating
$@ ...
307 @sed
's,^,$(test_lib_output) $(test_lib_output:.dll=.part1.dll) $(test_lib_output:.dll=.part2.dll) $(test_lib_output:.dll=.part3.dll): ,' $< >$@
309 -include $(test_makefrag
)
317 XTEST_HARNESS_PATH
:= $(topdir
)/..
/external
/xunit-binaries
318 XTEST_HARNESS
= $(XTEST_HARNESS_PATH
)/xunit.console.exe
319 XTEST_RESULT_FILE
:= TestResult-
$(PROFILE
)-xunit.xml
320 XTEST_HARNESS_FLAGS
:= -noappdomain
-noshadow
-parallel none
-nunit
$(XTEST_RESULT_FILE
)
322 XTEST_NOTRAITS
:= category
=failing category
=nonmonotests Benchmark
=true
325 XTEST_NOTRAITS
+= category
=outerloop
328 # The logic is double inverted so this actually excludes tests not intented for current platform
329 # best to search for `property name="category"` in the xml output to see what's going on
330 # https://github.com/dotnet/buildtools/blob/master/src/xunit.netcore.extensions/Discoverers/PlatformSpecificDiscoverer.cs
331 XTEST_NOTRAITS
+= category
=non
$(XTEST_PLATFORM
)tests
333 TEST_MONO_PATH
:= $(TEST_MONO_PATH
)$(PLATFORM_PATH_SEPARATOR
)$(XTEST_HARNESS_PATH
)
336 XTEST_HARNESS_FLAGS
+= -class
$(FIXTURE
)
340 XTEST_HARNESS_FLAGS
+= -method
$(TESTNAME
)
344 XTEST_COVERAGE_FLAGS
= -O
=-aot
--profile
=coverage
:output
=$(topdir
)/class
/lib
/$(PROFILE_DIRECTORY
)/coverage_xunit_
$(ASSEMBLY
).xml
347 xtest_assemblies
+= $(xtest_lib_output
)
349 ifdef XTEST_SPLIT_ASSEMBLIES
350 xtest_assemblies
+= $(xtest_lib_output
:.dll
=.part1.dll
) $(xtest_lib_output
:.dll
=.part2.dll
) $(xtest_lib_output
:.dll
=.part3.dll
)
354 check: run-xunit-test-local
355 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
356 run-xunit-test-local
: run-xunit-test-lib
358 $(test_lib_dir
)/xunit-excludes.txt
: $(topdir
)/build
/tests.make |
$(test_lib_dir
)
360 $(foreach entry
,$(XTEST_NOTRAITS
),echo
"$(entry)" >> $@
;)
362 $(test_lib_dir
)/Xunit.NetCore.Extensions.dll
: $(topdir
)/build
/tests.make
$(topdir
)/..
/external
/xunit-binaries
/Xunit.NetCore.Extensions.dll |
$(test_lib_dir
)
363 @cp
-f
$(topdir
)/..
/external
/xunit-binaries
/Xunit.NetCore.Extensions.dll
$@
365 $(test_lib_dir
)/xunit.execution.dotnet.dll
: $(topdir
)/build
/tests.make
$(topdir
)/..
/external
/xunit-binaries
/xunit.execution.dotnet.dll |
$(test_lib_dir
)
366 @cp
-f
$(topdir
)/..
/external
/xunit-binaries
/xunit.execution.dotnet.dll
$@
368 run-xunit-test-lib
: xunit-test-local
370 PATH
="$(TEST_RUNTIME_WRAPPERS_PATH):$(PATH)" REMOTE_EXECUTOR
="$(XTEST_REMOTE_EXECUTOR_ABSPATH)" $(TEST_RUNTIME
) $(TEST_RUNTIME_FLAGS
) $(XTEST_COVERAGE_FLAGS
) $(AOT_RUN_FLAGS
) $(XTEST_HARNESS
) $(xtest_lib_output
) $(XTEST_HARNESS_FLAGS
) -notrait
$(subst $(space
), -notrait
,$(XTEST_NOTRAITS
)) || ok
=false
; \
371 if
[ -n
"$$MONO_BABYSITTER_NUNIT_XML_LIST_FILE" ]; then echo
"$(abspath $(XTEST_RESULT_FILE))" >> "$$MONO_BABYSITTER_NUNIT_XML_LIST_FILE"; fi
; \
374 # Some xunit tests want to be executed in a separate process (see RemoteExecutorTestBase)
375 $(XTEST_REMOTE_EXECUTOR
): $(topdir
)/..
/external
/corefx
/src
/Common
/tests
/System
/Diagnostics
/RemoteExecutorConsoleApp
/RemoteExecutorConsoleApp.cs |
$(test_lib_dir
)
376 $(TEST_COMPILE
) -r
:$(topdir
)/class
/lib
/$(PROFILE
)/mscorlib.dll
$< -out
:$@
378 $(xtest_lib_output
): $(xtest_assembly_dep
) $(xtest_response
) $(xunit_libs_dep
) $(xunit_src
) $(XTEST_REMOTE_EXECUTOR
) |
$(test_lib_dir
)
379 $(TEST_COMPILE
) $(LIBRARY_FLAGS
) $(XTEST_LIB_FLAGS
) -target
:library
-out
:$@
$(xtest_flags
) @
$(xtest_response
) $(xunit_src
)
381 ifdef XTEST_SPLIT_ASSEMBLIES
382 $(xtest_lib_output
:.dll
=.part1.dll
): $(xtest_lib_output
) $(xtest_response
).part1
383 $(TEST_COMPILE
) $(LIBRARY_FLAGS
) $(XTEST_LIB_FLAGS
) -target
:library
-out
:$@
$(xtest_flags
) @
$(xtest_response
).part1
$(xunit_src
)
385 $(xtest_lib_output
:.dll
=.part2.dll
): $(xtest_lib_output
) $(xtest_response
).part2
386 $(TEST_COMPILE
) $(LIBRARY_FLAGS
) $(XTEST_LIB_FLAGS
) -target
:library
-out
:$@
$(xtest_flags
) @
$(xtest_response
).part2
$(xunit_src
)
388 $(xtest_lib_output
:.dll
=.part3.dll
): $(xtest_lib_output
) $(xtest_response
).part3
389 ifneq ($(wildcard $(xtest_response
).part3
),)
390 $(TEST_COMPILE
) $(LIBRARY_FLAGS
) $(XTEST_LIB_FLAGS
) -target
:library
-out
:$@
$(xtest_flags
) @
$(xtest_response
).part3
$(xunit_src
)
393 # part3 is optional so we need this empty target to silence make if it doesn't exist
394 $(xtest_response
).part3
: ;
396 xtests_CLEAN_FILES
+= $(xtest_response
).part1
$(xtest_response
).part2
$(xtest_response
).part3
399 # This handles .excludes/.sources pairs, as well as resolving the
400 # includes that occur in .sources files. It also handles splitting test assemblies into multiple parts.
401 $(xtest_response
): $(xtest_sourcefile_base
) $(wildcard *_xtest.dll.sources
) $(wildcard *_xtest.dll.exclude.sources
) $(topdir
)/build
/tests.make
$(depsdir
)/.stamp
402 $(GENSOURCES
) --strict
--platformsdir
:$(topdir
)/build
"$@" "$(xtest_library)" "$(PROFILE_PLATFORM)" "$(PROFILE)"
404 $(xtest_makefrag
): $(xtest_response
)
405 @echo Creating
$@ ...
406 @sed
's,^,$(xtest_lib_output) $(xtest_lib_output:.dll=.part1.dll) $(xtest_lib_output:.dll=.part2.dll) $(xtest_lib_output:.dll=.part3.dll): ,' $< >$@
408 -include $(xtest_makefrag
)