Modules params in shell tests on modular JDK
Miloslav Zezulka
mzezulka at redhat.com
Tue Feb 13 15:42:15 UTC 2018
> 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
It is also worth mentioning that this work is already done in
com.sun.javatest.regtest.exec.Action.getExtraModuleConfigOptions method for
the purposes of Java jtregs. However, this @modules -> "--add-exports ..."
conversion is also available for the ShellAction subclass, so why not make
it available for shell tests, too? It makes more sense to me than the
awkward sed script above.
On Tue, Feb 13, 2018 at 4:21 PM, Zdeněk Žamberský <zzambers at redhat.com>
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,
>
> --
> Zdeněk Žamberský
> OpenJDK QE
> Red Hat
>
>
More information about the jtreg-dev
mailing list