1 #!/bin/bash
   2 
   3 set -x
   4 
   5 set -e
   6 if [ -z "$BASH" ]; then
   7   # The script relies on Bash arrays, rerun in Bash.
   8   /bin/bash $0 $@
   9   exit
  10 fi
  11 
  12 sources=()
  13 classes=()
  14 for s in $(find "${TESTSRC}" -name  "*.java" | grep -v junit.java); do
  15   sources+=( "$s" )
  16   classes+=( $(echo "$s" | sed -e "s|${TESTSRC}/||" -e 's|/|.|g' -e 's/.java$//') )
  17 done
  18 
  19 common_args=(\
  20   --add-modules jdk.incubator.jpackage \
  21   --patch-module jdk.incubator.jpackage="${TESTSRC}${PS}${TESTCLASSES}" \
  22   --add-reads jdk.incubator.jpackage=ALL-UNNAMED \
  23   --add-exports jdk.incubator.jpackage/jdk.incubator.jpackage.internal=ALL-UNNAMED \
  24   -classpath "${TESTCLASSPATH}" \
  25 )
  26 
  27 # Compile classes for junit
  28 "${COMPILEJAVA}/bin/javac" ${TESTTOOLVMOPTS} ${TESTJAVACOPTS} \
  29   "${common_args[@]}" -d "${TESTCLASSES}" "${sources[@]}"
  30 
  31 # Run junit
  32 "${TESTJAVA}/bin/java" ${TESTVMOPTS} ${TESTJAVAOPTS} \
  33   "${common_args[@]}" org.junit.runner.JUnitCore "${classes[@]}"