summaryrefslogtreecommitdiff
path: root/java/hiddenapi_singleton_test.go
diff options
context:
space:
mode:
author Colin Cross <ccross@android.com> 2025-02-12 22:16:51 -0800
committer Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2025-02-12 22:16:51 -0800
commit8ea2abcb0ff0f2e23391dbde621d62c0980138e7 (patch)
tree4d421d8fcaea1914cf782421676fbb0da48af277 /java/hiddenapi_singleton_test.go
parent421ced81177c558d9b03c958cc78493874e27a25 (diff)
parent4a80748e09ff307c3052fbb36ac38880fd5d2340 (diff)
Merge "Don't panic in ModuleForTests and friends" into main am: 4a80748e09
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3490133 Change-Id: I2057f531f5d40d61410ce97547d04b6840c4e800 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
Diffstat (limited to 'java/hiddenapi_singleton_test.go')
-rw-r--r--java/hiddenapi_singleton_test.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/java/hiddenapi_singleton_test.go b/java/hiddenapi_singleton_test.go
index c14fdb7bb..147f326c7 100644
--- a/java/hiddenapi_singleton_test.go
+++ b/java/hiddenapi_singleton_test.go
@@ -57,7 +57,7 @@ func TestHiddenAPISingleton(t *testing.T) {
}
`)
- hiddenAPI := result.ModuleForTests("platform-bootclasspath", "android_common")
+ hiddenAPI := result.ModuleForTests(t, "platform-bootclasspath", "android_common")
hiddenapiRule := hiddenAPI.Rule("platform-bootclasspath-monolithic-hiddenapi-stub-flags")
want := "--boot-dex=out/soong/.intermediates/foo/android_common/aligned/foo.jar"
android.AssertStringDoesContain(t, "hiddenapi command", hiddenapiRule.RuleParams.Command, want)
@@ -101,7 +101,7 @@ func TestHiddenAPISingletonWithPrebuilt(t *testing.T) {
}
`)
- hiddenAPI := result.ModuleForTests("platform-bootclasspath", "android_common")
+ hiddenAPI := result.ModuleForTests(t, "platform-bootclasspath", "android_common")
hiddenapiRule := hiddenAPI.Rule("platform-bootclasspath-monolithic-hiddenapi-stub-flags")
want := "--boot-dex=out/soong/.intermediates/foo/android_common/aligned/foo.jar"
android.AssertStringDoesContain(t, "hiddenapi command", hiddenapiRule.RuleParams.Command, want)
@@ -128,7 +128,7 @@ func TestHiddenAPISingletonWithPrebuiltUseSource(t *testing.T) {
}
`)
- hiddenAPI := result.ModuleForTests("platform-bootclasspath", "android_common")
+ hiddenAPI := result.ModuleForTests(t, "platform-bootclasspath", "android_common")
hiddenapiRule := hiddenAPI.Rule("platform-bootclasspath-monolithic-hiddenapi-stub-flags")
fromSourceJarArg := "--boot-dex=out/soong/.intermediates/foo/android_common/aligned/foo.jar"
android.AssertStringDoesContain(t, "hiddenapi command", hiddenapiRule.RuleParams.Command, fromSourceJarArg)
@@ -158,7 +158,7 @@ func TestHiddenAPISingletonWithPrebuiltOverrideSource(t *testing.T) {
}
`)
- hiddenAPI := result.ModuleForTests("platform-bootclasspath", "android_common")
+ hiddenAPI := result.ModuleForTests(t, "platform-bootclasspath", "android_common")
hiddenapiRule := hiddenAPI.Rule("platform-bootclasspath-monolithic-hiddenapi-stub-flags")
prebuiltJarArg := "--boot-dex=out/soong/.intermediates/prebuilt_foo/android_common/dex/foo.jar"
android.AssertStringDoesContain(t, "hiddenapi command", hiddenapiRule.RuleParams.Command, prebuiltJarArg)
@@ -219,7 +219,7 @@ func TestHiddenAPISingletonSdks(t *testing.T) {
}
`)
- hiddenAPI := result.ModuleForTests("platform-bootclasspath", "android_common")
+ hiddenAPI := result.ModuleForTests(t, "platform-bootclasspath", "android_common")
hiddenapiRule := hiddenAPI.Rule("platform-bootclasspath-monolithic-hiddenapi-stub-flags")
wantPublicStubs := "--public-stub-classpath=" + generateSdkDexPath(tc.publicStub, tc.unbundledBuild)
android.AssertStringDoesContain(t, "hiddenapi command", hiddenapiRule.RuleParams.Command, wantPublicStubs)
@@ -279,9 +279,9 @@ func TestHiddenAPISingletonWithPrebuiltCsvFile(t *testing.T) {
expectedCpOutput := "out/soong/hiddenapi/hiddenapi-flags.csv"
expectedFlagsCsv := "out/soong/hiddenapi/hiddenapi-flags.csv"
- foo := result.ModuleForTests("foo", "android_common")
+ foo := result.ModuleForTests(t, "foo", "android_common")
- hiddenAPI := result.SingletonForTests("hiddenapi")
+ hiddenAPI := result.SingletonForTests(t, "hiddenapi")
cpRule := hiddenAPI.Rule("Cp")
actualCpInput := cpRule.BuildParams.Input
actualCpOutput := cpRule.BuildParams.Output
@@ -318,7 +318,7 @@ func TestHiddenAPIEncoding_JavaSdkLibrary(t *testing.T) {
`)
checkDexEncoded := func(t *testing.T, name, unencodedDexJar, encodedDexJar string) {
- moduleForTests := result.ModuleForTests(name+".impl", "android_common")
+ moduleForTests := result.ModuleForTests(t, name+".impl", "android_common")
encodeDexRule := moduleForTests.Rule("hiddenAPIEncodeDex")
actualUnencodedDexJar := encodeDexRule.Input