changeset 59644:c1c690f4dd9c

8238204: run_tests.sh fails on macOS when called from test_jpackage.sh Reviewed-by: herrick, almatvee
author asemenyuk
date Mon, 08 Jun 2020 09:13:01 -0400
parents c637b86b047a
children 5efafa45f3b8
files test/jdk/tools/jpackage/run_tests.sh test/jdk/tools/jpackage/test_jpackage.sh
diffstat 2 files changed, 7 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/test/jdk/tools/jpackage/run_tests.sh	Mon Jun 08 09:13:00 2020 -0400
+++ b/test/jdk/tools/jpackage/run_tests.sh	Mon Jun 08 09:13:01 2020 -0400
@@ -248,18 +248,18 @@
 
 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
 }
 
 
--- a/test/jdk/tools/jpackage/test_jpackage.sh	Mon Jun 08 09:13:00 2020 -0400
+++ b/test/jdk/tools/jpackage/test_jpackage.sh	Mon Jun 08 09:13:01 2020 -0400
@@ -75,4 +75,4 @@
 
 set_args "$@"
 basedir="$(dirname $0)"
-exec_command "$basedir/run_tests.sh" -m create "${args[@]}"
+exec_command ${SHELL} "$basedir/run_tests.sh" -m create "${args[@]}"