1 # |
1 # |
2 # Copyright 1995-2009 Sun Microsystems, Inc. All Rights Reserved. |
2 # Copyright 1995-2010 Sun Microsystems, Inc. All Rights Reserved. |
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 # |
4 # |
5 # This code is free software; you can redistribute it and/or modify it |
5 # This code is free software; you can redistribute it and/or modify it |
6 # under the terms of the GNU General Public License version 2 only, as |
6 # under the terms of the GNU General Public License version 2 only, as |
7 # published by the Free Software Foundation. Sun designates this |
7 # published by the Free Software Foundation. Sun designates this |
207 |
201 |
208 # Expect JPRT to set JPRT_ARCHIVE_BUNDLE (path to zip bundle for results) |
202 # Expect JPRT to set JPRT_ARCHIVE_BUNDLE (path to zip bundle for results) |
209 ARCHIVE_BUNDLE = $(ABS_TEST_OUTPUT_DIR)/ARCHIVE_BUNDLE.zip |
203 ARCHIVE_BUNDLE = $(ABS_TEST_OUTPUT_DIR)/ARCHIVE_BUNDLE.zip |
210 ifdef JPRT_ARCHIVE_BUNDLE |
204 ifdef JPRT_ARCHIVE_BUNDLE |
211 ARCHIVE_BUNDLE = $(JPRT_ARCHIVE_BUNDLE) |
205 ARCHIVE_BUNDLE = $(JPRT_ARCHIVE_BUNDLE) |
212 endif |
|
213 |
|
214 # DISPLAY settings for virtual frame buffer |
|
215 START_XVFB = start-Xvfb.sh |
|
216 NOHUP_OUTPUT = $(ABS_TEST_OUTPUT_DIR)/start-Xvfb.nohup-output.txt |
|
217 DISPLAY_PID_FILE=$(ABS_TEST_OUTPUT_DIR)/xvfb-display-number.txt |
|
218 DISPLAY_SLEEP_TIME=10 |
|
219 DISPLAY_MAX_SLEEPS=10 |
|
220 ifeq ($(OS_NAME),solaris) |
|
221 VIRTUAL_FRAME_BUFFER = true |
|
222 endif |
|
223 ifeq ($(OS_NAME),linux) |
|
224 VIRTUAL_FRAME_BUFFER = true |
|
225 endif |
|
226 |
|
227 # Does not work yet, display dies as soon as it gets used. :^( |
|
228 VIRTUAL_FRAME_BUFFER = false |
|
229 |
|
230 # Are we using a VIRTUAL_FRAME_BUFFER (Xvfb) |
|
231 ifeq ($(VIRTUAL_FRAME_BUFFER),true) |
|
232 |
|
233 PREP_DISPLAY = \ |
|
234 $(CP) $(START_XVFB) $(ABS_TEST_OUTPUT_DIR); \ |
|
235 $(CHMOD) a+x $(ABS_TEST_OUTPUT_DIR)/$(START_XVFB); \ |
|
236 ( $(CD) $(ABS_TEST_OUTPUT_DIR) && \ |
|
237 $(NOHUP) $(ABS_TEST_OUTPUT_DIR)/$(START_XVFB) $(DISPLAY_PID_FILE) > $(NOHUP_OUTPUT) 2>&1 && \ |
|
238 $(SLEEP) $(DISPLAY_SLEEP_TIME) ) & \ |
|
239 count=1; \ |
|
240 while [ ! -s $(DISPLAY_PID_FILE) ] ; do \ |
|
241 $(ECHO) "Sleeping $(DISPLAY_SLEEP_TIME) more seconds, DISPLAY not ready"; \ |
|
242 $(SLEEP) $(DISPLAY_SLEEP_TIME); \ |
|
243 count=`$(EXPR) $${count} '+' 1`; \ |
|
244 if [ $${count} -gt $(DISPLAY_MAX_SLEEPS) ] ; then \ |
|
245 $(ECHO) "ERROR: DISPLAY not ready, giving up on DISPLAY"; \ |
|
246 exit 9; \ |
|
247 fi; \ |
|
248 done ; \ |
|
249 DISPLAY=":`$(CAT) $(DISPLAY_PID_FILE)`"; \ |
|
250 export DISPLAY; \ |
|
251 $(CAT) $(NOHUP_OUTPUT); \ |
|
252 $(ECHO) "Prepared DISPLAY=$${DISPLAY}"; \ |
|
253 $(XHOST) || \ |
|
254 ( $(ECHO) "ERROR: No display" ; exit 8) |
|
255 |
|
256 KILL_DISPLAY = \ |
|
257 ( \ |
|
258 DISPLAY=":`$(CAT) $(DISPLAY_PID_FILE)`"; \ |
|
259 export DISPLAY; \ |
|
260 if [ -s "$(DISPLAY_PID_FILE)" ] ; then \ |
|
261 $(KILL) `$(CAT) $(DISPLAY_PID_FILE)` > /dev/null 2>&1; \ |
|
262 $(KILL) -9 `$(CAT) $(DISPLAY_PID_FILE)` > /dev/null 2>&1; \ |
|
263 fi; \ |
|
264 $(ECHO) "Killed DISPLAY=$${DISPLAY}"; \ |
|
265 ) |
|
266 |
|
267 else |
|
268 |
|
269 PREP_DISPLAY = $(ECHO) "VIRTUAL_FRAME_BUFFER=$(VIRTUAL_FRAME_BUFFER)" |
|
270 KILL_DISPLAY = $(ECHO) "VIRTUAL_FRAME_BUFFER=$(VIRTUAL_FRAME_BUFFER)" |
|
271 |
|
272 endif |
206 endif |
273 |
207 |
274 # How to create the test bundle (pass or fail, we want to create this) |
208 # How to create the test bundle (pass or fail, we want to create this) |
275 # Follow command with ";$(BUNDLE_UP_AND_EXIT)", so it always gets executed. |
209 # Follow command with ";$(BUNDLE_UP_AND_EXIT)", so it always gets executed. |
276 ZIP_UP_RESULTS = ( $(MKDIR) -p `dirname $(ARCHIVE_BUNDLE)` \ |
210 ZIP_UP_RESULTS = ( $(MKDIR) -p `dirname $(ARCHIVE_BUNDLE)` \ |
627 | $(CUT) -d' ' -f1 \ |
561 | $(CUT) -d' ' -f1 \ |
628 | $(SED) -e 's@^@Excluding: @' |
562 | $(SED) -e 's@^@Excluding: @' |
629 ( \ |
563 ( \ |
630 ( JT_HOME=$(shell $(GETMIXEDPATH) "$(JT_HOME)"); \ |
564 ( JT_HOME=$(shell $(GETMIXEDPATH) "$(JT_HOME)"); \ |
631 export JT_HOME; \ |
565 export JT_HOME; \ |
632 $(PREP_DISPLAY) && \ |
|
633 $(shell $(GETMIXEDPATH) "$(JTREG)") \ |
566 $(shell $(GETMIXEDPATH) "$(JTREG)") \ |
634 $(JTREG_BASIC_OPTIONS) \ |
567 $(JTREG_BASIC_OPTIONS) \ |
635 -r:$(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/JTreport \ |
568 -r:$(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/JTreport \ |
636 -w:$(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/JTwork \ |
569 -w:$(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/JTwork \ |
637 -jdk:$(shell $(GETMIXEDPATH) "$(PRODUCT_HOME)") \ |
570 -jdk:$(shell $(GETMIXEDPATH) "$(PRODUCT_HOME)") \ |