Modules params in shell tests on modular JDK
Jonathan Gibbons
jonathan.gibbons at oracle.com
Tue Feb 13 21:34:29 UTC 2018
I would again encourage you to be moving away from shell tests in favor
of tests written in Java.
That is the general direction for all OpenJDK tests. Tests can be
faster, and it is certainly easier
to write and use library code in Java to handle the sort of task you are
doing here.
-- Jon
On 02/13/2018 07:21 AM, Zdeněk Žamberský wrote:
> Hi,
>
> I am currently trying to make some jtreg shell tests work on modular jdk.
> And while TESTMODULES env. variable gives me list of required modules,
> there is still need for additional code to transform it to parameters
> for java, javac (these --add-modules, --add-exports params ).
>
> I ended up with something like this:
>
> ADD_MODULES_PARAMS=""
> ADD_EXPORTS_PARAMS=""
> if [ -n "${TESTMODULES}" ] ; then
> ADD_MODULES_PARAMS="--add-modules $( printf "%s" "${TESTMODULES}" \
> | sed
> 's/\([^/[:space:]]\+\)\(\/[^[:space:]]*\)*[[:space:]]*/\1,/g' )"
> ADD_MODULES_PARAMS="${ADD_MODULES_PARAMS%,}"
>
> ADD_EXPORTS_PARAMS="$( printf "%s" "${TESTMODULES}" \
> | sed 's/[^[:space:]]\+/--add-exports &=ALL-UNNAMED/g' )"
> fi
>
> I wonder if env. variable with generated parameters
> could be passed toshell tests by environment to simplify
> shell jtreg tests for modular JDK?
>
> best regards,
>
More information about the jtreg-dev
mailing list