2014-08-13 10:39:27 +01:00
|
|
|
#
|
|
|
|
# use make run-test PROFILE=net_2_0
|
|
|
|
#
|
|
|
|
|
|
|
|
thisdir = tests
|
|
|
|
SUBDIRS =
|
|
|
|
include ../build/rules.make
|
|
|
|
|
2014-09-04 09:07:35 +01:00
|
|
|
DISTFILES = $(wildcard dlls/**/*.cs) $(wildcard dlls/*.cs) $(wildcard dlls/*.inc) $(wildcard dlls/*.il)
|
2014-08-13 10:39:27 +01:00
|
|
|
DISTFILES += $(wildcard *.cs) $(wildcard *.il) $(wildcard *.xml) $(wildcard *.inc) $(wildcard known-issues-*) $(wildcard *.snk)
|
|
|
|
|
|
|
|
with_mono_path = MONO_PATH="$(topdir)/class/lib/$(PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH"
|
|
|
|
|
|
|
|
ilasm = $(topdir)/class/lib/$(PROFILE)/ilasm.exe
|
|
|
|
ILASM = MONO_PATH="$(topdir)/class/lib/$(PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME) $(RUNTIME_FLAGS) $(ilasm)
|
|
|
|
|
2016-02-22 11:00:01 -05:00
|
|
|
-include $(mcs_topdir)/build/config.make
|
|
|
|
|
2014-08-13 10:39:27 +01:00
|
|
|
USE_MCS_FLAGS :=
|
|
|
|
|
|
|
|
# mention all targets
|
|
|
|
all-local $(STD_TARGETS:=-local):
|
|
|
|
|
2016-02-22 11:00:01 -05:00
|
|
|
VALID_PROFILE := $(filter $(DEFAULT_PROFILE), $(PROFILE))
|
2014-08-13 10:39:27 +01:00
|
|
|
ifdef VALID_PROFILE
|
|
|
|
# casts
|
|
|
|
bootstrap-cast.exe: gen-cast-test.cs
|
|
|
|
$(BOOT_COMPILE) -target:exe /out:$@ $<
|
|
|
|
|
|
|
|
casts.cs: bootstrap-cast.exe
|
|
|
|
$(with_mono_path) $(RUNTIME) $(RUNTIME_FLAGS) $< >$@
|
|
|
|
|
|
|
|
casts-mcs.exe: casts.cs
|
|
|
|
$(CSCOMPILE) -target:exe /out:$@ $<
|
|
|
|
|
|
|
|
casts-boot.exe: casts.cs
|
|
|
|
$(BOOT_COMPILE) -target:exe /out:$@ $<
|
|
|
|
|
|
|
|
boot-casts.out: casts-boot.exe
|
|
|
|
$(with_mono_path) $(RUNTIME) $(RUNTIME_FLAGS) $< >$@
|
|
|
|
|
|
|
|
mcs-casts.out: casts-mcs.exe
|
|
|
|
$(with_mono_path) $(RUNTIME) $(RUNTIME_FLAGS) $< >$@
|
|
|
|
|
|
|
|
test-casts: boot-casts.out mcs-casts.out
|
|
|
|
cmp $^
|
|
|
|
-rm -f bootstrap-cast.exe casts.cs casts-boot.exe casts-mcs.exe boot-casts.out mcs-casts.out
|
|
|
|
|
|
|
|
TEST_PATTERN = 'v2'
|
|
|
|
|
2016-02-22 11:00:01 -05:00
|
|
|
ifeq (net_4_x, $(PROFILE))
|
2014-08-13 10:39:27 +01:00
|
|
|
TEST_PATTERN = 'v4'
|
2016-08-03 10:59:49 +00:00
|
|
|
DEFINES = -compiler-options:"-d:NET_4_0;NET_4_5 -debug"
|
2014-08-13 10:39:27 +01:00
|
|
|
endif
|
|
|
|
|
|
|
|
LOCAL_RUNTIME_FLAGS = --verify-all
|
2017-04-10 11:41:01 +00:00
|
|
|
COMPILER = $(topdir)/class/lib/$(PROFILE)/mcs.exe
|
2018-01-24 17:04:36 +00:00
|
|
|
TESTER = MONO_RUNTIME='$(RUNTIME)' $(TEST_RUNTIME) $(TEST_RUNTIME_FLAGS) $(LOCAL_RUNTIME_FLAGS) $(topdir)/class/lib/$(PROFILE)/compiler-tester.exe
|
2014-08-13 10:39:27 +01:00
|
|
|
|
|
|
|
TEST_ILS := $(wildcard *-lib.il)
|
|
|
|
|
|
|
|
build-compiler-lib:
|
|
|
|
cd ../class/Mono.CSharp && $(MAKE) NO_DIR_CHECK=yes
|
|
|
|
|
|
|
|
qcheck: build-compiler-lib qcheck2
|
2015-04-07 09:35:12 +01:00
|
|
|
|
2018-01-24 17:04:36 +00:00
|
|
|
ifdef TEST_WITH_INTERPRETER
|
|
|
|
KNOWN_ISSUES = known-issues-interp-$(PROFILE)
|
|
|
|
else
|
|
|
|
KNOWN_ISSUES = known-issues-$(PROFILE)
|
|
|
|
endif
|
|
|
|
|
2014-08-13 10:39:27 +01:00
|
|
|
qcheck2:
|
2018-01-24 17:04:36 +00:00
|
|
|
$(TESTER) -mode:pos -files:$(TEST_PATTERN) -compiler:$(COMPILER) -issues:$(KNOWN_ISSUES) -log:$(PROFILE).log -il:ver-il-$(PROFILE).xml $(DEFINES) $(TOPTIONS)
|
2014-08-13 10:39:27 +01:00
|
|
|
|
|
|
|
gen-mt-tests:
|
|
|
|
$(TESTER) -mode:nunit -files:'v2' -compiler:$(COMPILER) -issues:known-issues-mt -compiler-options:"-lib:$(topdir)/class/lib/monotouch projects/MonoTouch/ivt.cs"
|
|
|
|
|
2018-01-24 17:04:36 +00:00
|
|
|
|
|
|
|
TESTERVERBOSE=$(if $(V),-verbose,)
|
|
|
|
|
2014-08-13 10:39:27 +01:00
|
|
|
test-local:
|
|
|
|
@:
|
|
|
|
|
2018-01-24 17:04:36 +00:00
|
|
|
compile-all: $(TEST_ILS:.il=.dll)
|
|
|
|
|
|
|
|
run-test-local: compile-all setup qcheck
|
2014-08-13 10:39:27 +01:00
|
|
|
|
|
|
|
check: run-test-local
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
clean-local:
|
|
|
|
-rm -fr dir-*
|
|
|
|
-rm -f *.exe *.dll *.netmodule *.out *.pdb *.mdb casts.cs *.log
|
|
|
|
-rm -f xml-*.xml
|
|
|
|
|
|
|
|
dist-local: dist-default
|
|
|
|
rm -f $(distdir)/casts.cs
|
|
|
|
|
|
|
|
csproj-local:
|
|
|
|
|
|
|
|
%-il.dll: %-il.il
|
|
|
|
$(ILASM) /dll $<
|
|
|
|
|
|
|
|
%-lib.dll: %-lib.il
|
|
|
|
$(ILASM) /dll /out:$@ $<
|
|
|
|
|
2017-04-10 11:41:01 +00:00
|
|
|
CSCOMPILE_UTIL = $(CSCOMPILE) -noconfig -nologo -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll
|
|
|
|
|
2014-08-13 10:39:27 +01:00
|
|
|
setup:
|
2017-04-10 11:41:01 +00:00
|
|
|
$(CSCOMPILE_UTIL) -t:library dlls/test-679-2/test-679-lib-2.cs -out:dlls/test-679-2/test-679-lib-2.dll
|
|
|
|
$(CSCOMPILE_UTIL) -t:library dlls/test-679-1/test-679-lib.cs -r:dlls/test-679-2/test-679-lib-2.dll -out:dlls/test-679-1/test-679-lib.dll
|
|
|
|
$(CSCOMPILE_UTIL) -t:library dlls/test-939-common.cs -keyfile:key.snk -publicsign -out:dlls/test-939-common.dll
|
|
|
|
$(CSCOMPILE_UTIL) -t:library dlls/test-939-1/test-939-lib.cs -keyfile:key.snk -publicsign -out:dlls/test-939-1/test-939-lib.dll
|
|
|
|
$(CSCOMPILE_UTIL) -t:library dlls/test-939-1/test-939-ref.cs -r:dlls/test-939-1/test-939-lib.dll -keyfile:key.snk -publicsign -out:dlls/test-939-1/test-939-ref.dll
|
|
|
|
$(CSCOMPILE_UTIL) -t:library dlls/test-939-2/test-939-lib.cs -r:dlls/test-939-common.dll -keyfile:key.snk -publicsign -out:dlls/test-939-2/test-939-lib.dll
|
2014-08-13 10:39:27 +01:00
|
|
|
$(ILASM) -dll dlls/test-883.il
|