222 $(BUILD_DIR_64)/.installed: BITS=64 |
222 $(BUILD_DIR_64)/.installed: BITS=64 |
223 |
223 |
224 # set the default target for installation of the component |
224 # set the default target for installation of the component |
225 COMPONENT_INSTALL_TARGETS = install |
225 COMPONENT_INSTALL_TARGETS = install |
226 |
226 |
|
227 # set the default test results directory |
|
228 COMPONENT_TEST_RESULTS_DIR = $(COMPONENT_DIR)/test |
|
229 |
|
230 # set the default master test results file |
|
231 COMPONENT_TEST_MASTER = $(COMPONENT_TEST_RESULTS_DIR)/results-$(BITS).master |
|
232 |
|
233 # set the default test results output file |
|
234 COMPONENT_TEST_OUTPUT = $(COMPONENT_TEST_RESULTS_DIR)/test-$(BITS)-results |
|
235 |
|
236 # set the default test results comparison diffs file |
|
237 COMPONENT_TEST_DIFFS = $(COMPONENT_TEST_RESULTS_DIR)/test-$(BITS)-diffs |
|
238 |
|
239 # set the default test snapshot file |
|
240 COMPONENT_TEST_SNAPSHOT = $(COMPONENT_TEST_RESULTS_DIR)/results-$(BITS).snapshot |
|
241 |
|
242 # The set of default transforms to be applied to the test results to try |
|
243 # to normalize them. |
|
244 COMPONENT_TEST_TRANSFORMS = \ |
|
245 '-e "s|$(@D)|\\$$(@D)|g" ' \ |
|
246 '-e "s|$(PERL)|\\$$(PERL)|g" ' \ |
|
247 '-e "s|$(SOURCE_DIR)|\\$$(SOURCE_DIR)|g" ' |
|
248 |
|
249 # set the default commands used to generate the file containing the set |
|
250 # of transforms to be applied to the test results to try to normalize them. |
|
251 COMPONENT_TEST_CREATE_TRANSFORMS = \ |
|
252 if [ -e $(COMPONENT_TEST_MASTER) ]; \ |
|
253 then \ |
|
254 print "\#!/bin/sh" > $(COMPONENT_TEST_TRANSFORM_CMD); \ |
|
255 print '$(GSED) ' \ |
|
256 $(COMPONENT_TEST_TRANSFORMS) \ |
|
257 ' \\' >> $(COMPONENT_TEST_TRANSFORM_CMD); \ |
|
258 print '$(COMPONENT_TEST_OUTPUT) \\' \ |
|
259 >> $(COMPONENT_TEST_TRANSFORM_CMD); \ |
|
260 print '> $(COMPONENT_TEST_SNAPSHOT)' \ |
|
261 >> $(COMPONENT_TEST_TRANSFORM_CMD); \ |
|
262 fi |
|
263 |
|
264 # set the default command for performing any test result munging |
|
265 COMPONENT_TEST_TRANSFORM_CMD = $(COMPONENT_TEST_RESULTS_DIR)/transform-$(BITS)-results |
|
266 |
|
267 # set the default operation to run to perform test result normalization |
|
268 COMPONENT_TEST_PERFORM_TRANSFORM = \ |
|
269 if [ -e $(COMPONENT_TEST_MASTER) ]; \ |
|
270 then \ |
|
271 $(SHELL) $(COMPONENT_TEST_TRANSFORM_CMD); \ |
|
272 fi |
|
273 |
|
274 # set the default command used to compare the master results with the snapshot |
|
275 COMPONENT_TEST_COMPARE_CMD = $(GDIFF) -uN |
|
276 |
|
277 # set the default way that master and snapshot test results are compared |
|
278 COMPONENT_TEST_COMPARE = \ |
|
279 if [ -e $(COMPONENT_TEST_MASTER) ]; \ |
|
280 then \ |
|
281 $(COMPONENT_TEST_COMPARE_CMD) \ |
|
282 $(COMPONENT_TEST_MASTER) $(COMPONENT_TEST_SNAPSHOT) \ |
|
283 > $(COMPONENT_TEST_DIFFS); \ |
|
284 print "Test results in $(COMPONENT_TEST_OUTPUT)"; \ |
|
285 if [ -s $(COMPONENT_TEST_DIFFS) ]; \ |
|
286 then \ |
|
287 print "Differences found."; \ |
|
288 $(CAT) $(COMPONENT_TEST_DIFFS); \ |
|
289 exit 2; \ |
|
290 else \ |
|
291 print "No differences found."; \ |
|
292 fi \ |
|
293 fi |
|
294 |
|
295 # set the default env command to use for test of the component |
|
296 COMPONENT_TEST_ENV_CMD = $(ENV) |
|
297 |
|
298 # set the default command to use for test of the component |
|
299 COMPONENT_TEST_CMD = $(GMAKE) |
|
300 |
|
301 # set the default target for test of the component |
|
302 COMPONENT_TEST_TARGETS = check |
|
303 |
|
304 # set the default directory for test of the component |
|
305 COMPONENT_TEST_DIR = $(@D) |
|
306 |
|
307 # determine the type of tests we want to run. |
|
308 ifeq ($(strip $(wildcard $(COMPONENT_TEST_RESULTS_DIR)/results-*.master)),) |
227 TEST_32 = $(BUILD_DIR_32)/.tested |
309 TEST_32 = $(BUILD_DIR_32)/.tested |
228 TEST_64 = $(BUILD_DIR_64)/.tested |
310 TEST_64 = $(BUILD_DIR_64)/.tested |
|
311 else |
|
312 TEST_32 = $(BUILD_DIR_32)/.tested-and-compared |
|
313 TEST_64 = $(BUILD_DIR_64)/.tested-and-compared |
|
314 endif |
229 TEST_32_and_64 = $(TEST_32) $(TEST_64) |
315 TEST_32_and_64 = $(TEST_32) $(TEST_64) |
230 $(BUILD_DIR_32)/.tested: BITS=32 |
316 $(BUILD_DIR_32)/.tested: BITS=32 |
231 $(BUILD_DIR_64)/.tested: BITS=64 |
317 $(BUILD_DIR_64)/.tested: BITS=64 |
232 |
318 $(BUILD_DIR_32)/.tested-and-compared: BITS=32 |
233 # set the default env command to use for test of the component |
319 $(BUILD_DIR_64)/.tested-and-compared: BITS=64 |
234 COMPONENT_TEST_ENV_CMD = $(ENV) |
320 |
235 |
|
236 # set the default command to use for test of the component |
|
237 COMPONENT_TEST_CMD = $(GMAKE) |
|
238 |
|
239 # set the default target for test of the component |
|
240 COMPONENT_TEST_TARGETS = check |
|
241 |
|
242 # set the default directory for test of the component |
|
243 COMPONENT_TEST_DIR = $(@D) |
|
244 |
321 |
245 # BUILD_TOOLS is the root of all tools not normally installed on the system. |
322 # BUILD_TOOLS is the root of all tools not normally installed on the system. |
246 BUILD_TOOLS ?= /ws/on12-tools |
323 BUILD_TOOLS ?= /ws/on12-tools |
247 |
324 |
248 SPRO_ROOT = $(BUILD_TOOLS)/SUNWspro |
325 SPRO_ROOT = $(BUILD_TOOLS)/SUNWspro |