diff options
author | Maurice Lam <yukl@google.com> | 2018-02-28 21:38:34 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2018-02-28 21:38:34 +0000 |
commit | 86fddd555e87636d450344267dd9d513c8cab150 (patch) | |
tree | 81b4e16c546a22afabdd88af36768f8d97f7a084 | |
parent | ed12e5939b834a2d1fabc99d85a9c8dc333f1019 (diff) | |
parent | 90f0b8e738c88e2da4ced82afd20cdc0ec6fce3f (diff) | |
download | robolectric-shadows-86fddd555e87636d450344267dd9d513c8cab150.tar.gz |
Merge "Move debug flags to bash script"
-rw-r--r-- | robotest-internal.mk | 2 | ||||
-rwxr-xr-x | robotest.sh | 22 | ||||
-rw-r--r-- | run_robotests.mk | 21 |
3 files changed, 21 insertions, 24 deletions
diff --git a/robotest-internal.mk b/robotest-internal.mk index e3507c460..4bc83b465 100644 --- a/robotest-internal.mk +++ b/robotest-internal.mk @@ -86,4 +86,4 @@ $(call dist-for-goals, $(my_target), \ my_target_output := my_target_retval := my_target_xml := -my_filename_stem :=
\ No newline at end of file +my_filename_stem := diff --git a/robotest.sh b/robotest.sh index 160b533d8..e1d992e8d 100755 --- a/robotest.sh +++ b/robotest.sh @@ -55,10 +55,28 @@ function normalize-path-list() { function junit() { # This adds the lib folder to the cp. local classpath="$(strip "$(normalize-path-list "${PRIVATE_JARS}")")" + # Setting the DEBUG_ROBOLECTRIC environment variable will print additional logging from + # Robolectric and also make it wait for a debugger to be connected. + # For Android Studio / IntelliJ the debugger can be connected via the "remote" configuration: + # https://www.jetbrains.com/help/idea/2016.2/run-debug-configuration-remote.html + # From command line the debugger can be connected via + # jdb -attach localhost:5005 + if [ -n ${DEBUG_ROBOLECTRIC:-""} ]; then + # The arguments to the JVM needed to debug the tests. + # - server: wait for connection rather than connecting to a debugger + # - transport: how to accept debugger connections (sockets) + # - address: the port on which to accept debugger connections + # - timeout: how long (in ms) to wait for a debugger to connect + # - suspend: do not start running any code until the debugger connects + local debug_java_args="-Drobolectric.logging.enabled=true \ + -Xdebug -agentlib:jdwp=server=y,transport=dt_socket,address=localhost:5005,suspend=y" + # Remove the timeout so Robolectric doesn't get killed while debugging + local debug_timeout="0" + fi local command=( "${PRIVATE_ROBOLECTRIC_SCRIPT_PATH}/java-timeout" - "${PRIVATE_TIMEOUT}" - ${PRIVATE_JAVA_ARGS} + "${debug_timeout:-${PRIVATE_TIMEOUT}}" + ${debug_java_args:-${PRIVATE_JAVA_ARGS}} -Drobolectric.dependency.dir="${PRIVATE_ROBOLECTRIC_PATH}" -Drobolectric.offline=true -Drobolectric.logging=stdout diff --git a/run_robotests.mk b/run_robotests.mk index 0de53e948..cb8f5c81b 100644 --- a/run_robotests.mk +++ b/run_robotests.mk @@ -130,27 +130,6 @@ copy_android_all_jars := $(call copy-many-files, $(copy_android_all_jar_pairs)) $(my_target): $(copy_android_all_jars) -# Setting the DEBUG_ROBOLECTRIC environment variable will print additional logging from -# Robolectric and also make it wait for a debugger to be connected. -# For Android Studio / IntelliJ the debugger can be connected via the "remote" configuration: -# https://www.jetbrains.com/help/idea/2016.2/run-debug-configuration-remote.html -# From command line the debugger can be connected via -# jdb -attach localhost:5005 -ifdef DEBUG_ROBOLECTRIC - # The arguments to the JVM needed to debug the tests. - # - server: wait for connection rather than connecting to a debugger - # - transport: how to accept debugger connections (sockets) - # - address: the port on which to accept debugger connections - # - timeout: how long (in ms) to wait for a debugger to connect - # - suspend: do not start running any code until the debugger connects - my_java_args := \ - -Drobolectric.logging.enabled=true \ - -Xdebug -agentlib:jdwp=server=y,transport=dt_socket,address=localhost:5005,suspend=y - - # Remove the timeout so Robolectric doesn't get killed while debugging - my_timeout := 0 -endif - include $(my_robolectric_script_path)/robotest-internal.mk # clean local variables my_java_args := |