1 #
   2 # Copyright (c) 1995, 2018, 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 #
  23 #
  24 
  25 NATIVE_TEST_PATH := hotspot/jtreg/native
  26 
  27 CLEAN_BEFORE_PREP := true
  28 
  29 USE_JTREG_VERSION := 4.1
  30 
  31 USE_JTREG_ASSERT := false
  32 
  33 LIMIT_JTREG_VM_MEMORY := false
  34 
  35 IGNORE_MARKED_TESTS := true
  36 
  37 # Include the common base file with most of the logic
  38 include ../../TestCommon.gmk
  39 
  40 ################################################################
  41 # Default make rule (runs jtreg_tests)
  42 all: hotspot_all
  43         @$(ECHO) "Testing completed successfully"
  44 
  45 # Support "hotspot_" prefixed test make targets (too)
  46 # The hotspot_% targets are used by the top level Makefile
  47 # Unless explicitly defined below, hotspot_<x> is interpreted as a jtreg test group name
  48 hotspot_%:
  49         $(ECHO) "Running tests: $@"
  50         $(MAKE) -j 1 TEST_SELECTION=":$@" UNIQUE_DIR=$@ jtreg_tests;
  51 
  52 hotspot_internal:
  53         $(ALT_OUTPUTDIR)/jdk/bin/java -XX:+ExecuteInternalVMTests -XX:+ShowMessageBoxOnError -version
  54 
  55 ################################################################
  56 
  57 # Set up the directory in which the jvm directories live (client/, server/, etc.)
  58 ifeq ($(PLATFORM),windows)
  59 JVMS_DIR := $(PRODUCT_HOME)/bin
  60 else
  61 JVMS_DIR := $(PRODUCT_HOME)/lib
  62 endif
  63 
  64 # Use the existance of a directory as a sign that jvm variant is available
  65 CANDIDATE_JVM_VARIANTS := client minimal server
  66 JVM_VARIANTS := $(strip $(foreach x,$(CANDIDATE_JVM_VARIANTS),$(if $(wildcard $(JVMS_DIR)/$(x)),$(x))))
  67 
  68 ################################################################
  69 
  70 # Run the native gtest tests from the test image
  71 
  72 define NEWLINE
  73 
  74 
  75 endef
  76 
  77 
  78 hotspot_gtest:
  79         $(foreach v, $(JVM_VARIANTS), \
  80           $(MAKE) hotspot_gtest$v $(NEWLINE) )
  81 
  82 hotspot_gtestserver hotspot_gtestclient hotspot_gtestminimal: hotspot_gtest%:
  83         $(TESTNATIVE_DIR)/hotspot/gtest/$*/gtestLauncher \
  84             -jdk $(shell $(GETMIXEDPATH) "$(PRODUCT_HOME)")
  85 
  86 PHONY_LIST += hotspot_gtest hotspot_gtestserver hotspot_gtestclient \
  87     hotspot_gtestminimal