diff options
| author | 2019-09-30 15:39:15 -0700 | |
|---|---|---|
| committer | 2019-10-01 21:34:05 +0000 | |
| commit | bd5690db112e7357bfa7634abbda9762e20959d7 (patch) | |
| tree | e124a7758df578f8d61934126fec0720a2f4b0e5 | |
| parent | 627d8d3d532f00ae7b6145887b39f9cf0a14b148 (diff) | |
Make run-jdwp-tests.sh warn about deprecation
Since the internal jdwp implementation is deprecated when running the
JDWP test suite one should generally use ./tools/run-libjdwp-tests.sh
instead of ./tools/run-jdwp-tests.sh. This makes run-jdwp-tests.sh
require a special flag to run if not invoked through
run-libjdwp-tests.sh or by LUCI. This should help ensure people run
the appropriate tests.
Test: ./art/tools/run-jdwp-tests.sh --mode=host
Test: ./art/tools/run-jdwp-tests.sh --mode=host --force-run-test
Test: ./art/tools/run-libjdwp-tests.sh --mode=host
Change-Id: Id31fddafe6112656945e544c0dba7a9629deb247
| -rwxr-xr-x | tools/run-jdwp-tests.sh | 22 | ||||
| -rwxr-xr-x | tools/run-libjdwp-tests.sh | 3 |
2 files changed, 25 insertions, 0 deletions
diff --git a/tools/run-jdwp-tests.sh b/tools/run-jdwp-tests.sh index e686d7da92..da89403a6d 100755 --- a/tools/run-jdwp-tests.sh +++ b/tools/run-jdwp-tests.sh @@ -80,6 +80,12 @@ use_jit=true instant_jit=false variant_cmdline_parameter="--variant=X32" dump_command="/bin/true" +called_from_libjdwp=${RUN_JDWP_TESTS_CALLED_FROM_LIBJDWP:-false} +run_internal_jdwp_test=false +# Let LUCI bots do what they want. +if test -v LUCI_CONTEXT; then + run_internal_jdwp_test=true +fi # Timeout of JDWP test in ms. # # Note: some tests expect a timeout to check that *no* reply/event is received for a specific case. @@ -123,6 +129,7 @@ while true; do elif [[ "$1" == "--mode=jvm" ]]; then mode="ri" make_target_name="apache-harmony-jdwp-tests" + run_internal_jdwp_test=true art="$(which java)" art_debugee="$(which java)" # No need for extra args. @@ -138,6 +145,11 @@ while true; do # We don't care about jit with the RI use_jit=false shift + elif [[ $1 == --force-run-test ]]; then + run_internal_jdwp_test=true + # remove the --force-run-test + args=${args/$1} + shift elif [[ $1 == --test-timeout-ms ]]; then # Remove the --test-timeout-ms from the arguments. args=${args/$1} @@ -237,6 +249,16 @@ if [[ $mode == "target" ]]; then fi fi +if [[ $called_from_libjdwp != "true" ]]; then + if [[ $run_internal_jdwp_test = "false" ]]; then + echo "Calling run_jdwp_tests.sh directly is probably not what you want. You probably want to" + echo "run ./art/tools/run-libjdwp-tests.sh instead in order to test the JDWP implementation" + echo "used by apps. If you really wish to run these tests using the deprecated internal JDWP" + echo "implementation pass the '--force-run-test' flag." + exit 1 + fi +fi + if [[ $has_gdb = "yes" ]]; then if [[ $explicit_debug = "no" ]]; then debug="yes" diff --git a/tools/run-libjdwp-tests.sh b/tools/run-libjdwp-tests.sh index 0bea6a5fe3..d514c0c9bc 100755 --- a/tools/run-libjdwp-tests.sh +++ b/tools/run-libjdwp-tests.sh @@ -118,6 +118,9 @@ function verbose_run() { env "$@" } +# Tell run-jdwp-tests.sh it was called from run-libjdwp-tests.sh +export RUN_JDWP_TESTS_CALLED_FROM_LIBJDWP=true + verbose_run ./art/tools/run-jdwp-tests.sh \ "${args[@]}" \ --jdwp-path "libjdwp.so" \ |