< prev index next >

make/common/FindTests.gmk

Print this page




  45 # JTREG_TESTROOTS might have been set by a custom extension
  46 JTREG_TESTROOTS += $(addprefix $(TOPDIR)/test/, hotspot/jtreg jdk langtools nashorn jaxp)
  47 
  48 # Extract the names of the Jtreg group files from the TEST.ROOT files. The
  49 # TEST.ROOT files being properties files can be interpreted as makefiles so
  50 # use include to get at the contents instead of expensive shell calls. We are
  51 # looking for the "groups" property in each file.
  52 JTREG_ROOT_FILES := $(addsuffix /TEST.ROOT, $(JTREG_TESTROOTS))
  53 JTREG_GROUP_FILES :=
  54 $(foreach root, $(JTREG_TESTROOTS), \
  55   $(eval include $(root)/TEST.ROOT) \
  56   $(eval $(root)_JTREG_GROUP_FILES := $$(addprefix $(root)/, $$(groups))) \
  57   $(eval JTREG_GROUP_FILES += $$($(root)_JTREG_GROUP_FILES)) \
  58 )
  59 
  60 # Cache the expensive to calculate test names in a generated makefile.
  61 FIND_TESTS_CACHE_FILE := $(MAKESUPPORT_OUTPUTDIR)/find-tests.gmk
  62 
  63 # If this file is deemed outdated, it will automatically get regenerated
  64 # by this rule before being included below.
  65 $(FIND_TESTS_CACHE_FILE): $(JTREG_ROOT_FILES) $(JTREG_GROUP_FILES) \
  66     $(TOPDIR)/test/make/TestMake.gmk


  67         $(call MakeTargetDir)
  68         ( $(foreach root, $(JTREG_TESTROOTS), \
  69             $(PRINTF) "\n$(root)_JTREG_TEST_GROUPS := " ; \
  70             $(SED) -n -e 's/^\#.*//g' -e 's/\([^ ]*\)\w*=.*/\1/gp' \
  71               $($(root)_JTREG_GROUP_FILES) \
  72               | $(SORT) -u | $(TR) '\n' ' ' ; \
  73           ) \



  74         ) > $@
  75         $(PRINTF) "\nMAKE_TEST_TARGETS := " >> $@
  76         $(MAKE) -s --no-print-directory $(MAKE_ARGS) \
  77             SPEC=$(SPEC) -f $(TOPDIR)/test/make/TestMake.gmk print-targets \
  78             TARGETS_FILE=$@
  79 
  80 -include $(FIND_TESTS_CACHE_FILE)
  81 
  82 # Create a list of all available Jtreg test groups in all components
  83 JTREG_TEST_GROUPS += $(sort $(foreach root, $(JTREG_TESTROOTS), \
  84     $($(root)_JTREG_TEST_GROUPS)))
  85 
  86 # Add Jtreg test groups to list of named tests (test groups, test list, etc)
  87 # ALL_NAMED_TESTS might have been set by a custom extension
  88 ALL_NAMED_TESTS += $(JTREG_TEST_GROUPS)
  89 
  90 # Add the make test targets
  91 ALL_NAMED_TESTS += $(addprefix make-, $(MAKE_TEST_TARGETS))
  92 
  93 # Add Gtest
  94 ALL_NAMED_TESTS += gtest
  95 
  96 # Add microbenchmarks
  97 ALL_NAMED_TESTS += micro
  98 


  45 # JTREG_TESTROOTS might have been set by a custom extension
  46 JTREG_TESTROOTS += $(addprefix $(TOPDIR)/test/, hotspot/jtreg jdk langtools nashorn jaxp)
  47 
  48 # Extract the names of the Jtreg group files from the TEST.ROOT files. The
  49 # TEST.ROOT files being properties files can be interpreted as makefiles so
  50 # use include to get at the contents instead of expensive shell calls. We are
  51 # looking for the "groups" property in each file.
  52 JTREG_ROOT_FILES := $(addsuffix /TEST.ROOT, $(JTREG_TESTROOTS))
  53 JTREG_GROUP_FILES :=
  54 $(foreach root, $(JTREG_TESTROOTS), \
  55   $(eval include $(root)/TEST.ROOT) \
  56   $(eval $(root)_JTREG_GROUP_FILES := $$(addprefix $(root)/, $$(groups))) \
  57   $(eval JTREG_GROUP_FILES += $$($(root)_JTREG_GROUP_FILES)) \
  58 )
  59 
  60 # Cache the expensive to calculate test names in a generated makefile.
  61 FIND_TESTS_CACHE_FILE := $(MAKESUPPORT_OUTPUTDIR)/find-tests.gmk
  62 
  63 # If this file is deemed outdated, it will automatically get regenerated
  64 # by this rule before being included below.
  65 #
  66 # When calling TestMake.gmk, override the log level to avoid any kind of debug
  67 # output being captured into the generated makefile.
  68 $(FIND_TESTS_CACHE_FILE): $(JTREG_ROOT_FILES) $(JTREG_GROUP_FILES)
  69         $(call MakeTargetDir)
  70         ( $(foreach root, $(JTREG_TESTROOTS), \
  71             $(PRINTF) "\n$(root)_JTREG_TEST_GROUPS := " ; \
  72             $(SED) -n -e 's/^\#.*//g' -e 's/\([^ ]*\)\w*=.*/\1/gp' \
  73               $($(root)_JTREG_GROUP_FILES) \
  74               | $(SORT) -u | $(TR) '\n' ' ' ; \
  75           ) \
  76           $(PRINTF) "\nMAKE_TEST_TARGETS := " ; \
  77           $(MAKE) -s --no-print-directory $(MAKE_ARGS) LOG_LEVEL=warn \
  78               SPEC=$(SPEC) -f $(TOPDIR)/test/make/TestMake.gmk print-targets \
  79         ) > $@




  80 
  81 -include $(FIND_TESTS_CACHE_FILE)
  82 
  83 # Create a list of all available Jtreg test groups in all components
  84 JTREG_TEST_GROUPS += $(sort $(foreach root, $(JTREG_TESTROOTS), \
  85     $($(root)_JTREG_TEST_GROUPS)))
  86 
  87 # Add Jtreg test groups to list of named tests (test groups, test list, etc)
  88 # ALL_NAMED_TESTS might have been set by a custom extension
  89 ALL_NAMED_TESTS += $(JTREG_TEST_GROUPS)
  90 
  91 # Add the make test targets
  92 ALL_NAMED_TESTS += $(addprefix make-, $(MAKE_TEST_TARGETS))
  93 
  94 # Add Gtest
  95 ALL_NAMED_TESTS += gtest
  96 
  97 # Add microbenchmarks
  98 ALL_NAMED_TESTS += micro
  99 
< prev index next >