474 ################################################################################ |
474 ################################################################################ |
475 # Generate test names for all JTReg test groups |
475 # Generate test names for all JTReg test groups |
476 # |
476 # |
477 |
477 |
478 define DeclareRunTestRecipe |
478 define DeclareRunTestRecipe |
479 run-test-$1: |
479 test-$1: |
480 +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f RunTests.gmk run-test TEST="$1") |
480 +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f RunTests.gmk run-test TEST="$1") |
481 |
481 |
482 exploded-run-test-$1: |
482 exploded-test-$1: |
483 +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f RunTests.gmk run-test \ |
483 +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f RunTests.gmk run-test \ |
484 TEST="$1" JDK_IMAGE_DIR=$(JDK_OUTPUTDIR)) |
484 TEST="$1" JDK_IMAGE_DIR=$(JDK_OUTPUTDIR)) |
485 |
485 |
486 endef |
486 endef |
487 |
487 |
488 # ALL_NAMED_TESTS is defined in FindTests.gmk |
488 # ALL_NAMED_TESTS is defined in FindTests.gmk |
489 $(foreach t, $(ALL_NAMED_TESTS), $(eval $(call DeclareRunTestRecipe,$t))) |
489 $(foreach t, $(ALL_NAMED_TESTS), $(eval $(call DeclareRunTestRecipe,$t))) |
490 ALL_TEST_TARGETS := $(addprefix run-test-, $(ALL_NAMED_TESTS)) |
490 ALL_TEST_TARGETS := $(addprefix test-, $(ALL_NAMED_TESTS)) |
491 ALL_EXPLODED_TEST_TARGETS := $(addprefix exploded-run-test-, $(ALL_NAMED_TESTS)) |
491 |
|
492 # We only support the "exploded-test-gtest" shortcut |
|
493 ALL_EXPLODED_TESTS := gtest |
|
494 ALL_EXPLODED_TEST_TARGETS := $(addprefix exploded-test-, $(ALL_EXPLODED_TESTS)) |
492 |
495 |
493 ALL_TARGETS += $(ALL_TEST_TARGETS) $(ALL_EXPLODED_TEST_TARGETS) |
496 ALL_TARGETS += $(ALL_TEST_TARGETS) $(ALL_EXPLODED_TEST_TARGETS) |
494 |
497 |
495 ################################################################################ |
498 ################################################################################ |
496 # Build tests |
499 # Build tests and microbenchmarks |
497 # |
500 # |
498 |
501 |
499 prepare-test-image: |
502 prepare-test-image: |
500 +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f TestImage.gmk prepare-test-image) |
503 +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f TestImage.gmk prepare-test-image) |
501 |
504 |
520 build-test-hotspot-jtreg-graal) |
523 build-test-hotspot-jtreg-graal) |
521 |
524 |
522 test-image-hotspot-jtreg-graal: |
525 test-image-hotspot-jtreg-graal: |
523 +($(CD) $(TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) -f JtregGraalUnit.gmk \ |
526 +($(CD) $(TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) -f JtregGraalUnit.gmk \ |
524 test-image-hotspot-jtreg-graal) |
527 test-image-hotspot-jtreg-graal) |
525 |
|
526 run-test: |
|
527 +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f RunTests.gmk run-test TEST="$(TEST)") |
|
528 |
|
529 exploded-run-test: |
|
530 +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f RunTests.gmk run-test \ |
|
531 TEST="$(TEST)" JDK_IMAGE_DIR=$(JDK_OUTPUTDIR)) |
|
532 |
528 |
533 ifeq ($(BUILD_GTEST), true) |
529 ifeq ($(BUILD_GTEST), true) |
534 test-image-hotspot-gtest: |
530 test-image-hotspot-gtest: |
535 +($(CD) $(TOPDIR)/make/hotspot/test && $(MAKE) $(MAKE_ARGS) -f GtestImage.gmk) |
531 +($(CD) $(TOPDIR)/make/hotspot/test && $(MAKE) $(MAKE_ARGS) -f GtestImage.gmk) |
536 endif |
532 endif |
542 # Builds the failure handler jtreg extension |
538 # Builds the failure handler jtreg extension |
543 build-test-failure-handler: |
539 build-test-failure-handler: |
544 +($(CD) $(TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) \ |
540 +($(CD) $(TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) \ |
545 -f BuildFailureHandler.gmk build) |
541 -f BuildFailureHandler.gmk build) |
546 |
542 |
547 # Runs the tests for the failure handler jtreg extension |
|
548 test-failure-handler: |
|
549 +($(CD) $(TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) \ |
|
550 -f BuildFailureHandler.gmk test) |
|
551 |
|
552 # Copies the failure handler jtreg extension into the test image |
543 # Copies the failure handler jtreg extension into the test image |
553 test-image-failure-handler: |
544 test-image-failure-handler: |
554 +($(CD) $(TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) \ |
545 +($(CD) $(TOPDIR)/make/test && $(MAKE) $(MAKE_ARGS) \ |
555 -f BuildFailureHandler.gmk images) |
546 -f BuildFailureHandler.gmk images) |
556 endif |
547 endif |
|
548 |
|
549 build-microbenchmark: |
|
550 +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f test/BuildMicrobenchmark.gmk) |
557 |
551 |
558 ALL_TARGETS += prepare-test-image build-test-hotspot-jtreg-native \ |
552 ALL_TARGETS += prepare-test-image build-test-hotspot-jtreg-native \ |
559 test-image-hotspot-jtreg-native build-test-jdk-jtreg-native \ |
553 test-image-hotspot-jtreg-native build-test-jdk-jtreg-native \ |
560 test-image-jdk-jtreg-native build-test-lib build-test-failure-handler \ |
554 test-image-jdk-jtreg-native build-test-lib build-test-failure-handler \ |
561 test-failure-handler test-image-failure-handler test-image-hotspot-gtest \ |
555 test-failure-handler test-image-failure-handler test-image-hotspot-gtest \ |
562 test-image-hotspot-jtreg-graal build-test-hotspot-jtreg-graal \ |
556 test-image-hotspot-jtreg-graal build-test-hotspot-jtreg-graal \ |
563 run-test exploded-run-test |
557 build-microbenchmark |
564 |
558 |
565 ################################################################################ |
559 ################################################################################ |
566 # Run tests |
560 # Run tests |
567 |
561 |
568 # Run tests specified by $(TEST), or the default test set. |
|
569 test: |
562 test: |
570 $(call RunTests, $(TEST), $(JDK_IMAGE_DIR)) |
563 +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f RunTests.gmk run-test TEST="$(TEST)") |
571 |
564 |
572 test-hotspot-jtreg: |
565 exploded-test: |
573 $(call RunTests, "hotspot_all", $(JDK_IMAGE_DIR)) |
566 +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f RunTests.gmk run-test \ |
574 |
567 TEST="$(TEST)" JDK_IMAGE_DIR=$(JDK_OUTPUTDIR)) |
575 test-hotspot-jtreg-native: |
568 |
576 $(call RunTests, "hotspot_native_sanity", $(JDK_IMAGE_DIR)) |
569 ALL_TARGETS += test exploded-test |
577 |
|
578 test-hotspot-internal: |
|
579 $(call RunTests, "hotspot_internal", $(JDK_OUTPUTDIR)) |
|
580 |
|
581 test-hotspot-gtest: |
|
582 $(call RunTests, "hotspot_gtest", $(JDK_OUTPUTDIR)) |
|
583 |
|
584 test-jdk-jtreg-native: |
|
585 $(call RunTests, "jdk_native_sanity", $(JDK_IMAGE_DIR)) |
|
586 |
|
587 test-make: |
|
588 ($(CD) $(TOPDIR)/test/make && $(MAKE) $(MAKE_ARGS) -f TestMake.gmk $(TEST_TARGET)) |
|
589 |
|
590 test-compile-commands: |
|
591 ($(CD) $(TOPDIR)/test/make && $(MAKE) $(MAKE_ARGS) -f TestMake.gmk test-compile-commands) |
|
592 |
|
593 ALL_TARGETS += test test-hotspot-jtreg test-hotspot-jtreg-native \ |
|
594 test-hotspot-internal test-hotspot-gtest test-jdk-jtreg-native test-make \ |
|
595 test-compile-commands |
|
596 |
570 |
597 ################################################################################ |
571 ################################################################################ |
598 # Bundles |
572 # Bundles |
599 |
573 |
600 product-bundles: |
574 product-bundles: |
721 # The swing beans need to have java base properly generated to avoid errors |
695 # The swing beans need to have java base properly generated to avoid errors |
722 # in javadoc. The X11 wrappers need the java.base include files to have been |
696 # in javadoc. The X11 wrappers need the java.base include files to have been |
723 # copied and processed. |
697 # copied and processed. |
724 java.desktop-gensrc-src: java.base-gensrc java.base-copy |
698 java.desktop-gensrc-src: java.base-gensrc java.base-copy |
725 |
699 |
726 # The annotation processing for jdk.internal.vm.ci and jdk.internal.vm.compiler |
700 # The annotation processing for jdk.internal.vm.compiler |
727 # needs classes from the current JDK. |
701 # and jdk.internal.vm.compiler.management needs classes from the current JDK. |
728 jdk.internal.vm.ci-gensrc-src: $(addsuffix -java, \ |
|
729 $(call FindTransitiveDepsForModule, jdk.internal.vm.ci)) |
|
730 jdk.internal.vm.compiler-gensrc-src: $(addsuffix -java, \ |
702 jdk.internal.vm.compiler-gensrc-src: $(addsuffix -java, \ |
731 $(call FindTransitiveDepsForModule, jdk.internal.vm.compiler)) |
703 $(call FindTransitiveDepsForModule, jdk.internal.vm.compiler)) |
732 |
704 jdk.internal.vm.compiler.management-gensrc-src: $(addsuffix -java, \ |
733 # For jdk.internal.vm.compiler, the gensrc step is generating a module-info.java.extra |
705 $(call FindTransitiveDepsForModule, jdk.internal.vm.compiler.management)) |
|
706 |
|
707 # For these modules, the gensrc step is generating a module-info.java.extra |
734 # file to be processed by the gensrc-moduleinfo target. |
708 # file to be processed by the gensrc-moduleinfo target. |
735 jdk.internal.vm.compiler-gensrc-moduleinfo: jdk.internal.vm.compiler-gensrc-src |
709 jdk.internal.vm.compiler-gensrc-moduleinfo: jdk.internal.vm.compiler-gensrc-src |
|
710 jdk.internal.vm.compiler.management-gensrc-moduleinfo: jdk.internal.vm.compiler.management-gensrc-src |
736 |
711 |
737 jdk.jdeps-gendata: java rmic |
712 jdk.jdeps-gendata: java rmic |
738 |
713 |
739 # The ct.sym generation uses all the moduleinfos as input |
714 # The ct.sym generation uses all the moduleinfos as input |
740 jdk.compiler-gendata: $(GENSRC_MODULEINFO_TARGETS) |
715 jdk.compiler-gendata: $(GENSRC_MODULEINFO_TARGETS) |
819 |
794 |
820 zip-source: gensrc rmic |
795 zip-source: gensrc rmic |
821 |
796 |
822 jrtfs-jar: interim-langtools |
797 jrtfs-jar: interim-langtools |
823 |
798 |
|
799 build-microbenchmark: interim-langtools exploded-image |
|
800 |
824 ifeq ($(ENABLE_GENERATE_CLASSLIST), true) |
801 ifeq ($(ENABLE_GENERATE_CLASSLIST), true) |
825 ifeq ($(CREATE_BUILDJDK), true) |
802 ifeq ($(CREATE_BUILDJDK), true) |
826 # If creating a buildjdk, the interim image needs to be based on that. |
803 # If creating a buildjdk, the interim image needs to be based on that. |
827 generate-link-opt-data: create-buildjdk |
804 generate-link-opt-data: create-buildjdk |
828 else ifeq ($(EXTERNAL_BUILDJDK), false) |
805 else ifeq ($(EXTERNAL_BUILDJDK), false) |
875 |
852 |
876 docs-jdk-index: exploded-image buildtools-modules |
853 docs-jdk-index: exploded-image buildtools-modules |
877 |
854 |
878 docs-zip: docs-jdk |
855 docs-zip: docs-jdk |
879 |
856 |
|
857 # Tests |
880 test: jdk-image test-image |
858 test: jdk-image test-image |
881 |
859 |
882 run-test: jdk-image test-image |
860 exploded-test: exploded-image test-image |
883 exploded-run-test: exploded-image test-image |
861 |
|
862 test-make: clean-test-make compile-commands |
|
863 |
|
864 test-make-compile-commands: compile-commands |
884 |
865 |
885 # Declare dependency for all generated test targets |
866 # Declare dependency for all generated test targets |
886 $(foreach t, $(ALL_TEST_TARGETS), $(eval $t: jdk-image test-image)) |
867 $(foreach t, $(filter-out test-make%, $(ALL_TEST_TARGETS)), $(eval $t: jdk-image test-image)) |
887 $(foreach t, $(ALL_EXPLODED_TEST_TARGETS), $(eval $t: exploded-image test-image)) |
868 $(foreach t, $(ALL_EXPLODED_TEST_TARGETS), $(eval $t: exploded-image test-image)) |
888 |
869 |
889 create-buildjdk-copy: jdk.jlink-java java.base-gendata \ |
870 create-buildjdk-copy: jdk.jlink-java java.base-gendata \ |
890 $(addsuffix -java, $(INTERIM_IMAGE_MODULES)) |
871 $(addsuffix -java, $(INTERIM_IMAGE_MODULES)) |
891 |
872 |
892 create-buildjdk-interim-image: create-buildjdk-copy |
873 create-buildjdk-interim-image: create-buildjdk-copy |
893 |
874 |
894 interim-image: $(INTERIM_JMOD_TARGETS) |
875 interim-image: $(INTERIM_JMOD_TARGETS) |
895 |
876 |
896 test-make: clean-test-make |
|
897 |
|
898 test-compile-commands: compile-commands |
|
899 |
|
900 build-test-lib: exploded-image-optimize |
877 build-test-lib: exploded-image-optimize |
901 |
878 |
902 build-test-failure-handler: interim-langtools |
879 build-test-failure-handler: interim-langtools |
903 |
|
904 test-failure-handler: build-test-failure-handler |
|
905 |
880 |
906 test-image-failure-handler: build-test-failure-handler |
881 test-image-failure-handler: build-test-failure-handler |
907 |
882 |
908 build-test-hotspot-jtreg-native: buildtools-jdk \ |
883 build-test-hotspot-jtreg-native: buildtools-jdk \ |
909 hotspot-$(JVM_VARIANT_MAIN)-libs |
884 hotspot-$(JVM_VARIANT_MAIN)-libs |
1061 # This target builds the test image |
1030 # This target builds the test image |
1062 test-image: prepare-test-image \ |
1031 test-image: prepare-test-image \ |
1063 test-image-jdk-jtreg-native test-image-failure-handler \ |
1032 test-image-jdk-jtreg-native test-image-failure-handler \ |
1064 test-image-demos-jdk $(JVM_TEST_IMAGE_TARGETS) |
1033 test-image-demos-jdk $(JVM_TEST_IMAGE_TARGETS) |
1065 |
1034 |
|
1035 ifneq ($(JMH_CORE_JAR), ) |
|
1036 test-image: build-microbenchmark |
|
1037 endif |
|
1038 |
1066 ################################################################################ |
1039 ################################################################################ |
1067 |
1040 |
1068 # all-images builds all our deliverables as images. |
1041 # all-images builds all our deliverables as images. |
1069 all-images: product-images test-image docs-image |
1042 all-images: product-images test-image docs-image |
1070 |
1043 |
1091 docs: docs-image |
1064 docs: docs-image |
1092 bundles: all-bundles |
1065 bundles: all-bundles |
1093 all: all-images |
1066 all: all-images |
1094 |
1067 |
1095 ALL_TARGETS += default jdk images docs bundles all |
1068 ALL_TARGETS += default jdk images docs bundles all |
|
1069 |
|
1070 # Aliases used for running tests. |
|
1071 |
|
1072 # Let "run-test" be an alias for "test" |
|
1073 $(foreach t, $(ALL_NAMED_TESTS), $(eval run-test-$t: test-$t)) |
|
1074 RUN_TEST_TARGETS := $(addprefix run-test-, $(ALL_NAMED_TESTS)) |
|
1075 |
|
1076 run-test: test |
|
1077 exploded-run-test: exploded-test |
|
1078 |
|
1079 # "make check" is a common idiom for running basic testing |
|
1080 check: test-tier1 |
|
1081 |
|
1082 # Keep some old names as aliases |
|
1083 test-hotspot-jtreg: test-hotspot_all |
|
1084 test-hotspot-jtreg-native: test-hotspot_native_sanity |
|
1085 test-hotspot-gtest: exploded-test-gtest |
|
1086 test-jdk-jtreg-native: test-jdk_native_sanity |
|
1087 |
|
1088 ALL_TARGETS += $(RUN_TEST_TARGETS) run-test exploded-run-test check \ |
|
1089 test-hotspot-jtreg test-hotspot-jtreg-native test-hotspot-gtest \ |
|
1090 test-jdk-jtreg-native |
1096 |
1091 |
1097 ################################################################################ |
1092 ################################################################################ |
1098 ################################################################################ |
1093 ################################################################################ |
1099 # |
1094 # |
1100 # Clean targets |
1095 # Clean targets |