From 8eb4573b232accd19c9cd3b9d1b99572d4fe2c16 Mon Sep 17 00:00:00 2001 From: Paul Duffin Date: Tue, 4 Oct 2022 19:03:31 +0100 Subject: Test bootImageConfig/Variant fields Most of the fields in the bootImageConfig/Variant structs are assigned inside a Once func so are guaranteed to be only set once. However, some are assigned outside. This change adds comprehensive tests for those structs and verifies that the constant fields are preserved and the mutated fields have the correct value. The check for the constant fields is added in a new TestBootImageConfig test. The check for the mutated fields is added into TestSnapshotWithBootclasspathFragment_ImageName as that test checks an art bootclasspath_fragment in the following configurations: * source on its own * prebuilt on its own * source and prebuilt with source preferred * source and prebuilt with prebuilt It reveals a couple of interesting facts: * All the *installs fields are set to the same value irrespective of whether the source or prebuilt is preferred. The information is constructed solely from information already within the bootImageConfig/Variant and so can be moved within Once. * The licenseMetadataFile is incorrect when prebuilt is preferred. That is due to both the source and prebuilt modules setting it and the source module always wins as the source module depends on the prebuilt so always runs its GenerateAndroidBuildActions after it. Those issues will be cleaned up in following changes. Bug: 245956352 Test: m nothing Change-Id: If917cfbcb3b1c842a8682d51cc1ee1fed1c51add --- java/testing.go | 1 + 1 file changed, 1 insertion(+) (limited to 'java/testing.go') diff --git a/java/testing.go b/java/testing.go index 1f411913b..49430ee05 100644 --- a/java/testing.go +++ b/java/testing.go @@ -393,6 +393,7 @@ func gatherRequiredDepsForTest() string { aidl: { export_include_dirs: ["framework/aidl"], }, + compile_dex: true, } android_app { -- cgit v1.2.3-59-g8ed1b