Skip to content

Commit

Permalink
8238204: run_tests.sh fails on macOS when called from test_jpackage.sh
Browse files Browse the repository at this point in the history
Reviewed-by: herrick, almatvee
  • Loading branch information
Alexey Semenyuk committed Jun 8, 2020
1 parent 28d2cdf commit f87ef60
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions test/jdk/tools/jpackage/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -248,18 +248,18 @@ installJtreg ()

preRun ()
{
local xargs_args=(-t --no-run-if-empty rm)
if [ -n "$dry_run" ]; then
xargs_args=(--no-run-if-empty echo rm)
fi

if [ ! -d "$output_dir" ]; then
exec_command mkdir -p "$output_dir"
fi
[ ! -d "$output_dir" ] || output_dir=$(cd "$output_dir" && pwd)

# Clean output directory
[ "$mode" != "create" ] || find $output_dir -maxdepth 1 -type f -name '*.exe' -or -name '*.msi' -or -name '*.rpm' -or -name '*.deb' | xargs "${xargs_args[@]}"
if [ "$mode" == "create" ]; then
for f in $(find $output_dir -maxdepth 1 -type f -name '*.exe' -or -name '*.msi' -or -name '*.rpm' -or -name '*.deb'); do
echo rm "$f"
[ -n "$dry_run" ] || rm "$f"
done
fi
}


Expand Down
2 changes: 1 addition & 1 deletion test/jdk/tools/jpackage/test_jpackage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,4 @@ exec_command ()

set_args "$@"
basedir="$(dirname $0)"
exec_command "$basedir/run_tests.sh" -m create "${args[@]}"
exec_command ${SHELL} "$basedir/run_tests.sh" -m create "${args[@]}"

0 comments on commit f87ef60

Please sign in to comment.