Path: blob/master/test/jdk/tools/jpackage/junit/run_junit.sh
41149 views
#!/bin/bash12# Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved.3# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.4#5# This code is free software; you can redistribute it and/or modify it6# under the terms of the GNU General Public License version 2 only, as7# published by the Free Software Foundation.8#9# This code is distributed in the hope that it will be useful, but WITHOUT10# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or11# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License12# version 2 for more details (a copy is included in the LICENSE file that13# accompanied this code).14#15# You should have received a copy of the GNU General Public License version16# 2 along with this work; if not, write to the Free Software Foundation,17# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.18#19# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA20# or visit www.oracle.com if you need additional information or have any21# questions.2223set -x2425set -e26if [ -z "$BASH" ]; then27# The script relies on Bash arrays, rerun in Bash.28/bin/bash $0 $@29exit30fi3132sources=()33classes=()34for s in $(find "${TESTSRC}" -name "*.java" | grep -v junit.java); do35sources+=( "$s" )36classes+=( $(echo "$s" | sed -e "s|${TESTSRC}/||" -e 's|/|.|g' -e 's/.java$//') )37done3839common_args=(\40--add-modules jdk.jpackage \41--patch-module jdk.jpackage="${TESTSRC}${PS}${TESTCLASSES}" \42--add-reads jdk.jpackage=ALL-UNNAMED \43--add-exports jdk.jpackage/jdk.jpackage.internal=ALL-UNNAMED \44-classpath "${TESTCLASSPATH}" \45)4647# Compile classes for junit48"${COMPILEJAVA}/bin/javac" ${TESTTOOLVMOPTS} ${TESTJAVACOPTS} \49"${common_args[@]}" -d "${TESTCLASSES}" "${sources[@]}"5051# Run junit52"${TESTJAVA}/bin/java" ${TESTVMOPTS} ${TESTJAVAOPTS} \53"${common_args[@]}" org.junit.runner.JUnitCore "${classes[@]}"545556