From 78335554384a1d88d89c91dbb419f8337ab78459 Mon Sep 17 00:00:00 2001 From: Googler Date: Wed, 23 May 2018 11:40:37 -0700 Subject: Enable test properties to be exported for robolectric tests. With this change, all classes in com.google.testing.junit.runner.util will be loaded from the system classloader for robolectric tests. This fixes a problem where TestPropertyExporter and TestIntegrationsRunnerIntegration in the com.google.testing.junit.runner.util package were being loaded twice: once by the test runner into the system classloader, and again into the robolectric's classloader during test execution. Since there were two separate instances, the test properties exported during robolectric's testing lifecycle were disconnected from the test runner which writes out the properties. RELNOTES: none PiperOrigin-RevId: 197761010 --- .../devtools/build/lib/bazel/rules/android/BazelAndroidLocalTest.java | 1 + 1 file changed, 1 insertion(+) (limited to 'src/main/java/com/google/devtools') diff --git a/src/main/java/com/google/devtools/build/lib/bazel/rules/android/BazelAndroidLocalTest.java b/src/main/java/com/google/devtools/build/lib/bazel/rules/android/BazelAndroidLocalTest.java index 79ca83c0c7..c191eb2661 100644 --- a/src/main/java/com/google/devtools/build/lib/bazel/rules/android/BazelAndroidLocalTest.java +++ b/src/main/java/com/google/devtools/build/lib/bazel/rules/android/BazelAndroidLocalTest.java @@ -65,6 +65,7 @@ public class BazelAndroidLocalTest extends AndroidLocalTestBase { .add( "-Drobolectric-deps.properties=" + androidAllJarsPropertiesFile.getRunfilesPathString()) .add("-Duse_framework_manifest_parser=true") + .add("-Dorg.robolectric.packagesToNotAcquire=com.google.testing.junit.runner.util") .build(); } -- cgit v1.2.3