test/Makefile
changeset 47218 918745561887
parent 43386 df350c85390b
child 47221 3b201865d5c1
equal deleted inserted replaced
47217:72e3ae9a25eb 47218:918745561887
    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 
    29 
    30 # Root of the forest that was built
       
    31 TOPDIR=..
       
    32 
       
    33 # This makefile depends on the availability of sibling directories.
       
    34 LANGTOOLS_DIR=$(TOPDIR)/langtools
       
    35 JDK_DIR=$(TOPDIR)/jdk
       
    36 JAXP_DIR=$(TOPDIR)/jaxp
       
    37 HOTSPOT_DIR=$(TOPDIR)/hotspot
       
    38 
       
    39 # Macro to run a test target in a subdir
    30 # Macro to run a test target in a subdir
    40 define SUBDIR_TEST # subdirectory target
    31 define SUBDIR_TEST # subdirectory target
    41 if [ -d $1 ] ; then \
    32 if [ -d $1 ] ; then \
    42   if [ -r $1/test/Makefile ] ; then \
    33   if [ -r $1/Makefile ] ; then \
    43     $(MAKE) --no-print-directory -k -C $1/test $2 ; \
    34     $(MAKE) --no-print-directory -k -C $1 $2 ; \
    44   else \
    35   else \
    45     echo "ERROR: File does not exist: $1/test/Makefile"; \
    36     echo "ERROR: File does not exist: $1/Makefile"; \
    46     exit 1; \
    37     exit 1; \
    47   fi; \
    38   fi; \
    48 else \
    39 else \
    49   echo "WARNING: No testing done, directory does not exist: $1"; \
    40   echo "WARNING: No testing done, directory does not exist: $1"; \
    50 fi
    41 fi
    54 default: jdk_core langtools_jtreg jaxp_all
    45 default: jdk_core langtools_jtreg jaxp_all
    55 
    46 
    56 # All testing
    47 # All testing
    57 all: jdk_all langtools_all jaxp_all
    48 all: jdk_all langtools_all jaxp_all
    58 
    49 
    59 # Bring in closed test targets if present
       
    60 -include $(TOPDIR)/closed/test/Makefile
       
    61 
       
    62 ifeq ($(TEST_JOBS), 0)
    50 ifeq ($(TEST_JOBS), 0)
    63   ifeq ($(shell $(EXPR) $(JOBS) \> 50), 1)
    51   ifeq ($(shell $(EXPR) $(JOBS) \> 50), 1)
    64     # JTReg cannot handle more than 50 in concurrency
    52     # JTReg cannot handle more than 50 in concurrency
    65     JDK_TEST_JOBS=50
    53     JDK_TEST_JOBS=50
    66   else
    54   else
    69 else
    57 else
    70   JDK_TEST_JOBS=$(TEST_JOBS)
    58   JDK_TEST_JOBS=$(TEST_JOBS)
    71 endif
    59 endif
    72 # Test targets
    60 # Test targets
    73 langtools_% :
    61 langtools_% :
    74 	@$(NO_STOPPING)$(call SUBDIR_TEST, $(LANGTOOLS_DIR), CONCURRENCY=$(JDK_TEST_JOBS) JT_JAVA=$(PRODUCT_HOME) JTREG_HOME=$(JT_HOME) TEST="$(subst langtools_,,$@)" $(subst langtools_,,$@))
    62 	@$(NO_STOPPING)$(call SUBDIR_TEST, langtools, CONCURRENCY=$(JDK_TEST_JOBS) \
       
    63 	    JT_JAVA=$(PRODUCT_HOME) JTREG_HOME=$(JT_HOME) \
       
    64 	    TEST="$(subst langtools_,,$@)" $(subst langtools_,,$@))
    75 
    65 
    76 jdk_% core_%s svc_%:
    66 jdk_% core_%s svc_%:
    77 	@$(NO_STOPPING)$(call SUBDIR_TEST, $(JDK_DIR), CONCURRENCY=$(JDK_TEST_JOBS) TEST="$@" $@)
    67 	@$(NO_STOPPING)$(call SUBDIR_TEST, jdk, CONCURRENCY=$(JDK_TEST_JOBS) TEST="$@" $@)
    78 
    68 
    79 jaxp_%:
    69 jaxp_%:
    80 	@$(NO_STOPPING)$(call SUBDIR_TEST, $(JAXP_DIR), CONCURRENCY=$(JDK_TEST_JOBS) TEST="$@" $@)
    70 	@$(NO_STOPPING)$(call SUBDIR_TEST, jaxp, CONCURRENCY=$(JDK_TEST_JOBS) TEST="$@" $@)
       
    71 
       
    72 nashorn_%:
       
    73 	@$(NO_STOPPING)$(call SUBDIR_TEST, nashorn, CONCURRENCY=$(JDK_TEST_JOBS) TEST="$@" $@)
    81 
    74 
    82 SUB_MAKE_ARGS :=
    75 SUB_MAKE_ARGS :=
    83 ifneq ($(TEST_JOBS), 0)
    76 ifneq ($(TEST_JOBS), 0)
    84   ifneq ($(TEST_JOBS), )
    77   ifneq ($(TEST_JOBS), )
    85     SUB_MAKE_ARGS += CONCURRENCY=$(TEST_JOBS)
    78     SUB_MAKE_ARGS += CONCURRENCY=$(TEST_JOBS)
    86   endif
    79   endif
    87 endif
    80 endif
    88 hotspot_%:
    81 hotspot_%:
    89 	@$(NO_STOPPING)$(call SUBDIR_TEST, $(HOTSPOT_DIR), $(SUB_MAKE_ARGS) TEST="$@" $@)
    82 	@$(NO_STOPPING)$(call SUBDIR_TEST, hotspot/jtreg, $(SUB_MAKE_ARGS) TEST="$@" $@)
    90 
    83 
    91 #
    84 #
    92 # jtreg_tests
    85 # jtreg_tests
    93 #
    86 #
    94 # Invocation:
    87 # Invocation:
   101 #
    94 #
   102 # The below will strip the path prefix and delegate to the
    95 # The below will strip the path prefix and delegate to the
   103 # corresponding ../<component>/test/Makefile.
    96 # corresponding ../<component>/test/Makefile.
   104 
    97 
   105 ifneq ($(TESTDIRS),)
    98 ifneq ($(TESTDIRS),)
   106 # Extract the component from ../<component>/...
    99   # Extract the component from ../test/<component>/...
   107 COMPONENT=$(word 2,$(subst /, ,$(TESTDIRS)))
   100   TESTDIRS_NORM := $(patsubst test/%, %, $(patsubst ../%, %, $(TESTDIRS)))
       
   101   COMPONENT := $(word 1,$(subst /, ,$(TESTDIRS_NORM)))
   108 
   102 
   109 # Strip off the ../<component>/test prefix and pass the rest as TESTDIRS
   103   # Strip off the ../<component>/test prefix and pass the rest as TESTDIRS
   110 # to the delegate Makefile
   104   # to the delegate Makefile
   111 TESTDIRS_TESTS=$(patsubst ../$(COMPONENT)/test/%,%,$(TESTDIRS))
   105   # The hotspot tests are in a subdir "java". Accept paths both including
       
   106   # and excluding this extra subdir
       
   107   TESTDIRS_TESTS := $(patsubst $(COMPONENT)/%,%,$(patsubst hotspot/jtreg/%,%, \
       
   108       $(patsubst ../%, %, $(TESTDIRS_NORM))))
   112 endif
   109 endif
   113 
   110 
   114 jtreg_tests:
   111 jtreg_tests:
   115 	@$(NO_STOPPING)$(call SUBDIR_TEST, $(TOPDIR)/$(COMPONENT), TESTDIRS=$(TESTDIRS_TESTS) $@)
   112 	$(MAKE) --no-print-directory TESTDIRS=$(TESTDIRS_TESTS) \
       
   113 	    $(COMPONENT)_jtreg_tests
   116 
   114 
   117 ################################################################
   115 ################################################################
   118 
   116 
   119 # Phony targets (e.g. these are not filenames)
   117 # Phony targets (e.g. these are not filenames)
   120 .PHONY: all clean
   118 .PHONY: all clean