make/RunTestsPrebuilt.gmk
branchihse-runtestprebuilt-branch
changeset 56895 3289d2b19b94
parent 56362 6230fcdd4fd8
child 56923 3603b2f71035
equal deleted inserted replaced
56894:da01b7339c5e 56895:3289d2b19b94
    47 
    47 
    48 # Setup a required or optional variable, and/or check that it is properly
    48 # Setup a required or optional variable, and/or check that it is properly
    49 # given.
    49 # given.
    50 # Note: No spaces are allowed around the arguments.
    50 # Note: No spaces are allowed around the arguments.
    51 #
    51 #
    52 # $1: The name of the argument
    52 # $1: The name of the variable
    53 # $2: The default value, if any, or OPTIONAL (do not provide a default but
    53 # $2: The default value, if any, or OPTIONAL (do not provide a default but
    54 #     do not exit if it is missing)
    54 #     do not exit if it is missing)
    55 # $3: If NO_CHECK, disable checking for target file/directory existence
    55 # $3: If NO_CHECK, disable checking for target file/directory existence
       
    56 #     If MKDIR, create the default directory
    56 define SetupVariable
    57 define SetupVariable
    57   ifeq ($$($1), )
    58   ifeq ($$($1), )
    58     ifeq ($2, )
    59     ifeq ($2, )
    59       $$(info Error: Prebuilt variable $1 is missing, needed for run-tests-prebuilt)
    60       $$(info Error: Prebuilt variable $1 is missing, needed for run-tests-prebuilt)
    60       $$(error Cannot continue.)
    61       $$(error Cannot continue.)
    73       $$(info Prebuilt variable $1=$$($1))
    74       $$(info Prebuilt variable $1=$$($1))
    74     endif
    75     endif
    75   endif
    76   endif
    76   # If $1 has a value (is not optional), and $3 is not set (to NO_CHECK),
    77   # If $1 has a value (is not optional), and $3 is not set (to NO_CHECK),
    77   # and if wildcard is empty, then complain that the file is missing.
    78   # and if wildcard is empty, then complain that the file is missing.
    78   ifeq ($$(strip $$(if $$($1), , OPTIONAL) $$(wildcard $$($1)) $3), )
    79   ifeq ($3, MKDIR)
    79     $$(info Error: Prebuilt variable $1 points to missing file/directory:)
    80     ifneq ($$(findstring $$(LOG), info debug trace), )
    80     $$(info '$$($1)')
    81       $$(info Creating directory for $1)
    81     $$(error Cannot continue.)
    82     endif
       
    83     $$(shell mkdir -p $$($1))
       
    84   else ifneq ($3, NO_CHECK)
       
    85     ifeq ($$(strip $$(if $$($1), , OPTIONAL) $$(wildcard $$($1))), )
       
    86       $$(info Error: Prebuilt variable $1 points to missing file/directory:)
       
    87       $$(info '$$($1)')
       
    88       $$(error Cannot continue.)
       
    89     endif
    82   endif
    90   endif
    83 endef
    91 endef
    84 
    92 
    85 # Create an ephemeral spec file
    93 # Create an ephemeral spec file
    86 #
    94 #
   104 ################################################################################
   112 ################################################################################
   105 
   113 
   106 # Verify that user has given correct additional input.
   114 # Verify that user has given correct additional input.
   107 
   115 
   108 # These variables are absolutely necessary
   116 # These variables are absolutely necessary
   109 $(eval $(call SetupVariable,OUTPUTDIR))
   117 $(eval $(call SetupVariable,OUTPUTDIR,$(TOPDIR)/build/run-test-prebuilt,MKDIR))
   110 $(eval $(call SetupVariable,BOOT_JDK))
   118 $(eval $(call SetupVariable,BOOT_JDK))
   111 $(eval $(call SetupVariable,JT_HOME))
   119 $(eval $(call SetupVariable,JT_HOME))
   112 
   120 
   113 # These can have default values based on the ones above
   121 # These can have default values based on the ones above
   114 $(eval $(call SetupVariable,JDK_IMAGE_DIR,$(OUTPUTDIR)/images/jdk))
   122 $(eval $(call SetupVariable,JDK_IMAGE_DIR,$(OUTPUTDIR)/images/jdk))
   115 $(eval $(call SetupVariable,TEST_IMAGE_DIR,$(OUTPUTDIR)/images/test))
   123 $(eval $(call SetupVariable,TEST_IMAGE_DIR,$(OUTPUTDIR)/images/test))
   116 $(eval $(call SetupVariable,SYMBOLS_IMAGE_DIR,$(OUTPUTDIR)/images/symbols))
   124 $(eval $(call SetupVariable,SYMBOLS_IMAGE_DIR,$(OUTPUTDIR)/images/symbols,NO_CHECK))
   117 
   125 
   118 # Provide default values for tools that we need
   126 # Provide default values for tools that we need
   119 $(eval $(call SetupVariable,MAKE,make,NO_CHECK))
   127 $(eval $(call SetupVariable,MAKE,make,NO_CHECK))
   120 $(eval $(call SetupVariable,BASH,bash,NO_CHECK))
   128 $(eval $(call SetupVariable,BASH,bash,NO_CHECK))
   121 
   129 
   200   OPENJDK_TARGET_CPU_ARCH := sparc
   208   OPENJDK_TARGET_CPU_ARCH := sparc
   201 endif
   209 endif
   202 
   210 
   203 ifeq ($(OPENJDK_TARGET_OS), windows)
   211 ifeq ($(OPENJDK_TARGET_OS), windows)
   204   ifeq ($(wildcard $(TEST_IMAGE_DIR)/bin/fixpath.exe), )
   212   ifeq ($(wildcard $(TEST_IMAGE_DIR)/bin/fixpath.exe), )
   205     $$(info Error: fixpath is missing from test image '$(TEST_IMAGE_DIR)')
   213     $(info Error: fixpath is missing from test image '$(TEST_IMAGE_DIR)')
   206     $$(error Cannot continue.)
   214     $(error Cannot continue.)
   207   endif
   215   endif
   208   FIXPATH := $(TEST_IMAGE_DIR)/bin/fixpath.exe -c
   216   FIXPATH := $(TEST_IMAGE_DIR)/bin/fixpath.exe -c
   209   PATH_SEP:=;
   217   PATH_SEP:=;
   210 else
   218 else
   211   FIXPATH :=
   219   FIXPATH :=
   274 
   282 
   275 run-test-prebuilt:
   283 run-test-prebuilt:
   276 	@$(RM) -f $(MAKESUPPORT_OUTPUTDIR)/exit-with-error
   284 	@$(RM) -f $(MAKESUPPORT_OUTPUTDIR)/exit-with-error
   277 	@cd $(TOPDIR) && $(MAKE) $(MAKE_ARGS) -f make/RunTests.gmk run-test \
   285 	@cd $(TOPDIR) && $(MAKE) $(MAKE_ARGS) -f make/RunTests.gmk run-test \
   278 	    TEST="$(TEST)"
   286 	    TEST="$(TEST)"
   279 	$(MKDIR) -p $(OUTPUTDIR)/jtreg
       
   280 	$(MV) $(OUTPUTDIR)/test-results/`$(HEAD) -n 1 $(OUTPUTDIR)/test-support/test-last-ids.txt` $(OUTPUTDIR)/jtreg/JTreport
       
   281 	$(MV) $(OUTPUTDIR)/test-support/`$(HEAD) -n 1 $(OUTPUTDIR)/test-support/test-last-ids.txt` $(OUTPUTDIR)/jtreg/JTwork
       
   282 	$(MV) $(OUTPUTDIR)/jtreg/JTreport/exitcode.txt $(OUTPUTDIR)/jtreg/exitcode.txt
       
   283 
   287 
   284 all: run-test-prebuilt
   288 all: run-test-prebuilt
   285 
   289 
   286 .PHONY: default all
   290 .PHONY: default all