# HG changeset patch # User ehelin # Date 1450173858 -3600 # Node ID 7e0595aab028d91c822a97ede56dc40000d69a9f # Parent 9fd6df05d8473c68e6b4a8d50c3188dfc232718b 8139272: Add configure variable to set concurrency for jtreg tests Reviewed-by: erikj, ihse diff -r 9fd6df05d847 -r 7e0595aab028 common/autoconf/build-performance.m4 --- a/common/autoconf/build-performance.m4 Mon Dec 14 20:32:22 2015 +0000 +++ b/common/autoconf/build-performance.m4 Tue Dec 15 11:04:18 2015 +0100 @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -149,6 +149,19 @@ AC_SUBST(JOBS) ]) +AC_DEFUN_ONCE([BPERF_SETUP_TEST_JOBS], +[ + # The number of test jobs will be chosen automatically if TEST_JOBS is 0 + AC_ARG_WITH(test-jobs, [AS_HELP_STRING([--with-test-jobs], + [number of parallel tests jobs to run @<:@based on build jobs@:>@])]) + if test "x$with_test_jobs" = x; then + TEST_JOBS=0 + else + TEST_JOBS=$with_test_jobs + fi + AC_SUBST(TEST_JOBS) +]) + AC_DEFUN([BPERF_SETUP_CCACHE], [ AC_ARG_ENABLE([ccache], diff -r 9fd6df05d847 -r 7e0595aab028 common/autoconf/configure.ac --- a/common/autoconf/configure.ac Mon Dec 14 20:32:22 2015 +0000 +++ b/common/autoconf/configure.ac Tue Dec 15 11:04:18 2015 +0100 @@ -233,6 +233,7 @@ BPERF_SETUP_BUILD_CORES BPERF_SETUP_BUILD_MEMORY BPERF_SETUP_BUILD_JOBS +BPERF_SETUP_TEST_JOBS # Setup arguments for the boot jdk (after cores and memory have been setup) BOOTJDK_SETUP_BOOT_JDK_ARGUMENTS diff -r 9fd6df05d847 -r 7e0595aab028 common/autoconf/generated-configure.sh --- a/common/autoconf/generated-configure.sh Mon Dec 14 20:32:22 2015 +0000 +++ b/common/autoconf/generated-configure.sh Tue Dec 15 11:04:18 2015 +0100 @@ -646,6 +646,7 @@ JAVA_FLAGS_JAVAC JAVA_FLAGS_BIG JAVA_FLAGS +TEST_JOBS JOBS MEMORY_SIZE NUM_CORES @@ -1142,6 +1143,7 @@ with_num_cores with_memory_size with_jobs +with_test_jobs with_boot_jdk_jvmargs with_sjavac_server_java enable_sjavac @@ -2061,6 +2063,8 @@ --with-memory-size=1024 [probed] --with-jobs number of parallel jobs to let make run [calculated based on cores and memory] + --with-test-jobs number of parallel tests jobs to run [based on build + jobs] --with-boot-jdk-jvmargs specify JVM arguments to be passed to all java invocations of boot JDK, overriding the default values, e.g --with-boot-jdk-jvmargs="-Xmx8G @@ -3747,7 +3751,7 @@ # -# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -3785,6 +3789,8 @@ + + ################################################################################ # # Optionally enable distributed compilation of native code using icecc/icecream @@ -4728,7 +4734,7 @@ #CUSTOM_AUTOCONF_INCLUDE # Do not change or remove the following line, it is needed for consistency checks: -DATE_WHEN_GENERATED=1449850507 +DATE_WHEN_GENERATED=1450172823 ############################################################################### # @@ -57253,6 +57259,21 @@ + # The number of test jobs will be chosen automatically if TEST_JOBS is 0 + +# Check whether --with-test-jobs was given. +if test "${with_test_jobs+set}" = set; then : + withval=$with_test_jobs; +fi + + if test "x$with_test_jobs" = x; then + TEST_JOBS=0 + else + TEST_JOBS=$with_test_jobs + fi + + + # Setup arguments for the boot jdk (after cores and memory have been setup) ############################################################################## diff -r 9fd6df05d847 -r 7e0595aab028 common/autoconf/spec.gmk.in --- a/common/autoconf/spec.gmk.in Mon Dec 14 20:32:22 2015 +0000 +++ b/common/autoconf/spec.gmk.in Tue Dec 15 11:04:18 2015 +0100 @@ -270,6 +270,7 @@ # Number of parallel jobs to use for compilation JOBS?=@JOBS@ +TEST_JOBS?=@TEST_JOBS@ # Default make target DEFAULT_MAKE_TARGET:=@DEFAULT_MAKE_TARGET@ diff -r 9fd6df05d847 -r 7e0595aab028 make/Help.gmk --- a/make/Help.gmk Mon Dec 14 20:32:22 2015 +0000 +++ b/make/Help.gmk Tue Dec 15 11:04:18 2015 +0100 @@ -83,6 +83,7 @@ $(info $(_) # To see executed command lines, use LOG=debug) $(info $(_) JOBS= # Run parallel make jobs) $(info $(_) # Note that -jN does not work as expected!) + $(info $(_) TEST_JOBS= # Run parallel test jobs) $(info $(_) CONF_CHECK= # What to do if spec file is out of date) $(info $(_) # method is 'auto', 'ignore' or 'fail' (default)) $(info $(_) make test TEST= # Only run the given test or tests, e.g.) diff -r 9fd6df05d847 -r 7e0595aab028 make/InitSupport.gmk --- a/make/InitSupport.gmk Mon Dec 14 20:32:22 2015 +0000 +++ b/make/InitSupport.gmk Tue Dec 15 11:04:18 2015 +0100 @@ -40,7 +40,8 @@ ############################################################################## # Make control variables, handled by Init.gmk - INIT_CONTROL_VARIABLES := LOG CONF CONF_NAME SPEC JOBS CONF_CHECK COMPARE_BUILD + INIT_CONTROL_VARIABLES := LOG CONF CONF_NAME SPEC JOBS TEST_JOBS CONF_CHECK \ + COMPARE_BUILD # All known make control variables MAKE_CONTROL_VARIABLES := $(INIT_CONTROL_VARIABLES) TEST JDK_FILTER diff -r 9fd6df05d847 -r 7e0595aab028 make/MainSupport.gmk --- a/make/MainSupport.gmk Mon Dec 14 20:32:22 2015 +0000 +++ b/make/MainSupport.gmk Tue Dec 15 11:04:18 2015 +0100 @@ -35,7 +35,8 @@ ($(CD) $(SRC_ROOT)/test && $(MAKE) $(MAKE_ARGS) -j1 -k MAKEFLAGS= \ JT_HOME=$(JT_HOME) PRODUCT_HOME=$(JDK_IMAGE_DIR) \ TEST_IMAGE_DIR=$(TEST_IMAGE_DIR) \ - ALT_OUTPUTDIR=$(OUTPUT_ROOT) CONCURRENCY=$(JOBS) $1) || true + ALT_OUTPUTDIR=$(OUTPUT_ROOT) TEST_JOBS=$(TEST_JOBS) \ + JOBS=$(JOBS) $1) || true endef # Cleans the dir given as $1 diff -r 9fd6df05d847 -r 7e0595aab028 test/Makefile --- a/test/Makefile Mon Dec 14 20:32:22 2015 +0000 +++ b/test/Makefile Tue Dec 15 11:04:18 2015 +0100 @@ -1,5 +1,5 @@ # -# Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -60,18 +60,28 @@ # Bring in closed test targets if present -include $(TOPDIR)/closed/test/Makefile +ifeq ($(TEST_JOBS), 0) + JDK_TEST_JOBS=$(JOBS) +else + JDK_TEST_JOBS=$(TEST_JOBS) +endif # Test targets langtools_% : - @$(NO_STOPPING)$(call SUBDIR_TEST, $(LANGTOOLS_DIR), JT_JAVA=$(PRODUCT_HOME) JTREG_HOME=$(JT_HOME) TEST="$(subst langtools_,,$@)" $(subst langtools_,,$@)) + @$(NO_STOPPING)$(call SUBDIR_TEST, $(LANGTOOLS_DIR), CONCURRENCY=$(JDK_TEST_JOBS) JT_JAVA=$(PRODUCT_HOME) JTREG_HOME=$(JT_HOME) TEST="$(subst langtools_,,$@)" $(subst langtools_,,$@)) jdk_% core_%s svc_%: - @$(NO_STOPPING)$(call SUBDIR_TEST, $(JDK_DIR), TEST="$@" $@) + @$(NO_STOPPING)$(call SUBDIR_TEST, $(JDK_DIR), CONCURRENCY=$(JDK_TEST_JOBS) TEST="$@" $@) jaxp_%: - @$(NO_STOPPING)$(call SUBDIR_TEST, $(JAXP_DIR), TEST="$@" $@) + @$(NO_STOPPING)$(call SUBDIR_TEST, $(JAXP_DIR), CONCURRENCY=$(JDK_TEST_JOBS) TEST="$@" $@) +ifeq ($(TEST_JOBS), 0) + HOTSPOT_TEST_JOBS=1 +else + HOTSPOT_TEST_JOBS=$(TEST_JOBS) +endif hotspot_%: - @$(NO_STOPPING)$(call SUBDIR_TEST, $(HOTSPOT_DIR), TEST="$@" $@) + @$(NO_STOPPING)$(call SUBDIR_TEST, $(HOTSPOT_DIR), CONCURRENCY=$(HOTSPOT_TEST_JOBS) TEST="$@" $@) # # jtreg_tests