[9] RFR JDK-8152344: JVMCI test task: Unit tests for ConstantReflectionProvider
Christian Thalinger
christian.thalinger at oracle.com
Wed Mar 23 19:07:29 UTC 2016
> On Mar 23, 2016, at 7:57 AM, Christian Thalinger <christian.thalinger at oracle.com> wrote:
>
> I need to get a change into mx. Will get back to you.
Alright. I created an mx pull request for TestNG support:
https://github.com/graalvm/mx/pull/102 <https://github.com/graalvm/mx/pull/102>
In the meantime you can clone my mx repository on github. Add this patch to your changes:
diff -r 1e385207d9f2 .mx.jvmci/suite.py
--- a/.mx.jvmci/suite.py Fri Mar 18 15:54:47 2016 +0100
+++ b/.mx.jvmci/suite.py Wed Mar 23 08:52:35 2016 -1000
@@ -175,6 +175,18 @@ suite = {
"workingSets" : "JVMCI",
},
+ "jdk.vm.ci.hotspot.test" : {
+ "subDir" : "test/compiler/jvmci",
+ "sourceDirs" : ["src"],
+ "dependencies" : [
+ "mx:TESTNG",
+ "jdk.vm.ci.hotspot",
+ ],
+ "checkstyle" : "jdk.vm.ci.services",
+ "javaCompliance" : "1.8",
+ "workingSets" : "API,JVMCI",
+ },
+
"jdk.vm.ci.hotspotvmconfig" : {
"subDir" : "src/jdk.vm.ci/share/classes",
"sourceDirs" : ["src"],
and run mx checkstyle. You will see a bunch of errors. Fix these. Make sure JVMCI builds through mx:
$ mx build --no-native
The biggest problem I see is:
/Users/cthaling/ws/jdk9/hs-comp/hotspot/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/ReadConstantArrayElementDataProvider.java:47: error: package jdk.test.lib does not exist
import jdk.test.lib.Triple;
Not sure if it really makes sense to have that dependency. After the build succeeds you can run all unit tests via:
$ mx unittest
Once that works, either open all files in your favorite IDE (after doing mx ideinit) and reformat the files or run:
$ mx eclipseformat
>
>> On Mar 22, 2016, at 1:50 AM, Konstantin Shefov <konstantin.shefov at oracle.com <mailto:konstantin.shefov at oracle.com>> wrote:
>>
>> Hi, Christian
>>
>> Thanks for reviewing.
>>
>> Here is the new patch http://cr.openjdk.java.net/~kshefov/8152344/webrev.01/ <http://cr.openjdk.java.net/~kshefov/8152344/webrev.01/>
>>
>> I moved tests to the folder hotspot/test/compiler/jvmci/jdk.vm.ci.hotspot.test and tho the package jdk.vm.ci.hotspot.test. Also I have done some code re-formatting.
>>
>> -Konstantin
>>
>> On 03/22/2016 12:20 AM, Christian Thalinger wrote:
>>> Sorry but I have to bring this up again… there is so much line-breaking going on it’s ridiculous. Especially in:
>>>
>>> http://cr.openjdk.java.net/~kshefov/8152344/webrev.00/test/compiler/jvmci/constantReflectionProviderTest/BoxPrimitiveDataProvider.java.html <http://cr.openjdk.java.net/%7Ekshefov/8152344/webrev.00/test/compiler/jvmci/constantReflectionProviderTest/BoxPrimitiveDataProvider.java.html>
>>>
>>> Or this:
>>> 118 Assert.assertEquals(CONSTANT_REFLECTION_PROVIDER.readStableFieldValue(field,
>>> 119 receiver,
>>> 120 isDefStab),
>>> 121 expected, "Unexpected result:");
>>>
>>> Here is a suggestion. Move your tests into the package jdk.vm.ci.hotspot.test under:
>>>
>>> hotspot/test/compiler/jvmci/jdk.vm.ci.hotspot.test
>>>
>>> Look at jdk.vm.ci.runtime.test as an example. Then we add jdk.vm.ci.hotspot.test to the mx configuration file and let the predefined formatting rules take care of it.
>>>
>>> This would be my preferred way because then the tests are automatically imported into IDEs as well. Actually all JVMCI tests should do it this way.
>>>
>>>> On Mar 21, 2016, at 11:07 AM, Konstantin Shefov <konstantin.shefov at oracle.com> <mailto:konstantin.shefov at oracle.com> wrote:
>>>>
>>>> Hello
>>>>
>>>> Please review some new unit tests for methods of JVMCI jdk.vm.ci.hotspot.HotSpotConstantReflectionProvider class.
>>>>
>>>> The tests cover most public methods of the class named above.
>>>>
>>>> Here "test/compiler/jvmci/constantReflectionProviderTest/HotSpotConstantReflectionProviderTest.java" is the JTREG-testng file, all other classes are testng data providers, except TestHelper.java and DummyClass.java that store all necessary variables.
>>>>
>>>> Bug: https://bugs.openjdk.java.net/browse/JDK-8152344 <https://bugs.openjdk.java.net/browse/JDK-8152344>
>>>> Webrev: http://cr.openjdk.java.net/~kshefov/8152344/webrev.00/ <http://cr.openjdk.java.net/~kshefov/8152344/webrev.00/>
>>>>
>>>> Thanks
>>>> -Konstantin
>>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/attachments/20160323/8095d8ad/attachment.html>
More information about the hotspot-compiler-dev
mailing list