1 # |
1 # |
2 # Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. |
2 # Copyright (c) 2011, 2019, 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 |
482 +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f RunTests.gmk run-test TEST="$1") |
482 +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f RunTests.gmk run-test TEST="$1") |
483 |
483 |
484 exploded-test-$1: |
484 exploded-test-$1: |
485 +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f RunTests.gmk run-test \ |
485 +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f RunTests.gmk run-test \ |
486 TEST="$1" JDK_IMAGE_DIR=$(JDK_OUTPUTDIR)) |
486 TEST="$1" JDK_IMAGE_DIR=$(JDK_OUTPUTDIR)) |
487 |
|
488 endef |
487 endef |
489 |
488 |
490 # ALL_NAMED_TESTS is defined in FindTests.gmk |
489 # ALL_NAMED_TESTS is defined in FindTests.gmk |
491 $(foreach t, $(ALL_NAMED_TESTS), $(eval $(call DeclareRunTestRecipe,$t))) |
490 $(foreach t, $(ALL_NAMED_TESTS), $(eval $(call DeclareRunTestRecipe,$t))) |
492 ALL_TEST_TARGETS := $(addprefix test-, $(ALL_NAMED_TESTS)) |
491 ALL_TEST_TARGETS := $(addprefix test-, $(ALL_NAMED_TESTS)) |
493 |
492 |
|
493 define DeclareRunJCovTestRecipe |
|
494 jcov-test-$1: |
|
495 +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f RunTests.gmk \ |
|
496 TEST="$1" TEST_OPTS_JCOV=true) |
|
497 endef |
|
498 |
|
499 # jcov-test only makes sense for some of the tests |
|
500 $(foreach t, $(JCOV_NAMED_TESTS), $(eval $(call DeclareRunJCovTestRecipe,$t))) |
|
501 ALL_JCOV_TEST_TARGETS := $(addprefix jcov-test-, $(JCOV_NAMED_TESTS)) |
|
502 |
494 # We only support the "exploded-test-gtest" shortcut |
503 # We only support the "exploded-test-gtest" shortcut |
495 ALL_EXPLODED_TESTS := gtest |
504 ALL_EXPLODED_TESTS := gtest |
496 ALL_EXPLODED_TEST_TARGETS := $(addprefix exploded-test-, $(ALL_EXPLODED_TESTS)) |
505 ALL_EXPLODED_TEST_TARGETS := $(addprefix exploded-test-, $(ALL_EXPLODED_TESTS)) |
497 |
506 |
498 ALL_TARGETS += $(ALL_TEST_TARGETS) $(ALL_EXPLODED_TEST_TARGETS) |
507 ALL_TARGETS += $(ALL_TEST_TARGETS) $(ALL_EXPLODED_TEST_TARGETS) $(ALL_JCOV_TEST_TARGETS) |
499 |
508 |
500 ################################################################################ |
509 ################################################################################ |
501 # Build tests and microbenchmarks |
510 # Build tests and microbenchmarks |
502 # |
511 # |
503 |
512 |
566 |
575 |
567 exploded-test: |
576 exploded-test: |
568 +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f RunTests.gmk run-test \ |
577 +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f RunTests.gmk run-test \ |
569 TEST="$(TEST)" JDK_IMAGE_DIR=$(JDK_OUTPUTDIR)) |
578 TEST="$(TEST)" JDK_IMAGE_DIR=$(JDK_OUTPUTDIR)) |
570 |
579 |
571 ALL_TARGETS += test exploded-test |
580 jcov-test: |
|
581 +($(CD) $(TOPDIR)/make && $(MAKE) $(MAKE_ARGS) -f RunTests.gmk \ |
|
582 TEST="$(TEST)" TEST_OPTS_JCOV=true) |
|
583 |
|
584 ALL_TARGETS += test exploded-test jcov-test |
572 |
585 |
573 ################################################################################ |
586 ################################################################################ |
574 # Bundles |
587 # Bundles |
575 |
588 |
576 product-bundles: |
589 product-bundles: |
867 # Tests |
880 # Tests |
868 test: jdk-image test-image |
881 test: jdk-image test-image |
869 |
882 |
870 exploded-test: exploded-image test-image |
883 exploded-test: exploded-image test-image |
871 |
884 |
|
885 jcov-test: jcov-image test-image |
|
886 |
872 test-make: clean-test-make compile-commands |
887 test-make: clean-test-make compile-commands |
873 |
888 |
874 test-make-compile-commands: compile-commands |
889 test-make-compile-commands: compile-commands |
875 |
890 |
876 # Declare dependency for all generated test targets |
891 # Declare dependency for all generated test targets |
877 $(foreach t, $(filter-out test-make%, $(ALL_TEST_TARGETS)), $(eval $t: jdk-image test-image)) |
892 $(foreach t, $(filter-out test-make%, $(ALL_TEST_TARGETS)), $(eval $t: jdk-image test-image)) |
878 $(foreach t, $(ALL_EXPLODED_TEST_TARGETS), $(eval $t: exploded-image test-image)) |
893 $(foreach t, $(ALL_EXPLODED_TEST_TARGETS), $(eval $t: exploded-image test-image)) |
|
894 $(ALL_JCOV_TEST_TARGETS): jcov-image test-image |
879 |
895 |
880 create-buildjdk-copy: jdk.jlink-java java.base-gendata \ |
896 create-buildjdk-copy: jdk.jlink-java java.base-gendata \ |
881 $(addsuffix -java, $(INTERIM_IMAGE_MODULES)) |
897 $(addsuffix -java, $(INTERIM_IMAGE_MODULES)) |
882 |
898 |
883 create-buildjdk-interim-image: create-buildjdk-copy |
899 create-buildjdk-interim-image: create-buildjdk-copy |