Welcome to mirror list, hosted at ThFree Co, Russian Federation.

Makefile.am « testing_gac « tests « mono - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 588ab6d1a2b3b79b4c75cec60cc17e2260f6a4f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
include $(top_srcdir)/mk/common.mk

### buildtree stuff

CLASS=$(mcs_topdir)/class/lib/$(DEFAULT_PROFILE)

if FULL_AOT_TESTS
PROFILE_MCS_FLAGS = -d:MOBILE,MOBILE_LEGACY,FULL_AOT_DESKTOP 
endif

if HYBRID_AOT_TESTS
PROFILE_MCS_FLAGS = -d:MOBILE,MOBILE_LEGACY 
endif

### test runner stuff

if HOST_WIN32
PLATFORM_PATH_SEPARATOR=;
else
PLATFORM_PATH_SEPARATOR=:
endif

RUNTIME= $(top_builddir)/runtime/mono-wrapper
TEST_RUNTIME = MONO_PATH=$(CLASS) $(RUNTIME)
TOOLS_RUNTIME= MONO_PATH=$(mcs_topdir)/class/lib/build $(RUNTIME)

# These tests are testing strict assembly strong-name resolution
TEST_RUNNER = ../test-runner.exe --runtime $(RUNTIME) --runtime-args "--assembly-loader=strict"

if HOST_WIN32
if ENABLE_MSVC
	DEFAULT_WIN32_RUNTIME=$(shell cygpath -w -a $(top_builddir)/@mono_runtime@ | sed 's/\\/\\\\/g')
else
	DEFAULT_WIN32_RUNTIME=$(top_builddir)/runtime/mono-wrapper)
endif
TEST_RUNNER_ARGS=--runtime $(if $(MONO_EXECUTABLE),$(shell cygpath -w -a $(MONO_EXECUTABLE) | sed 's/\\/\\\\/g'),$(DEFAULT_WIN32_RUNTIME))
else
TEST_RUNNER_ARGS=--runtime $(if $(MONO_EXECUTABLE),$(MONO_EXECUTABLE),mono)
endif

TEST_RUNNER_ARGS += $(if $(V), --verbose,)

if FULL_AOT_TESTS
TEST_RUNNER += --runtime-args "$(AOT_RUN_FLAGS)"
endif

if HYBRID_AOT_TESTS
TEST_RUNNER += --runtime-args "$(AOT_RUN_FLAGS)"
endif

### tools

GACUTIL= $(mcs_topdir)/class/lib/build/gacutil.exe
SN= $(mcs_topdir)/class/lib/build/sn.exe

MCS= $(TOOLS_RUNTIME) $(CSC) -noconfig -nologo -debug:portable -target:library $(PROFILE_MCS_FLAGS)

### testcase stuff

BASE_MONO_PATH=$(CLASS)

V1_SRC= v1/gactestlib.cs
V2_SRC= v2/gactestlib.cs
APP_V1_SRC = v1/app.cs v1/app-refl-load.cs

APP_SIGNED_V1_EXE = app-v1.exe app-refl-load-v1.exe

APP_BOTH_EXE = app-both.exe

UNSIGNED_V1_DLL= unsigned_v1/gactestlib.dll
UNSIGNED_V2_DLL= unsigned_v2/gactestlib.dll

SIGNED_V1_DLL= signed_v1/gactestlib.dll
SIGNED_V2_DLL= signed_v2/gactestlib.dll

GACTESTLIB_SRCS= $(V1_SRC) $(V2_SRC)
GACTESTLIB_DLLS= $(SIGNED_V1_DLL) $(SIGNED_V2_DLL) $(UNSIGNED_V1_DLL) $(UNSIGNED_V2_DLL)

#if FULL_AOT_TESTS
#GACTESTLIB_DLLS_AOT=$(GACTESTLIB_DLLS:.dll=.dll$(PLATFORM_AOT_SUFFIX))
#APP_SIGNED_V1_AOT=$(APP_SIGNED_V1_EXE:.exe=.exe$(PLATFORM_AOT_SUFFIX))
#endif

#if HYBRID_AOT_TESTS
#GACTESTLIB_DLLS_AOT=$(GACTESTLIB_DLLS:.dll=.dll$(PLATFORM_AOT_SUFFIX))
#APP_SIGNED_V1_AOT=$(APP_SIGNED_V1_EXE:.exe=.exe$(PLATFORM_AOT_SUFFIX))
#endif


SIGNING_KEY= $(srcdir)/testkey.snk

# prefix for the testing gac.  gacutil will add lib/mono/gac directories
GACDIR=.

SIGN= -delaysign -keyfile:$(SIGNING_KEY)


### autotools stuff

EXTRA_DIST= README $(SIGNING_KEY) $(GACTESTLIB_SRCS) 

### Test cases

.PHONY: run-test test-local prereqs

run-test:
	true
if !FULL_AOT_TESTS
if !HYBRID_AOT_TESTS
	$(MAKE) test-app-both
	$(MAKE) test-signed-v1-app-mp-unsigned-v1
	$(MAKE) test-signed-v1-app-mp-signed-v1
	$(MAKE) test-signed-v1-app-mp-unsigned-v2-signed-v1
	$(MAKE) test-signed-v1-app-mp-signed-v2-signed-v1
	$(MAKE) test-signed-v1-app-gac
endif
endif

test-local: prereqs $(APP_SIGNED_V1_EXE) $(APP_BOTH_EXE) $(APP_SIGNED_V1_AOT)

prereqs: $(GACTESTLIB_DLLS) $(GACTESTLIB_DLLS_AOT)
	$(MAKE) gacinstall

$(UNSIGNED_V1_DLL): $(V1_SRC)
	-mkdir -p $(@D)
	$(MCS) -out:$@ $<

$(UNSIGNED_V2_DLL): $(V2_SRC)
	-mkdir -p $(@D)
	$(MCS) -out:$@ $<

$(SIGNED_V1_DLL): $(V1_SRC) $(SIGNING_KEY)
	-mkdir -p $(@D)
	$(MCS) -out:$@ $(SIGN) $< && $(TOOLS_RUNTIME) $(SN) -R $@ $(SIGNING_KEY)

$(SIGNED_V2_DLL): $(V2_SRC) $(SIGNING_KEY)
	-mkdir -p $(@D)
	$(MCS) -out:$@ $(SIGN) $< && $(TOOLS_RUNTIME) $(SN) -R $@ $(SIGNING_KEY)

app-both.exe: app-both.cs $(SIGNED_V1_DLL) $(SIGNED_V2_DLL)
	$(MCS) -target:exe -out:$@ -r:V1=$(SIGNED_V1_DLL) /r:V2=$(SIGNED_V2_DLL) $<

%-v1.exe: v1/%.cs $(SIGNED_V1_DLL)
	$(MCS) -target:exe -out:$@ -r:$(SIGNED_V1_DLL) $<

%.exe$(PLATFORM_AOT_SUFFIX): %.exe 
	$(TEST_RUNTIME) $(AOT_BUILD_FLAGS) $<

%.dll$(PLATFORM_AOT_SUFFIX): %.dll 
	$(TEST_RUNTIME) $(AOT_BUILD_FLAGS) $<

# MONO_PATH tests

test-signed-v1-app-mp-unsigned-v1: $(APP_SIGNED_V1_EXE) prereqs
	$(TOOLS_RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name "testing_gac_$@" --mono-path "unsigned_v1$(PLATFORM_PATH_SEPARATOR)$(BASE_MONO_PATH)" --expected-exit-code 1 $(APP_SIGNED_V1_EXE)

test-signed-v1-app-mp-signed-v1: $(APP_SIGNED_V1_EXE) prereqs
	$(TOOLS_RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name "testing_gac_$@" --mono-path "signed_v1$(PLATFORM_PATH_SEPARATOR)$(BASE_MONO_PATH)"  $(APP_SIGNED_V1_EXE)

test-signed-v1-app-mp-unsigned-v2-signed-v1: $(APP_SIGNED_V1_EXE) prereqs
	$(TOOLS_RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name "testing_gac_$@" --mono-path "unsigned_v2$(PLATFORM_PATH_SEPARATOR)signed_v1$(PLATFORM_PATH_SEPARATOR)$(BASE_MONO_PATH)" $(APP_SIGNED_V1_EXE)

test-signed-v1-app-mp-signed-v2-signed-v1: $(APP_SIGNED_V1_EXE) prereqs
	$(TOOLS_RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name "testing_gac_$@" --mono-path "signed_v2$(PLATFORM_PATH_SEPARATOR)signed_v1$(PLATFORM_PATH_SEPARATOR)$(BASE_MONO_PATH)" $(APP_SIGNED_V1_EXE)

# N.B. the path order is important - the test needs to load v1 successfully and then try to load v2 from the v1 directory.
test-app-both: $(APP_BOTH_EXE) prereqs
	$(TOOLS_RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name "testing_gac_$@" --mono-path "signed_v1$(PLATFORM_PATH_SEPARATOR)signed_v2$(PLATFORM_PATH_SEPARATOR)$(BASE_MONO_PATH)" app-both.exe

# MONO_GAC_PREFIX tests

test-signed-v1-app-gac: $(APP_SIGNED_V1_EXE) gacinstall prereqs
	$(TOOLS_RUNTIME) $(TEST_RUNNER) $(TEST_RUNNER_ARGS) --testsuite-name "testing_gac_$@" --mono-gac-prefix $(GACDIR) $(APP_SIGNED_V1_EXE)

.PHONY: gacinstall

gacinstall: $(SIGNED_V1_DLL) $(GACTESTLIB_DLLS_AOT)
	$(TOOLS_RUNTIME) $(GACUTIL) -i $< -gacdir $(GACDIR) 

mostlyclean-local: clean-gac-subdir clean-gactestlib-dll
	-rm -f TestResult-*.xml

.PHONY: clean-gac-subdir clean-gactestlib-dll

clean-gac-subdir:
	-rm -rf $(GACDIR)/lib/mono/gac/

clean-gactestlib-dll:
	-rm -f $(GACTESTLIB_DLLS)
	-rm -f $(GACTESTLIB_DLLS_AOT)
	-rm -f $(APP_SIGNED_V1_EXE) $(APP_SIGNED_V1_AOT)