RFR: JDK-8170629 Remove code duplication in test makefiles

Magnus Ihse Bursie magnus.ihse.bursie at oracle.com
Tue Dec 6 10:15:01 UTC 2016

On 2016-12-05 05:34, David Holmes wrote:
> <trimmed to build-dev and hotspot-dev>
> Hi Magnus,
> Some independent changes are going to collide here. :)
> hotspot/make/test/JtregNative.gmk
> This change has already happened in hs repo - JDK-8169261.
Ok, I removed that fix from my patch.
> ---
> hotspot/test/Makefile
> Aside: - Jigsaw bumped this to 4.2 (and I think that was a while ago). 
> I don't think anything we do with jtreg relies on the JT_HOME setting 
> currently set in hotspot/test/Makefile. So we should bump this after 
> your refactor.

I think so too.

> 41 # hotspot currently do not use ProblemList.txt
> 42 NO_EXCLUDES := true
> Igor is adding this right now:
> http://mail.openjdk.java.net/pipermail/hotspot-dev/2016-December/025436.html 

I removed the NO_EXCLUDES statement from Hotspot. This does not have any 
effect as long as no ProblemList.txt is present (in fact, had I thought 
a bit more on this before, I would not even have needed to add that 
guard for hotspot), but will facilitate merging with Igor's patch.
> Otherwise looks good.

I discovered a few other issues in the Hotspot file (it turned out I 
didn't run the hotspot tests before with my jprt command :() which I 
also have fixed.

New webrev: 


> Thanks,
> David
> -----
> On 2/12/2016 7:24 PM, Magnus Ihse Bursie wrote:
>> There is a lot of common code that has been duplicated in
>> */test/Makefile. For jdk, hotspot, jaxp and nashorn, most of the code in
>> the corresponding files are identical. (The odd-man-out is langtools
>> which is quite different.)
>> These files should be unified to share a single code base, to facilitate
>> further improvements to the test makefiles.
>> The intent of this bug is a pure refactoring. The duplication should go,
>> but all functionality should remain exactly the same. This will leave
>> room for some future improvements to the code, but sets a clear limit
>> for this first step. The consolidated code base thus contains a fair
>> amount of if-blocks, but I hope to be able to address most of these
>> later on, by adjusting the individual component to adhere more to the
>> standard behavior.
>> To minimize the amount of ifdefs in the shared code, I allowed for a few
>> changes in behavior. I do not believe these will cause any changes in
>> the real world, and to the extent that they do, they could be considered
>> bug fixes.
>> Behavior that have changed due to unification:
>> * jaxp now defaults ABS_JDK_IMAGE to images/jdk instead of j2sdk.
>> * jaxp now sets TEST_SELECTION to $(TESTDIRS) if it exists.
>> * jaxp and hotspot now get additional option e:JDK8_HOME=${JT_JAVA}
>> * hotspot now sets JAVA_VM_ARGS to $(JPRT_PRODUCT_VM_ARGS) if it exists.
>> * hotspot now sets JAVA_ARGS to $(JPRT_PRODUCT_ARGS) if it exists.
>> Bug: https://bugs.openjdk.java.net/browse/JDK-8170629
>> WebRev:
>> http://cr.openjdk.java.net/~ihse/JDK-8170629-remove-test-makefile-duplication/webrev.01 
>> /Magnus

More information about the hotspot-dev mailing list