< prev index next >

hotspot/test/Makefile

Print this page


   1 #
   2 # Copyright (c) 1995, 2014, Oracle and/or its affiliates. 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20 # or visit www.oracle.com if you need additional information or have any
  21 # questions.
  22 #


 131 
 132 # Expect JPRT to set PRODUCT_HOME (the product or jdk in this case to test)
 133 ifndef PRODUCT_HOME
 134   # Try to use j2sdk-image if it exists
 135   ABS_JDK_IMAGE = $(ABS_BUILD_ROOT)/j2sdk-image
 136   PRODUCT_HOME :=                       \
 137     $(shell                             \
 138       if [ -d $(ABS_JDK_IMAGE) ] ; then \
 139          $(ECHO) "$(ABS_JDK_IMAGE)";    \
 140        else                             \
 141          $(ECHO) "$(ABS_BUILD_ROOT)" ;  \
 142        fi)
 143 endif
 144 
 145 # Expect JPRT to set JAVA_ARGS (e.g. -server etc.)
 146 JAVA_OPTIONS = 
 147 ifdef JAVA_ARGS
 148   JAVA_OPTIONS = $(JAVA_ARGS)
 149 endif
 150 













 151 # Expect JPRT to set JPRT_ARCHIVE_BUNDLE (path to zip bundle for results)
 152 ARCHIVE_BUNDLE = $(ABS_TEST_OUTPUT_DIR)/ARCHIVE_BUNDLE.zip
 153 ifdef JPRT_ARCHIVE_BUNDLE
 154   ARCHIVE_BUNDLE = $(JPRT_ARCHIVE_BUNDLE)
 155 endif
 156 
 157 # How to create the test bundle (pass or fail, we want to create this)
 158 #   Follow command with ";$(BUNDLE_UP_AND_EXIT)", so it always gets executed.
 159 ZIP_UP_RESULTS = ( $(MKDIR) -p `$(DIRNAME) $(ARCHIVE_BUNDLE)`     \
 160                    && $(CD) $(ABS_TEST_OUTPUT_DIR)             \
 161                    && $(CHMOD) -R a+r . \
 162                    && $(ZIP) -q -r $(ARCHIVE_BUNDLE) . )
 163 
 164 # important results files
 165 SUMMARY_TXT = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/JTreport/text/summary.txt")
 166 STATS_TXT_NAME = Stats.txt
 167 STATS_TXT = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/$(STATS_TXT_NAME)")
 168 RUNLIST   = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/runlist.txt")
 169 PASSLIST  = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/passlist.txt")
 170 FAILLIST  = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/faillist.txt")


 286 # Option to tell jtreg to not run tests marked with "ignore"
 287 ifeq ($(PLATFORM), windows)
 288   JTREG_KEY_OPTION = -k:!ignore
 289 else
 290   JTREG_KEY_OPTION = -k:\!ignore
 291 endif
 292 JTREG_BASIC_OPTIONS += $(JTREG_KEY_OPTION)
 293 
 294 # Make sure jtreg exists
 295 $(JTREG): $(JT_HOME)
 296 
 297 jtreg_tests: prep $(PRODUCT_HOME) $(JTREG)
 298         (                                                                    \
 299           ( JT_HOME=$(shell $(GETMIXEDPATH) "$(JT_HOME)");                   \
 300             export JT_HOME;                                                  \
 301             $(shell $(GETMIXEDPATH) "$(JTREG)")                              \
 302               $(JTREG_BASIC_OPTIONS)                                         \
 303               -r:$(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/JTreport")  \
 304               -w:$(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/JTwork")    \
 305               -jdk:$(shell $(GETMIXEDPATH) "$(PRODUCT_HOME)")                \

 306               $(JTREG_EXCLUSIONS)                                            \
 307               $(JTREG_TEST_OPTIONS)                                          \
 308               $(TEST_SELECTION)                                              \
 309           ) ;                                                                \
 310           $(BUNDLE_UP_AND_EXIT)                                              \
 311         ) 2>&1 | $(TEE) $(ABS_TEST_OUTPUT_DIR)/output.txt ; $(TESTEXIT)
 312 
 313 PHONY_LIST += jtreg_tests
 314 
 315 # flags used to execute java in test targets
 316 TEST_FLAGS += -version -Xinternalversion -X -help 
 317 
 318 sanitytest: prep $(PRODUCT_HOME)
 319         @for flag in $(TEST_FLAGS);                                             \
 320         do                                                                      \
 321             echo Executing java $(JAVA_OPTIONS) $$flag;                         \
 322             $(PRODUCT_HOME)/bin/java $(JAVA_OPTIONS) $$flag;                    \
 323             res=$$?;                                                            \
 324             if [ $$res -ne 0 ]; then                                            \
 325                 exit $$res;                                                     \


   1 #
   2 # Copyright (c) 1995, 2015, Oracle and/or its affiliates. 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20 # or visit www.oracle.com if you need additional information or have any
  21 # questions.
  22 #


 131 
 132 # Expect JPRT to set PRODUCT_HOME (the product or jdk in this case to test)
 133 ifndef PRODUCT_HOME
 134   # Try to use j2sdk-image if it exists
 135   ABS_JDK_IMAGE = $(ABS_BUILD_ROOT)/j2sdk-image
 136   PRODUCT_HOME :=                       \
 137     $(shell                             \
 138       if [ -d $(ABS_JDK_IMAGE) ] ; then \
 139          $(ECHO) "$(ABS_JDK_IMAGE)";    \
 140        else                             \
 141          $(ECHO) "$(ABS_BUILD_ROOT)" ;  \
 142        fi)
 143 endif
 144 
 145 # Expect JPRT to set JAVA_ARGS (e.g. -server etc.)
 146 JAVA_OPTIONS =
 147 ifdef JAVA_ARGS
 148   JAVA_OPTIONS = $(JAVA_ARGS)
 149 endif
 150 
 151 # jtreg -nativepath <dir>
 152 #
 153 # Local make tests will be TEST_IMAGE_DIR and JPRT with jprt.use.reg.test.bundle=true
 154 # should be JPRT_TESTNATIVE_PATH
 155 ifdef TEST_IMAGE_DIR
 156   TESTNATIVE_DIR = $(TEST_IMAGE_DIR)
 157 else ifdef JPRT_TESTNATIVE_PATH
 158   TESTNATIVE_DIR = $(JPRT_TESTNATIVE_PATH)
 159 endif
 160 ifdef TESTNATIVE_DIR
 161   JTREG_NATIVE_PATH = -nativepath:$(shell $(GETMIXEDPATH) "$(TESTNATIVE_DIR)/hotspot/jtreg/native")
 162 endif
 163 
 164 # Expect JPRT to set JPRT_ARCHIVE_BUNDLE (path to zip bundle for results)
 165 ARCHIVE_BUNDLE = $(ABS_TEST_OUTPUT_DIR)/ARCHIVE_BUNDLE.zip
 166 ifdef JPRT_ARCHIVE_BUNDLE
 167   ARCHIVE_BUNDLE = $(JPRT_ARCHIVE_BUNDLE)
 168 endif
 169 
 170 # How to create the test bundle (pass or fail, we want to create this)
 171 #   Follow command with ";$(BUNDLE_UP_AND_EXIT)", so it always gets executed.
 172 ZIP_UP_RESULTS = ( $(MKDIR) -p `$(DIRNAME) $(ARCHIVE_BUNDLE)`     \
 173                    && $(CD) $(ABS_TEST_OUTPUT_DIR)             \
 174                    && $(CHMOD) -R a+r . \
 175                    && $(ZIP) -q -r $(ARCHIVE_BUNDLE) . )
 176 
 177 # important results files
 178 SUMMARY_TXT = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/JTreport/text/summary.txt")
 179 STATS_TXT_NAME = Stats.txt
 180 STATS_TXT = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/$(STATS_TXT_NAME)")
 181 RUNLIST   = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/runlist.txt")
 182 PASSLIST  = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/passlist.txt")
 183 FAILLIST  = $(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/faillist.txt")


 299 # Option to tell jtreg to not run tests marked with "ignore"
 300 ifeq ($(PLATFORM), windows)
 301   JTREG_KEY_OPTION = -k:!ignore
 302 else
 303   JTREG_KEY_OPTION = -k:\!ignore
 304 endif
 305 JTREG_BASIC_OPTIONS += $(JTREG_KEY_OPTION)
 306 
 307 # Make sure jtreg exists
 308 $(JTREG): $(JT_HOME)
 309 
 310 jtreg_tests: prep $(PRODUCT_HOME) $(JTREG)
 311         (                                                                    \
 312           ( JT_HOME=$(shell $(GETMIXEDPATH) "$(JT_HOME)");                   \
 313             export JT_HOME;                                                  \
 314             $(shell $(GETMIXEDPATH) "$(JTREG)")                              \
 315               $(JTREG_BASIC_OPTIONS)                                         \
 316               -r:$(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/JTreport")  \
 317               -w:$(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)/JTwork")    \
 318               -jdk:$(shell $(GETMIXEDPATH) "$(PRODUCT_HOME)")                \
 319               $(JTREG_NATIVE_PATH)                                           \
 320               $(JTREG_EXCLUSIONS)                                            \
 321               $(JTREG_TEST_OPTIONS)                                          \
 322               $(TEST_SELECTION)                                              \
 323           ) ;                                                                \
 324           $(BUNDLE_UP_AND_EXIT)                                              \
 325         ) 2>&1 | $(TEE) $(ABS_TEST_OUTPUT_DIR)/output.txt ; $(TESTEXIT)
 326 
 327 PHONY_LIST += jtreg_tests
 328 
 329 # flags used to execute java in test targets
 330 TEST_FLAGS += -version -Xinternalversion -X -help
 331 
 332 sanitytest: prep $(PRODUCT_HOME)
 333         @for flag in $(TEST_FLAGS);                                             \
 334         do                                                                      \
 335             echo Executing java $(JAVA_OPTIONS) $$flag;                         \
 336             $(PRODUCT_HOME)/bin/java $(JAVA_OPTIONS) $$flag;                    \
 337             res=$$?;                                                            \
 338             if [ $$res -ne 0 ]; then                                            \
 339                 exit $$res;                                                     \


< prev index next >