From thomas.stuefe at gmail.com Thu Sep 7 08:23:17 2017 From: thomas.stuefe at gmail.com (=?UTF-8?Q?Thomas_St=C3=BCfe?=) Date: Thu, 7 Sep 2017 10:23:17 +0200 Subject: Re-using shared object in another unrelated test? Message-ID: Hi all, I'd am writing a jtreg test which loads a native shared library. I do not actually need to do anything with the shared library, so loading and unloading again. I do not plan on resolving any exports, it just needs to be there and be valid, on all platforms. There are a number of shared objects which would be a fit, e.g. JniVersion. Would it be okay to use this in a jtreg test or would this be considered bad form? Thank you, Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.holmes at oracle.com Thu Sep 7 08:29:10 2017 From: david.holmes at oracle.com (David Holmes) Date: Thu, 7 Sep 2017 18:29:10 +1000 Subject: Re-using shared object in another unrelated test? In-Reply-To: References: Message-ID: <7141e7b3-f480-5ce6-65e0-43b98477be2f@oracle.com> Hi Thomas, On 7/09/2017 6:23 PM, Thomas St?fe wrote: > Hi all, > > I'd am writing a jtreg test which loads a native shared library. I do > not actually need to do anything with the shared library, so loading and > unloading again. I do not plan on resolving any exports, it just needs > to be there and be valid, on all platforms. > > There are a number of shared objects which would be a fit, e.g. > JniVersion. Would it be okay to use this in a jtreg test or would this > be considered bad form? Given the convention used to get the native parts of jtreg tests built (when building test-image) I would think it simpler, and cleaner to just define a trivial .c file and build the library from it. Thanks, David > Thank you, Thomas From thomas.stuefe at gmail.com Thu Sep 7 09:33:58 2017 From: thomas.stuefe at gmail.com (=?UTF-8?Q?Thomas_St=C3=BCfe?=) Date: Thu, 7 Sep 2017 11:33:58 +0200 Subject: Re-using shared object in another unrelated test? In-Reply-To: <7141e7b3-f480-5ce6-65e0-43b98477be2f@oracle.com> References: <7141e7b3-f480-5ce6-65e0-43b98477be2f@oracle.com> Message-ID: On Thu, Sep 7, 2017 at 10:29 AM, David Holmes wrote: > Hi Thomas, > > On 7/09/2017 6:23 PM, Thomas St?fe wrote: > >> Hi all, >> >> I'd am writing a jtreg test which loads a native shared library. I do not >> actually need to do anything with the shared library, so loading and >> unloading again. I do not plan on resolving any exports, it just needs to >> be there and be valid, on all platforms. >> >> There are a number of shared objects which would be a fit, e.g. >> JniVersion. Would it be okay to use this in a jtreg test or would this be >> considered bad form? >> > > Given the convention used to get the native parts of jtreg tests built > (when building test-image) I would think it simpler, and cleaner to just > define a trivial .c file and build the library from it. > > Thanks, > David > > Thanks, David, I will do that. ..Thomas > Thank you, Thomas >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.holmes at oracle.com Fri Sep 15 04:38:48 2017 From: david.holmes at oracle.com (David Holmes) Date: Fri, 15 Sep 2017 14:38:48 +1000 Subject: Executing the main method of a nested class? In-Reply-To: <156496b5-19dd-c638-4c90-d648f3a4845a@oracle.com> References: <156496b5-19dd-c638-4c90-d648f3a4845a@oracle.com> Message-ID: I have the following: /* * @test * @bug 8046171 * @compile -XDdisablePrivateAccessors CrashTheJIT.java * @run main/othervm -Xcomp CrashTheJIT$Nested */ public class CrashTheJIT { static class Nested2 { private Nested2() { } } public static class Nested { public static void main(String[] args) { run(); } private static void run() { Nested2 n = new Nested2(); } } } but it fails because it seems as part of @run jtreg wants to compile CrashTheJIT$Nested: ACTION: compile -- Passed. Compilation successful REASON: User specified action: run compile -XDdisablePrivateAccessors CrashTheJIT.java TIME: 1.591 seconds messages: command: compile -XDdisablePrivateAccessors /export/users/dh198349/valhalla/valhalla-base/hotspot/test/runtime/Nestmates/CrashTheJIT.java reason: User specified action: run compile -XDdisablePrivateAccessors CrashTheJIT.java Mode: othervm elapsed time (seconds): 1.591 ... STDOUT: STDERR: ACTION: build -- Not run. Test running... REASON: Named class compiled on demand TIME: JIT$Nested seconds messages: command: build CrashTheJIT$Nested reason: Named class compiled on demand TEST RESULT: Error. can't find CrashTheJIT$Nested in test directory or libraries ---- Note the messed up "TIME: JIT$Nested seconds" as well! Is there any way to tell jtreg the @compile already handled everything ?? Thanks, David From jonathan.gibbons at oracle.com Fri Sep 15 17:02:07 2017 From: jonathan.gibbons at oracle.com (Jonathan Gibbons) Date: Fri, 15 Sep 2017 10:02:07 -0700 Subject: Executing the main method of a nested class? In-Reply-To: References: <156496b5-19dd-c638-4c90-d648f3a4845a@oracle.com> Message-ID: <59BC078F.7050500@oracle.com> On 09/14/2017 09:38 PM, David Holmes wrote: > I have the following: > > /* > * @test > * @bug 8046171 > * @compile -XDdisablePrivateAccessors CrashTheJIT.java > * @run main/othervm -Xcomp CrashTheJIT$Nested > */ > > public class CrashTheJIT { > > static class Nested2 { > private Nested2() { } > } > > public static class Nested { > public static void main(String[] args) { > run(); > } > private static void run() { > Nested2 n = new Nested2(); > } > } > } > > but it fails because it seems as part of @run jtreg wants to compile > CrashTheJIT$Nested: > > ACTION: compile -- Passed. Compilation successful > REASON: User specified action: run compile -XDdisablePrivateAccessors > CrashTheJIT.java > TIME: 1.591 seconds > messages: > command: compile -XDdisablePrivateAccessors > /export/users/dh198349/valhalla/valhalla-base/hotspot/test/runtime/Nestmates/CrashTheJIT.java > reason: User specified action: run compile -XDdisablePrivateAccessors > CrashTheJIT.java > Mode: othervm > elapsed time (seconds): 1.591 > ... > STDOUT: > STDERR: > > ACTION: build -- Not run. Test running... > REASON: Named class compiled on demand > TIME: JIT$Nested seconds > messages: > command: build CrashTheJIT$Nested > reason: Named class compiled on demand > > TEST RESULT: Error. can't find CrashTheJIT$Nested in test directory or > libraries > > ---- > > Note the messed up "TIME: JIT$Nested seconds" as well! > > Is there any way to tell jtreg the @compile already handled everything ?? > > Thanks, > David David, Sorry, executing nested classes is not supported. -- Jon