RFR: Tweaks to langtools/test/Makefile
Jonathan Gibbons
jonathan.gibbons at oracle.com
Wed Jun 8 21:18:50 UTC 2016
Looks good, but in time, we should look to align the various
test/Makefiles with similar paradigms and features.
-- Jon
On 06/08/2016 02:02 PM, Dan Smith wrote:
>> On Jun 7, 2016, at 5:00 PM, Dan Smith <daniel.smith at oracle.com> wrote:
>>
>> I'd like to make the following tweaks to langtools/test/Makefile, mostly to make use via the top-level 'make test' command more convenient. Any objections? Can I get a reviewer approval?
>>
>> Bug number JDK-8158992; some extra discussion there:
>> https://bugs.openjdk.java.net/browse/JDK-8158992
> Updated patch below -- Jon suggested updating the default JTREG_HOME, as it's out of date.
>
> —Dan
>
>
> diff -r e69e0ec39b92 test/Makefile
> --- a/test/Makefile Wed Jun 01 15:27:52 2016 -0700
> +++ b/test/Makefile Wed Jun 08 15:01:05 2016 -0600
> @@ -84,12 +84,14 @@
> endif
>
> # Default JTREG to run
> -ifdef JPRT_JTREG_HOME
> - JTREG_HOME = $(JPRT_JTREG_HOME)
> -else ifdef JT_HOME
> - JTREG_HOME = $(JT_HOME)
> -else
> - JTREG_HOME = $(SLASH_JAVA)/re/jtreg/4.1-jigsaw/nightly/binaries/jtreg/
> +ifndef JTREG_HOME
> + ifdef JPRT_JTREG_HOME
> + JTREG_HOME = $(JPRT_JTREG_HOME)
> + else ifdef JT_HOME
> + JTREG_HOME = $(JT_HOME)
> + else
> + JTREG_HOME = $(SLASH_JAVA)/re/jtreg/4.2/promoted/latest/
> + endif
> endif
> JTREG = $(JTREG_HOME)/bin/jtreg
> JTDIFF = $(JTREG_HOME)/bin/jtdiff
> @@ -105,10 +107,12 @@
> endif
>
> # Default JCK to run
> -ifdef JPRT_JCK_HOME
> - JCK_HOME = $(JPRT_JCK_HOME)
> -else
> - JCK_HOME = $(SLASH_JAVA)/re/jck/8/promoted/latest/binaries
> +ifndef JCK_HOME
> + ifdef JPRT_JCK_HOME
> + JCK_HOME = $(JPRT_JCK_HOME)
> + else
> + JCK_HOME = $(SLASH_JAVA)/re/jck/8/promoted/latest/binaries
> + endif
> endif
>
> # Default JDK for JTREG and JCK
> @@ -203,10 +207,10 @@
> endif
>
> # Default verbosity setting for jtreg
> -JTREG_VERBOSE = fail,error,nopass
> +JTREG_VERBOSE ?= fail,error,nopass
>
> # Default verbosity setting for jck
> -JCK_VERBOSE = non-pass
> +JCK_VERBOSE ?= non-pass
>
> # Assertions: some tests show failures when assertions are enabled.
> # Since javac is typically loaded via the bootclassloader (either via TESTJAVA
> @@ -232,10 +236,6 @@
> # to a given level. Redefine function or preceding FATAL_*_EXIT codes as needed.
> EXIT_IF_FATAL = status=$$?; if [ $$status -ge $(1) ]; then exit $$status ; fi
>
> -# The test directories to run
> -DEFAULT_TESTDIRS = .
> -TESTDIRS = $(DEFAULT_TESTDIRS)
> -
> # Root of all test results
> TEST_OUTPUT_DIR = $(TEST_ROOT)/../build/$(PLATFORM)-$(ARCH)/test/langtools
> ABS_TEST_OUTPUT_DIR := \
> @@ -260,9 +260,17 @@
> jck-runtime: $(JPRT_CLEAN) jck-runtime-tests $(JPRT_ARCHIVE_BUNDLE) jck-runtime-summary
> @echo "Testing completed successfully"
>
> +# a way to select tests from outside
> +# works for targets 'jtreg', 'jck-compiler', and 'jck-runtime'
> +ifdef TEST_SELECTION
> + JTREG_TESTDIRS = $(TEST_SELECTION)
> + JCK_COMPILER_TESTDIRS = $(TEST_SELECTION)
> + JCK_RUNTIME_TESTDIRS = $(TEST_SELECTION)
> +endif
> +
> # for use with JPRT -testrule
> all: JTREG_TESTDIRS = .
> -jtreg: JTREG_TESTDIRS = .
> +jtreg: JTREG_TESTDIRS ?= .
> apt: JTREG_TESTDIRS = tools/apt
> javac: JTREG_TESTDIRS = tools/javac
> javadoc: JTREG_TESTDIRS = tools/javadoc com/sun/javadoc
> @@ -270,11 +278,6 @@
> javap: JTREG_TESTDIRS = tools/javap
> jdeps: JTREG_TESTDIRS = tools/jdeps
>
> -# a way to select jtreg tests from outside
> -ifdef TEST_SELECTION
> - JTREG_TESTDIRS = $(TEST_SELECTION)
> -endif
> -
>
> # Run jtreg tests
> #
> @@ -438,11 +441,11 @@
>
> # Check to make sure these directories exist
> check-jck:
> - if [ ! -d '$(JCK_HOME)' ]; then \
> + @if [ ! -d '$(JCK_HOME)' ]; then \
> echo "JCK_HOME $(JCK_HOME) missing" ; \
> $(EXIT) 1 ; \
> fi
> - if [ ! -d '$(PRODUCT_HOME)' ]; then \
> + @if [ ! -d '$(PRODUCT_HOME)' ]; then \
> echo "PRODUCT_HOME $(PRODUCT_HOME) missing" ; \
> $(EXIT) 1 ; \
> fi
>
More information about the compiler-dev
mailing list