< prev index next >

test/jdk/tools/jpackage/test_jpackage.sh

Print this page




  12 #
  13 # For the list of accepted command line arguments see `run_tests.sh` script.
  14 #
  15 
  16 # Fail fast
  17 set -e; set -o pipefail;
  18 
  19 # Script debug
  20 dry_run=${JPACKAGE_TEST_DRY_RUN}
  21 
  22 # Default directory where jpackage should write bundle files
  23 output_dir=~/jpackage_bundles
  24 
  25 
  26 set_args ()
  27 {
  28   args=()
  29   local arg_is_output_dir=
  30   local arg_is_mode=
  31   local output_dir_set=

  32   for arg in "$@"; do
  33     if [ "$arg" == "-o" ]; then
  34       arg_is_output_dir=yes
  35       output_dir_set=yes
  36     elif [ "$arg" == "-m" ]; then
  37       arg_is_mode=yes
  38     continue






  39     elif [ -n "$arg_is_output_dir" ]; then
  40       arg_is_output_dir=
  41       output_dir="$arg"
  42     elif [ -n "$arg_is_mode" ]; then
  43       arg_is_mode=
  44       continue
  45     fi
  46 
  47     args+=( "$arg" )
  48   done
  49   [ -n "$output_dir_set" ] || args=( -o "$output_dir" "${args[@]}" )







  50 }
  51 
  52 
  53 exec_command ()
  54 {
  55   if [ -n "$dry_run" ]; then
  56     echo "$@"
  57   else
  58     eval "$@"
  59   fi
  60 }
  61 
  62 set_args "$@"
  63 basedir="$(dirname $0)"
  64 exec_command "$basedir/run_tests.sh" -m create "${args[@]}"
  65 exec_command "$basedir/manage_packages.sh" -d "$output_dir"
  66 exec_command "$basedir/run_tests.sh" -m verify-install "${args[@]}"
  67 exec_command "$basedir/manage_packages.sh" -d "$output_dir" -u
  68 exec_command "$basedir/run_tests.sh" -m verify-uninstall "${args[@]}"


  12 #
  13 # For the list of accepted command line arguments see `run_tests.sh` script.
  14 #
  15 
  16 # Fail fast
  17 set -e; set -o pipefail;
  18 
  19 # Script debug
  20 dry_run=${JPACKAGE_TEST_DRY_RUN}
  21 
  22 # Default directory where jpackage should write bundle files
  23 output_dir=~/jpackage_bundles
  24 
  25 
  26 set_args ()
  27 {
  28   args=()
  29   local arg_is_output_dir=
  30   local arg_is_mode=
  31   local output_dir_set=
  32   local with_append_actions=yes
  33   for arg in "$@"; do
  34     if [ "$arg" == "-o" ]; then
  35       arg_is_output_dir=yes
  36       output_dir_set=yes
  37     elif [ "$arg" == "-m" ]; then
  38       arg_is_mode=yes
  39       continue
  40     elif [ "$arg" == '--' ]; then
  41       append_actions
  42       with_append_actions=
  43       continue
  44     elif ! case "$arg" in -Djpackage.test.action=*) false;; esac; then
  45       continue
  46     elif [ -n "$arg_is_output_dir" ]; then
  47       arg_is_output_dir=
  48       output_dir="$arg"
  49     elif [ -n "$arg_is_mode" ]; then
  50       arg_is_mode=
  51       continue
  52     fi
  53 
  54     args+=( "$arg" )
  55   done
  56   [ -n "$output_dir_set" ] || args=( -o "$output_dir" "${args[@]}" )
  57   [ -z "$with_append_actions" ] || append_actions
  58 }
  59 
  60 
  61 append_actions ()
  62 {
  63   args+=( '--' '-Djpackage.test.action=create,install,verify-install,uninstall,verify-uninstall' )
  64 }
  65 
  66 
  67 exec_command ()
  68 {
  69   if [ -n "$dry_run" ]; then
  70     echo "$@"
  71   else
  72     eval "$@"
  73   fi
  74 }
  75 
  76 set_args "$@"
  77 basedir="$(dirname $0)"
  78 exec_command "$basedir/run_tests.sh" -m create "${args[@]}"




< prev index next >