test/hotspot/jtreg/Makefile
changeset 47216 71c04702a3d5
parent 47100 17953cf82d51
child 47218 918745561887
equal deleted inserted replaced
47215:4ebc2e2fb97c 47216:71c04702a3d5
       
     1 #
       
     2 # Copyright (c) 1995, 2016, 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.  Oracle designates this
       
     8 # particular file as subject to the "Classpath" exception as provided
       
     9 # by Oracle in the LICENSE file that accompanied this code.
       
    10 #
       
    11 # This code is distributed in the hope that it will be useful, but WITHOUT
       
    12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
       
    13 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
       
    14 # version 2 for more details (a copy is included in the LICENSE file that
       
    15 # accompanied this code).
       
    16 #
       
    17 # You should have received a copy of the GNU General Public License version
       
    18 # 2 along with this work; if not, write to the Free Software Foundation,
       
    19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
       
    20 #
       
    21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
       
    22 # or visit www.oracle.com if you need additional information or have any
       
    23 # questions.
       
    24 #
       
    25 #
       
    26 
       
    27 NATIVE_TEST_PATH := hotspot/jtreg/native
       
    28 
       
    29 TREAT_EXIT_CODE_1_AS_0 := true
       
    30 
       
    31 CLEAN_BEFORE_PREP := true
       
    32 
       
    33 USE_JTREG_VERSION := 4.1
       
    34 
       
    35 USE_JTREG_ASSERT := false
       
    36 
       
    37 LIMIT_JTREG_VM_MEMORY := false
       
    38 
       
    39 IGNORE_MARKED_TESTS := true
       
    40 
       
    41 # Get OS name from uname (Cygwin inexplicably adds _NT-5.1)
       
    42 UNAME_S := $(shell uname -s | cut -f1 -d_)
       
    43 
       
    44 ifeq ($(UNAME_S), SunOS)
       
    45   NUM_CORES := $(shell LC_MESSAGES=C /usr/sbin/psrinfo -v | grep -c on-line)
       
    46 endif
       
    47 ifeq ($(UNAME_S), Linux)
       
    48   NUM_CORES := $(shell cat /proc/cpuinfo  | grep -c processor)
       
    49 endif
       
    50 ifeq ($(UNAME_S), Darwin)
       
    51   NUM_CORES := $(shell /usr/sbin/sysctl -n hw.ncpu)
       
    52 endif
       
    53 ifeq ($(findstring CYGWIN,$(UNAME_S)), CYGWIN)
       
    54   ifneq ($(NUMBER_OF_PROCESSORS), )
       
    55     NUM_CORES := $(NUMBER_OF_PROCESSORS)
       
    56   else
       
    57     ifneq ($(HOTSPOT_BUILD_JOBS), )
       
    58       NUM_CORES := $(HOTSPOT_BUILD_JOBS)
       
    59     else
       
    60       NUM_CORES := 1 # fallback
       
    61     endif
       
    62   endif
       
    63 endif
       
    64 
       
    65 # Concurrency based on min(cores / 2, 12)
       
    66 CONCURRENCY := $(shell expr $(NUM_CORES) / 2)
       
    67 ifeq ($(CONCURRENCY), 0)
       
    68   CONCURRENCY := 1
       
    69 else ifeq ($(shell expr $(CONCURRENCY) \> 12), 1)
       
    70   CONCURRENCY := 12
       
    71 endif
       
    72 
       
    73 # Make sure MaxRAMPercentage is high enough to not cause OOM or swapping since we may end up with a lot of JVM's
       
    74 JTREG_BASIC_OPTIONS += -vmoption:-XX:MaxRAMPercentage=$(shell expr 25 / $(CONCURRENCY))
       
    75 
       
    76 # Include the common base file with most of the logic
       
    77 include ../../test/TestCommon.gmk
       
    78 
       
    79 ################################################################
       
    80 # Default make rule (runs jtreg_tests)
       
    81 all: hotspot_all
       
    82 	@$(ECHO) "Testing completed successfully"
       
    83 
       
    84 # Support "hotspot_" prefixed test make targets (too)
       
    85 # The hotspot_% targets are used by the top level Makefile
       
    86 # Unless explicitly defined below, hotspot_<x> is interpreted as a jtreg test group name
       
    87 hotspot_%:
       
    88 	$(ECHO) "Running tests: $@"
       
    89 	$(MAKE) -j 1 TEST_SELECTION=":$@" UNIQUE_DIR=$@ jtreg_tests;
       
    90 
       
    91 hotspot_internal:
       
    92 	$(ALT_OUTPUTDIR)/jdk/bin/java -XX:+ExecuteInternalVMTests -XX:+ShowMessageBoxOnError -version
       
    93 
       
    94 ################################################################
       
    95 ALT_MAKE ?= closed
       
    96 -include $(ALT_MAKE)/Makefile
       
    97 
       
    98 ################################################################
       
    99 
       
   100 # Set up the directory in which the jvm directories live (client/, server/, etc.)
       
   101 ifeq ($(PLATFORM),windows)
       
   102 JVMS_DIR := $(PRODUCT_HOME)/bin
       
   103 else
       
   104 JVMS_DIR := $(PRODUCT_HOME)/lib
       
   105 endif
       
   106 
       
   107 # Use the existance of a directory as a sign that jvm variant is available
       
   108 CANDIDATE_JVM_VARIANTS := client minimal server
       
   109 JVM_VARIANTS := $(strip $(foreach x,$(CANDIDATE_JVM_VARIANTS),$(if $(wildcard $(JVMS_DIR)/$(x)),$(x))))
       
   110 
       
   111 ################################################################
       
   112 
       
   113 # Run the native gtest tests from the test image
       
   114 
       
   115 define NEWLINE
       
   116 
       
   117 
       
   118 endef
       
   119 
       
   120 
       
   121 hotspot_gtest:
       
   122 	$(foreach v, $(JVM_VARIANTS), \
       
   123 	  $(MAKE) hotspot_gtest$v $(NEWLINE) )
       
   124 
       
   125 hotspot_gtestserver hotspot_gtestclient hotspot_gtestminimal: hotspot_gtest%:
       
   126 	$(TESTNATIVE_DIR)/hotspot/gtest/$*/gtestLauncher \
       
   127 	    -jdk $(shell $(GETMIXEDPATH) "$(PRODUCT_HOME)")
       
   128 
       
   129 PHONY_LIST += hotspot_gtest hotspot_gtestserver hotspot_gtestclient \
       
   130     hotspot_gtestminimal