From sean.mullan at oracle.com Wed Jan 31 16:10:22 2018 From: sean.mullan at oracle.com (Sean Mullan) Date: Wed, 31 Jan 2018 11:10:22 -0500 Subject: Specifying @run action on command-line Message-ID: <5b8aaef2-2de3-cf1f-47b7-86972a0825e4@oracle.com> I have a test that has quite a few @run actions. Is there a way with jtreg to run just one of those @run actions or specify my own @run action? Otherwise I have to comment out all the ones that I don't want to run or run the test directly with the VM without using jtreg. Thanks, Sean From jonathan.gibbons at oracle.com Wed Jan 31 16:49:38 2018 From: jonathan.gibbons at oracle.com (Jonathan Gibbons) Date: Wed, 31 Jan 2018 08:49:38 -0800 Subject: Specifying @run action on command-line In-Reply-To: <5b8aaef2-2de3-cf1f-47b7-86972a0825e4@oracle.com> References: <5b8aaef2-2de3-cf1f-47b7-86972a0825e4@oracle.com> Message-ID: <08fa71a0-8500-d835-aa6f-6083bc1d08ac@oracle.com> Sean, Sorry, no, the contents of the `/* @test ...*/` is indivisible, and can only be run all-together. Think of it like a script ... you're asking to select/run one line of a script. There is one technique, which may not be what you want, that is now better supported, and that is to put independent tests into separate `/* @test ...*/` blocks. You can select individual blocks to be run using a `#id` syntax on the command line. Think of it a URL fragment syntax. The other way to provide more flexible behavior is to avoid using multiple @run tags, but just use one, to nominate a class that can determine what to run, perhaps starting new VMs with a call to some suitable test library. I realize both of these suggestions involve significant refactoring, so for a quick debug/test scenario, you're probably best with either commenting out lines or running the test directly.?? Note that the .jtr file should contain a "rerun" section for each @run command, that you can extract into a shell script, to make rerunning that part of the test reasonably easy. -- Jon On 1/31/18 8:10 AM, Sean Mullan wrote: > I have a test that has quite a few @run actions. Is there a way with > jtreg to run just one of those @run actions or specify my own @run > action? Otherwise I have to comment out all the ones that I don't want > to run or run the test directly with the VM without using jtreg. > > Thanks, > Sean