test/Makefile

Mon, 09 Mar 2009 13:28:46 -0700

author
xdono
date
Mon, 09 Mar 2009 13:28:46 -0700
changeset 1014
0fbdb4381b99
parent 995
b79faa366fbd
child 1216
44ccd7a9065c
permissions
-rw-r--r--

6814575: Update copyright year
Summary: Update copyright for files that have been modified in 2009, up to 03/09
Reviewed-by: katleman, tbell, ohair

     1 #
     2 # Copyright 1995-2009 Sun Microsystems, Inc.  All Rights Reserved.
     3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4 #
     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
     7 # published by the Free Software Foundation.
     8 #
     9 # This code is distributed in the hope that it will be useful, but WITHOUT
    10 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    11 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    12 # version 2 for more details (a copy is included in the LICENSE file that
    13 # accompanied this code).
    14 #
    15 # You should have received a copy of the GNU General Public License version
    16 # 2 along with this work; if not, write to the Free Software Foundation,
    17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    18 #
    19 # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    20 # CA 95054 USA or visit www.sun.com if you need additional information or
    21 # have any questions.
    22 #
    23 #
    25 #
    26 # Makefile to run various jdk tests
    27 #
    29 # Get OS/ARCH specifics
    30 OSNAME = $(shell uname -s)
    31 ifeq ($(OSNAME), SunOS)
    32   PLATFORM = solaris
    33   SLASH_JAVA = /java
    34   ARCH = $(shell uname -p)
    35   ifeq ($(ARCH), i386)
    36     ARCH=i586
    37   endif
    38 endif
    39 ifeq ($(OSNAME), Linux)
    40   PLATFORM = linux
    41   SLASH_JAVA = /java
    42   ARCH = $(shell uname -m)
    43   ifeq ($(ARCH), i386)
    44     ARCH = i586
    45   endif
    46 endif
    47 ifeq ($(OSNAME), Windows_NT)
    48   PLATFORM = windows
    49   SLASH_JAVA = J:
    50   ifeq ($(word 1, $(PROCESSOR_IDENTIFIER)),ia64)
    51     ARCH = ia64
    52   else
    53     ifeq ($(word 1, $(PROCESSOR_IDENTIFIER)),AMD64)
    54       ARCH = x64
    55     else
    56       ifeq ($(word 1, $(PROCESSOR_IDENTIFIER)),EM64T)
    57         ARCH = x64
    58       else
    59         ARCH = i586
    60       endif
    61     endif
    62   endif
    63   EXESUFFIX = .exe
    64 endif
    66 ifdef ALT_SLASH_JAVA
    67   SLASH_JAVA = $(ALT_SLASH_JAVA)
    68 endif
    70 # Utilities used
    71 CD    = cd
    72 CP    = cp
    73 ECHO  = echo
    74 MKDIR = mkdir
    75 ZIP   = zip
    77 # Root of this test area (important to use full paths in some places)
    78 TEST_ROOT := $(shell pwd)
    80 # Root of all test results
    81 ABS_BUILD_ROOT = $(TEST_ROOT)/../build/$(PLATFORM)-$(ARCH)
    82 ABS_TEST_OUTPUT_DIR = $(ABS_BUILD_ROOT)/testoutput
    84 # Expect JPRT to set PRODUCT_HOME (the product or jdk in this case to test)
    85 ifndef PRODUCT_HOME
    86   # Try to use j2sdk-image if it exists
    87   ABS_JDK_IMAGE = $(ABS_BUILD_ROOT)/j2sdk-image
    88   PRODUCT_HOME :=                       \
    89     $(shell                             \
    90       if [ -d $(ABS_JDK_IMAGE) ] ; then \
    91          $(ECHO) "$(ABS_JDK_IMAGE)";    \
    92        else                             \
    93          $(ECHO) "$(ABS_BUILD_ROOT)" ;  \
    94        fi)
    95 endif
    97 # Expect JPRT to set JAVA_ARGS (e.g. -server etc.)
    98 JAVA_OPTIONS = 
    99 ifdef JAVA_ARGS
   100   JAVA_OPTIONS = $(JAVA_ARGS)
   101 endif
   103 # Expect JPRT to set JPRT_ARCHIVE_BUNDLE (path to zip bundle for results)
   104 ARCHIVE_BUNDLE = $(ABS_TEST_OUTPUT_DIR)/ARCHIVE_BUNDLE.zip
   105 ifdef JPRT_ARCHIVE_BUNDLE
   106   ARCHIVE_BUNDLE = $(JPRT_ARCHIVE_BUNDLE)
   107 endif
   109 # How to create the test bundle (pass or fail, we want to create this)
   110 BUNDLE_UP = ( $(MKDIR) -p `dirname $(ARCHIVE_BUNDLE)`     \
   111 	      && $(CD) $(ABS_TEST_OUTPUT_DIR)             \
   112 	      && $(ZIP) -q -r $(ARCHIVE_BUNDLE) . )
   113 BUNDLE_UP_FAILED = ( exitCode=$$? && $(BUNDLE_UP) && exit $${exitCode} )
   115 ################################################################
   117 # Default make rule (runs jtreg_tests)
   118 all: jtreg_tests
   119 	@$(ECHO) "Testing completed successfully"
   121 # Prep for output
   122 prep: clean
   123 	@$(MKDIR) -p $(ABS_TEST_OUTPUT_DIR)
   124 	@$(MKDIR) -p `dirname $(ARCHIVE_BUNDLE)`
   126 # Cleanup
   127 clean:
   128 	$(RM) -r $(ABS_TEST_OUTPUT_DIR)
   129 	$(RM) $(ARCHIVE_BUNDLE)
   131 ################################################################
   133 # jtreg tests
   135 # Expect JT_HOME to be set for jtreg tests. (home for jtreg)
   136 JT_HOME = $(SLASH_JAVA)/re/jtreg/4.0/promoted/latest/binaries/jtreg
   137 ifdef JPRT_JTREG_HOME
   138   JT_HOME = $(JPRT_JTREG_HOME)
   139 endif
   141 # Expect JPRT to set TESTDIRS to the jtreg test dirs
   142 JTREG_TESTDIRS = demo/jvmti/gctest demo/jvmti/hprof
   143 ifdef TESTDIRS
   144   JTREG_TESTDIRS = $(TESTDIRS)
   145 endif
   147 # Default JTREG to run (win32 script works for everybody)
   148 JTREG = $(JT_HOME)/win32/bin/jtreg
   150 # Option to tell jtreg to not run tests marked with "ignore"
   151 ifeq ($(PLATFORM), windows)
   152   JTREG_KEY_OPTION = -k:!ignore
   153 else
   154   JTREG_KEY_OPTION = -k:\!ignore
   155 endif
   157 #EXTRA_JTREG_OPTIONS =
   159 jtreg_tests: prep $(JT_HOME) $(PRODUCT_HOME) $(JTREG)
   160 	$(JTREG) -a -v:fail,error               \
   161           $(JTREG_KEY_OPTION)                   \
   162           $(EXTRA_JTREG_OPTIONS)                \
   163           -r:$(ABS_TEST_OUTPUT_DIR)/JTreport    \
   164           -w:$(ABS_TEST_OUTPUT_DIR)/JTwork      \
   165           -jdk:$(PRODUCT_HOME)                  \
   166           $(JAVA_OPTIONS:%=-vmoption:%)         \
   167           $(JTREG_TESTDIRS)                     \
   168 	  || $(BUNDLE_UP_FAILED)
   169 	$(BUNDLE_UP)
   171 PHONY_LIST += jtreg_tests
   173 ################################################################
   175 # packtest
   177 # Expect JPRT to set JPRT_PACKTEST_HOME.
   178 PACKTEST_HOME = /net/jprt-web.sfbay.sun.com/jprt/allproducts/packtest
   179 ifdef JPRT_PACKTEST_HOME
   180   PACKTEST_HOME = $(JPRT_PACKTEST_HOME)
   181 endif
   183 #EXTRA_PACKTEST_OPTIONS =
   185 packtest: prep $(PACKTEST_HOME)/ptest $(PRODUCT_HOME)
   186 	( $(CD) $(PACKTEST_HOME) &&            \
   187 	    $(PACKTEST_HOME)/ptest             \
   188 		 -t "$(PRODUCT_HOME)"          \
   189 	         $(PACKTEST_STRESS_OPTION)     \
   190 		 $(EXTRA_PACKTEST_OPTIONS)     \
   191 		 -W $(ABS_TEST_OUTPUT_DIR)     \
   192                  $(JAVA_OPTIONS:%=-J %)        \
   193 	 ) || $(BUNDLE_UP_FAILED)
   194 	$(BUNDLE_UP)
   196 packtest_stress: PACKTEST_STRESS_OPTION=-s
   197 packtest_stress: packtest
   199 PHONY_LIST += packtest packtest_stress
   201 ################################################################
   203 # Phony targets (e.g. these are not filenames)
   204 .PHONY: all clean prep $(PHONY_LIST)
   206 ################################################################

mercurial