diff options
author | 2025-02-12 21:54:11 -0800 | |
---|---|---|
committer | 2025-02-12 21:54:11 -0800 | |
commit | 4a80748e09ff307c3052fbb36ac38880fd5d2340 (patch) | |
tree | 4d421d8fcaea1914cf782421676fbb0da48af277 /android/module_test.go | |
parent | c0a00df42e8f63caa3070c80a1e40db22bc574cc (diff) | |
parent | 90607e9056f6ff4cec2447fdd7a8b252d67ffde7 (diff) |
Merge "Don't panic in ModuleForTests and friends" into main
Diffstat (limited to 'android/module_test.go')
-rw-r--r-- | android/module_test.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/android/module_test.go b/android/module_test.go index 3b81dedc7..5331e4970 100644 --- a/android/module_test.go +++ b/android/module_test.go @@ -321,7 +321,7 @@ func TestInstall(t *testing.T) { if host { variant = result.Config.BuildOSCommonTarget.String() } - return result.ModuleForTests(name, variant) + return result.ModuleForTests(t, name, variant) } outputRule := func(name string) TestingBuildParams { return module(name, false).Output(name) } @@ -434,11 +434,12 @@ func TestInstallKatiEnabled(t *testing.T) { rules := result.InstallMakeRulesForTesting(t) module := func(name string, host bool) TestingModule { + t.Helper() variant := "android_common" if host { variant = result.Config.BuildOSCommonTarget.String() } - return result.ModuleForTests(name, variant) + return result.ModuleForTests(t, name, variant) } outputRule := func(name string) TestingBuildParams { return module(name, false).Output(name) } @@ -743,7 +744,7 @@ test { FixtureWithRootAndroidBp(tc.bp), ).RunTest(t) - foo := result.ModuleForTests("foo", "").Module().base() + foo := result.ModuleForTests(t, "foo", "").Module().base() AssertDeepEquals(t, "foo ", tc.expectedProps, foo.propertiesWithValues()) }) @@ -1078,7 +1079,7 @@ func TestOutputFileForModule(t *testing.T) { PathContext: PathContextForTesting(config), OtherModuleProviderContext: result.TestContext.OtherModuleProviderAdaptor(), } - got := OutputFileForModule(ctx, result.ModuleForTests("test_module", "").Module(), tt.tag) + got := OutputFileForModule(ctx, result.ModuleForTests(t, "test_module", "").Module(), tt.tag) AssertPathRelativeToTopEquals(t, "expected output path", tt.expected, got) AssertArrayString(t, "expected missing deps", tt.missingDeps, ctx.missingDeps) }) |