jdk/test/Makefile
changeset 4991 38f33163acce
parent 4517 48e5b69c7e27
child 5149 efce9634bfc0
equal deleted inserted replaced
4990:2da1206f9f57 4991:38f33163acce
     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
    35 
    35 
    36 # Utilities used
    36 # Utilities used
    37 AWK       = awk
    37 AWK       = awk
    38 CAT       = cat
    38 CAT       = cat
    39 CD        = cd
    39 CD        = cd
    40 CHMOD     = chmod
       
    41 CP        = cp
    40 CP        = cp
    42 CUT       = cut
    41 CUT       = cut
    43 ECHO      = echo
    42 ECHO      = echo
    44 EGREP     = egrep
    43 EGREP     = egrep
    45 EXPAND    = expand
    44 EXPAND    = expand
    46 EXPR      = expr
       
    47 KILL      = /usr/bin/kill
       
    48 MKDIR     = mkdir
    45 MKDIR     = mkdir
    49 NOHUP     = nohup
       
    50 PWD       = pwd
    46 PWD       = pwd
    51 SED       = sed
    47 SED       = sed
    52 SLEEP     = sleep
       
    53 SORT      = sort
    48 SORT      = sort
    54 TEE       = tee
    49 TEE       = tee
    55 UNAME     = uname
    50 UNAME     = uname
    56 UNIQ      = uniq
    51 UNIQ      = uniq
    57 WC        = wc
    52 WC        = wc
    58 XHOST     = xhost
       
    59 ZIP       = zip
    53 ZIP       = zip
    60 
    54 
    61 # Get OS name from uname
    55 # Get OS name from uname
    62 UNAME_S := $(shell $(UNAME) -s)
    56 UNAME_S := $(shell $(UNAME) -s)
    63 
    57 
   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)`     \
   325       >> $(STATS_TXT); \
   259       >> $(STATS_TXT); \
   326   else \
   260   else \
   327     $(ECHO) "Missing file: $${_summary}" >> $(STATS_TXT); \
   261     $(ECHO) "Missing file: $${_summary}" >> $(STATS_TXT); \
   328   fi; \
   262   fi; \
   329   $(CAT) $(STATS_TXT); \
   263   $(CAT) $(STATS_TXT); \
   330   $(ZIP_UP_RESULTS) && $(KILL_DISPLAY) ; \
   264   $(ZIP_UP_RESULTS) ; \
   331   $(TESTEXIT) \
   265   $(TESTEXIT) \
   332 )
   266 )
   333 
   267 
   334 ################################################################
   268 ################################################################
   335 
   269 
   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)")                \