Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c67528bf authored by Jiakai Zhang's avatar Jiakai Zhang Committed by Cherrypicker Worker
Browse files

Prepare tests for dexpreopt changes.

After this change, there is a clear separation between tests that are
related to dexpreopt and tests that are not. The former uses
PrepareForTestWithDexpreopt, while the latter uses
PrepareForTestWithJavaDefaultModules. The benefit is that the latter
will no longer affected by any dexpreopt changes.

Bug: 280776428
Test: m nothing
(cherry picked from https://android-review.googlesource.com/q/commit:b95998be731406209f18fab764b96421a17ab4c9)
Merged-In: Ib957765b9287d51c082e0a33cee17a6bb56daeef
Change-Id: Ib957765b9287d51c082e0a33cee17a6bb56daeef
parent bc9256b5
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -38,6 +38,7 @@ bootstrap_go_package {
        "apex_test.go",
        "bootclasspath_fragment_test.go",
        "classpath_element_test.go",
        "dexpreopt_bootjars_test.go",
        "metadata_test.go",
        "platform_bootclasspath_test.go",
        "systemserver_classpath_fragment_test.go",
+1 −1
Original line number Diff line number Diff line
@@ -146,7 +146,7 @@ var prepareForApexTest = android.GroupFixturePreparers(
	android.PrepareForTestWithAndroidBuildComponents,
	bpf.PrepareForTestWithBpf,
	cc.PrepareForTestWithCcBuildComponents,
	java.PrepareForTestWithJavaDefaultModules,
	java.PrepareForTestWithDexpreopt,
	prebuilt_etc.PrepareForTestWithPrebuiltEtc,
	rust.PrepareForTestWithRustDefaultModules,
	sh.PrepareForTestWithShBuildComponents,
+1 −1
Original line number Diff line number Diff line
@@ -1250,7 +1250,7 @@ func TestBootclasspathFragment_AndroidNonUpdatable(t *testing.T) {
func TestBootclasspathFragment_AndroidNonUpdatable_AlwaysUsePrebuiltSdks(t *testing.T) {
	result := android.GroupFixturePreparers(
		prepareForTestWithBootclasspathFragment,
		java.PrepareForTestWithJavaDefaultModules,
		java.PrepareForTestWithDexpreopt,
		prepareForTestWithArtApex,
		prepareForTestWithMyapex,
		// Configure bootclasspath jars to ensure that hidden API encoding is performed on them.
+6 −5
Original line number Diff line number Diff line
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package java
package apex

import (
	"path/filepath"
@@ -20,6 +20,7 @@ import (
	"testing"

	"android/soong/android"
	"android/soong/java"
)

func testDexpreoptBoot(t *testing.T, ruleFile string, expectedInputs, expectedOutputs []string) {
@@ -48,10 +49,10 @@ func testDexpreoptBoot(t *testing.T, ruleFile string, expectedInputs, expectedOu
	`

	result := android.GroupFixturePreparers(
		prepareForJavaTest,
		PrepareForTestWithJavaSdkLibraryFiles,
		FixtureWithLastReleaseApis("foo"),
		FixtureConfigureBootJars("platform:foo", "system_ext:bar", "platform:baz"),
		java.PrepareForTestWithDexpreopt,
		java.PrepareForTestWithJavaSdkLibraryFiles,
		java.FixtureWithLastReleaseApis("foo"),
		java.FixtureConfigureBootJars("platform:foo", "system_ext:bar", "platform:baz"),
	).RunTestWithBp(t, bp)

	platformBootclasspath := result.ModuleForTests("platform-bootclasspath", "android_common")
+1 −1
Original line number Diff line number Diff line
@@ -27,7 +27,7 @@ import (
func TestModulesSingleton(t *testing.T) {
	result := android.GroupFixturePreparers(
		PrepareForTestWithApexMultitreeSingleton,
		java.PrepareForTestWithDexpreopt,
		java.PrepareForTestWithJavaDefaultModules,
		PrepareForTestWithApexBuildComponents,
		java.FixtureConfigureApexBootJars("myapex:foo"),
		java.PrepareForTestWithJavaSdkLibraryFiles,
Loading