aboutsummaryrefslogtreecommitdiff
path: root/run_robolectric_module_tests.mk
diff options
context:
space:
mode:
authorJames Lemieux <jplemieux@google.com>2018-01-23 16:17:17 -0800
committerJames Lemieux <jplemieux@google.com>2018-01-26 17:08:41 -0800
commitb0d9a6c2cb434aba94ba4be1c694e53588ddc399 (patch)
tree49e813ce5e45fa3f2aaab8aa82b88e5512bae3d5 /run_robolectric_module_tests.mk
parent7cebe9a5d2d6746cbd821ff6bf347708249dd3d1 (diff)
downloadrobolectric-shadows-b0d9a6c2cb434aba94ba4be1c694e53588ddc399.tar.gz
Shadow ImageDecoder to preserve Bitmap loading
Bug: 72404581 Test: make -j56 Run_all_robolectric_tests Change-Id: I7f1342da35ca47618609e7dabaf72964b722f617
Diffstat (limited to 'run_robolectric_module_tests.mk')
-rw-r--r--run_robolectric_module_tests.mk19
1 files changed, 16 insertions, 3 deletions
diff --git a/run_robolectric_module_tests.mk b/run_robolectric_module_tests.mk
index 2cfa3869a..0526bdba5 100644
--- a/run_robolectric_module_tests.mk
+++ b/run_robolectric_module_tests.mk
@@ -48,9 +48,21 @@ copy_android_all_jar_pairs := \
$(p_android_all_source_jar):$(android_all_target_dir)/android-all-P-robolectric-r0.jar
copy_android_all_jars := $(call copy-many-files, $(copy_android_all_jar_pairs))
+# If debugging the tests was requested, set up the JVM parameters to enable it.
+debug_test_args :=
+ifdef debug_tests
+ # 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 host and port on which to accept debugger connections
+ # - suspend: do not start running any code until the debugger connects
+ debug_test_args := -Xdebug -agentlib:jdwp=server=y,transport=dt_socket,address=localhost:5005,suspend=y
+endif
+
# Snapshot the variables so they cannot be polluted before the module is built.
$(LOCAL_BUILT_MODULE): private_java := $(JAVA)
-$(LOCAL_BUILT_MODULE): private_working_directory := $(intermediates)
+$(LOCAL_BUILT_MODULE): private_debug_test_args := $(debug_test_args)
+$(LOCAL_BUILT_MODULE): private_test_base_dir := $(intermediates)
$(LOCAL_BUILT_MODULE): private_test_class_names := $(test_class_names)
$(LOCAL_BUILT_MODULE): private_host_jdk_tools_jar := $(HOST_JDK_TOOLS_JAR)
$(LOCAL_BUILT_MODULE): private_android_all_dir := $(android_all_target_dir)
@@ -63,7 +75,8 @@ $(LOCAL_BUILT_MODULE): $(copy_test_resource_files) $(copy_android_all_jars) $(cl
$(hide) $(private_java) \
-Drobolectric.offline=true \
-Drobolectric.dependency.dir=$(private_android_all_dir) \
- -Drobolectric-tests.base-dir=$(private_working_directory) \
- -cp $(private_host_jdk_tools_jar):$(private_working_directory):$(private_classpath_jars) \
+ -Drobolectric-tests.base-dir=$(private_test_base_dir) \
+ $(private_debug_test_args) \
+ -cp $(private_host_jdk_tools_jar):$(private_test_base_dir):$(private_classpath_jars) \
org.junit.runner.JUnitCore \
$(private_test_class_names) \ No newline at end of file