diff options
author | 2017-06-30 17:44:21 +0200 | |
---|---|---|
committer | 2017-07-03 09:06:23 +0200 | |
commit | cbee79a2b742886d950d271db59ddfa6c903e0bf (patch) | |
tree | 721a68ff1585b0f8a8bc9e7ece79740911126cf1 /src/test/java/com/google/devtools/build/lib/skyframe | |
parent | c2517916ff5140ca7c9b1515d4f0f6797a498e87 (diff) |
Enable incremental dexing by default.
Fixes https://github.com/bazelbuild/bazel/issues/3045.
RELNOTES: Enable --incremental_dexing for Android builds by default. Note that some dexopts are incompatible with incremental dexing, including --force-jumbo.
PiperOrigin-RevId: 160650101
Diffstat (limited to 'src/test/java/com/google/devtools/build/lib/skyframe')
-rw-r--r-- | src/test/java/com/google/devtools/build/lib/skyframe/ConfigurationsForTargetsTest.java | 66 |
1 files changed, 34 insertions, 32 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/skyframe/ConfigurationsForTargetsTest.java b/src/test/java/com/google/devtools/build/lib/skyframe/ConfigurationsForTargetsTest.java index fa102db528..e8649a71f8 100644 --- a/src/test/java/com/google/devtools/build/lib/skyframe/ConfigurationsForTargetsTest.java +++ b/src/test/java/com/google/devtools/build/lib/skyframe/ConfigurationsForTargetsTest.java @@ -287,38 +287,6 @@ public class ConfigurationsForTargetsTest extends AnalysisTestCase { assertThat(toolDep.getConfiguration().isHostConfiguration()).isTrue(); } - @Test - public void splitDeps() throws Exception { - scratch.file( - "java/a/BUILD", - "cc_library(name = 'lib', srcs = ['lib.cc'])", - "android_binary(name='a', manifest = 'AndroidManifest.xml', deps = [':lib'])"); - useConfiguration("--fat_apk_cpu=k8,armeabi-v7a"); - List<ConfiguredTarget> deps = getConfiguredDeps("//java/a:a", "deps"); - assertThat(deps).hasSize(2); - ConfiguredTarget dep1 = deps.get(0); - ConfiguredTarget dep2 = deps.get(1); - assertThat( - ImmutableList.<String>of( - dep1.getConfiguration().getCpu(), - dep2.getConfiguration().getCpu())) - .containsExactly("armeabi-v7a", "k8"); - // We don't care what order split deps are listed, but it must be deterministic. Static and - // dynamic configurations happen to apply different orders (static: same order as the split - // transition definition, dynamic: ConfiguredTargetFunction.DYNAMIC_SPLIT_DEP_ORDERING). That's - // okay because of the "we don't care what order" principle. The primary value of this test is - // to check against the new dynamic code, which will soon replace the static code anyway. And - // the static code is already well-tested through all other Blaze tests. And checking its order - // would be a lot uglier. So we only worry about the dynamic case here. - if (getTargetConfiguration().useDynamicConfigurations()) { - assertThat( - ConfiguredTargetFunction.DYNAMIC_SPLIT_DEP_ORDERING.compare( - Dependency.withConfiguration(dep1.getLabel(), dep1.getConfiguration()), - Dependency.withConfiguration(dep2.getLabel(), dep2.getConfiguration()))) - .isLessThan(0); - } - } - /** Runs the same test with untrimmed dynamic configurations. */ @TestSpec(size = Suite.SMALL_TESTS) @RunWith(JUnit4.class) @@ -327,5 +295,39 @@ public class ConfigurationsForTargetsTest extends AnalysisTestCase { protected FlagBuilder defaultFlags() { return super.defaultFlags().with(Flag.DYNAMIC_CONFIGURATIONS_NOTRIM); } + + // This test does not pass with trimming because android_binary applies an aspect and aspects + // are not yet correctly supported with trimming. + @Test + public void splitDeps() throws Exception { + scratch.file( + "java/a/BUILD", + "cc_library(name = 'lib', srcs = ['lib.cc'])", + "android_binary(name='a', manifest = 'AndroidManifest.xml', deps = [':lib'])"); + useConfiguration("--fat_apk_cpu=k8,armeabi-v7a"); + List<ConfiguredTarget> deps = getConfiguredDeps("//java/a:a", "deps"); + assertThat(deps).hasSize(2); + ConfiguredTarget dep1 = deps.get(0); + ConfiguredTarget dep2 = deps.get(1); + assertThat( + ImmutableList.<String>of( + dep1.getConfiguration().getCpu(), + dep2.getConfiguration().getCpu())) + .containsExactly("armeabi-v7a", "k8"); + // We don't care what order split deps are listed, but it must be deterministic. Static and + // dynamic configurations happen to apply different orders (static: same order as the split + // transition definition, dynamic: ConfiguredTargetFunction.DYNAMIC_SPLIT_DEP_ORDERING). + // That's okay because of the "we don't care what order" principle. The primary value of this + // test is to check against the new dynamic code, which will soon replace the static code + // anyway. And the static code is already well-tested through all other Blaze tests. And + // checking its order would be a lot uglier. So we only worry about the dynamic case here. + if (getTargetConfiguration().useDynamicConfigurations()) { + assertThat( + ConfiguredTargetFunction.DYNAMIC_SPLIT_DEP_ORDERING.compare( + Dependency.withConfiguration(dep1.getLabel(), dep1.getConfiguration()), + Dependency.withConfiguration(dep2.getLabel(), dep2.getConfiguration()))) + .isLessThan(0); + } + } } } |