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 ################################################################
  53 
  54 # Set up the directory in which the jvm directories live (client/, server/, etc.)
  55 ifeq ($(PLATFORM),windows)
  56 JVMS_DIR := $(PRODUCT_HOME)/bin
  57 else
  58 JVMS_DIR := $(PRODUCT_HOME)/lib
  59 endif
  60 
  61 # Use the existance of a directory as a sign that jvm variant is available
  62 CANDIDATE_JVM_VARIANTS := client minimal server
  63 JVM_VARIANTS := $(strip $(foreach x,$(CANDIDATE_JVM_VARIANTS),$(if $(wildcard $(JVMS_DIR)/$(x)),$(x))))
  64 
  65 ################################################################
  66 
  67 # Run the native gtest tests from the test image
  68 
  69 define NEWLINE
  70 
  71 
  72 endef
  73 
  74 
  75 hotspot_gtest:
  76         $(foreach v, $(JVM_VARIANTS), \
  77           $(MAKE) hotspot_gtest$v $(NEWLINE) )
  78 
  79 hotspot_gtestserver hotspot_gtestclient hotspot_gtestminimal: hotspot_gtest%:
  80         $(TESTNATIVE_DIR)/hotspot/gtest/$*/gtestLauncher \
  81             -jdk $(shell $(GETMIXEDPATH) "$(PRODUCT_HOME)")
  82 
  83 PHONY_LIST += hotspot_gtest hotspot_gtestserver hotspot_gtestclient \
  84     hotspot_gtestminimal