test/Makefile
branchihse-testmakefiles-branch
changeset 55893 9991393c7b3a
parent 47221 3b201865d5c1
child 55894 6da4c12646f3
equal deleted inserted replaced
55889:3934c59055ab 55893:9991393c7b3a
     1 #
     1 #
     2 # Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
     2 # Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved.
     3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4 #
     4 #
     5 # This code is free software; you can redistribute it and/or modify it
     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
     6 # under the terms of the GNU General Public License version 2 only, as
     7 # published by the Free Software Foundation.  Oracle designates this
     7 # published by the Free Software Foundation.  Oracle designates this
    24 #
    24 #
    25 
    25 
    26 #
    26 #
    27 # Makefile to run tests from multiple sibling directories
    27 # Makefile to run tests from multiple sibling directories
    28 #
    28 #
       
    29 
       
    30 # Locate this Makefile
       
    31 ifeq ($(filter /%, $(lastword $(MAKEFILE_LIST))),)
       
    32   makefile_path := $(CURDIR)/$(strip $(lastword $(MAKEFILE_LIST)))
       
    33 else
       
    34   makefile_path := $(lastword $(MAKEFILE_LIST))
       
    35 endif
       
    36 TOPDIR ?= $(strip $(patsubst %/test/, %, $(dir $(makefile_path))))
    29 
    37 
    30 # Macro to run a test target in a subdir
    38 # Macro to run a test target in a subdir
    31 define SUBDIR_TEST # subdirectory target
    39 define SUBDIR_TEST # subdirectory target
    32 if [ -d $1 ] ; then \
    40 if [ -d $1 ] ; then \
    33   if [ -r $1/Makefile ] ; then \
    41   if [ -r $1/Makefile ] ; then \
   110   # and excluding this extra subdir
   118   # and excluding this extra subdir
   111   TESTDIRS_TESTS := $(patsubst $(COMPONENT)/%,%,$(patsubst hotspot/jtreg/%,%, \
   119   TESTDIRS_TESTS := $(patsubst $(COMPONENT)/%,%,$(patsubst hotspot/jtreg/%,%, \
   112       $(patsubst ../%, %, $(TESTDIRS_NORM))))
   120       $(patsubst ../%, %, $(TESTDIRS_NORM))))
   113 endif
   121 endif
   114 
   122 
   115 jtreg_tests:
   123 ifneq ($(USE_RUN_TEST), )
       
   124   jtreg_tests:
       
   125 	@( cd $(TOPDIR) && \
       
   126 	    $(MAKE) --no-print-directory -r -R -I make/common/ -f make/RunTestsPrebuilt.gmk \
       
   127 	    run-test-prebuilt OUTPUTDIR=$(TEST_OUTPUT_DIR) BOOT_JDK=$(JT_JAVA) \
       
   128 	    JT_HOME=$(JT_HOME) JDK_IMAGE_DIR=$(PRODUCT_HOME) \
       
   129 	    TEST_IMAGE_DIR=$(TEST_IMAGE_DIR) TEST="$(TEST_SELECTION)" )
       
   130 else
       
   131   jtreg_tests:
   116 	$(MAKE) --no-print-directory TESTDIRS=$(TESTDIRS_TESTS) \
   132 	$(MAKE) --no-print-directory TESTDIRS=$(TESTDIRS_TESTS) \
   117 	    $(COMPONENT)_jtreg_tests
   133 	    $(COMPONENT)_jtreg_tests
   118 
   134 endif
   119 ################################################################
   135 ################################################################
   120 
   136 
   121 # Phony targets (e.g. these are not filenames)
   137 # Phony targets (e.g. these are not filenames)
   122 .PHONY: all clean
   138 .PHONY: all clean
   123 
   139