diff options
author | Paul Duffin <paulduffin@google.com> | 2021-03-30 22:45:21 +0100 |
---|---|---|
committer | Paul Duffin <paulduffin@google.com> | 2021-03-30 22:45:21 +0100 |
commit | 9e0c3f9993cb9545f6bd5fe22e8046564f771176 (patch) | |
tree | 1067682e8e8003f27eb6480b423ca34e24f2402c /rust/testing.go | |
parent | dd3797b44eb9065d77069e51d2231385958897ee (diff) |
Convert remaining rust tests to use test fixtures
Removes now unused CreateTestContext and stops exporting the
RegisterRequiredBuildComponentsForTest() method as it is only used
locally.
Bug: 181070625
Test: m nothing
Change-Id: Ia2fd3e090f975ee4c807da2c6c162ef3cf7ac446
Diffstat (limited to 'rust/testing.go')
-rw-r--r-- | rust/testing.go | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/rust/testing.go b/rust/testing.go index 5be71c90e..75adcfce9 100644 --- a/rust/testing.go +++ b/rust/testing.go @@ -17,13 +17,12 @@ package rust import ( "android/soong/android" "android/soong/cc" - "android/soong/genrule" ) // Preparer that will define all cc module types and a limited set of mutators and singletons that // make those module types usable. var PrepareForTestWithRustBuildComponents = android.GroupFixturePreparers( - android.FixtureRegisterWithContext(RegisterRequiredBuildComponentsForTest), + android.FixtureRegisterWithContext(registerRequiredBuildComponentsForTest), ) // The directory in which rust test default modules will be defined. @@ -197,7 +196,7 @@ func GatherRequiredDepsForTest() string { return bp } -func RegisterRequiredBuildComponentsForTest(ctx android.RegistrationContext) { +func registerRequiredBuildComponentsForTest(ctx android.RegistrationContext) { ctx.RegisterModuleType("rust_binary", RustBinaryFactory) ctx.RegisterModuleType("rust_binary_host", RustBinaryHostFactory) ctx.RegisterModuleType("rust_bindgen", RustBindgenFactory) @@ -231,14 +230,3 @@ func RegisterRequiredBuildComponentsForTest(ctx android.RegistrationContext) { }) ctx.RegisterSingletonType("rust_project_generator", rustProjectGeneratorSingleton) } - -func CreateTestContext(config android.Config) *android.TestContext { - ctx := android.NewTestArchContext(config) - android.RegisterPrebuiltMutators(ctx) - ctx.PreArchMutators(android.RegisterDefaultsPreArchMutators) - genrule.RegisterGenruleBuildComponents(ctx) - cc.RegisterRequiredBuildComponentsForTest(ctx) - RegisterRequiredBuildComponentsForTest(ctx) - - return ctx -} |