Add integration testing infrastructure
Fix mutator registration for tests to allow different tests in the same package to register different mutators. Allow tests to track the resulting ModuleBuildParams objects to use in assertions, and provide helpers for getting them. For example: config := android.TestConfig(buildDir) ctx := android.NewTestContext() ctx.RegisterModuleType(...) ctx.MockFileSystem(...) ctx.ParseBlueprintsFile("Android.bp") ctx.PrepareBuildActions(config) ctx.Register() // Get the Inputs value passed to the javac rule for the foo module inputs := ctx.ModuleForTests("foo".Rule("javac").Inputs Test: java_test.go Change-Id: I10c82967f5f3586d2c176f169906b571ed82fc73
This commit is contained in:
@@ -61,6 +61,15 @@ type PrebuiltInterface interface {
|
||||
Prebuilt() *Prebuilt
|
||||
}
|
||||
|
||||
func registerPrebuiltsPreArchMutators(ctx RegisterMutatorsContext) {
|
||||
ctx.BottomUp("prebuilts", prebuiltMutator).Parallel()
|
||||
}
|
||||
|
||||
func registerPrebuiltsPostDepsMutators(ctx RegisterMutatorsContext) {
|
||||
ctx.TopDown("prebuilt_select", PrebuiltSelectModuleMutator).Parallel()
|
||||
ctx.BottomUp("prebuilt_replace", PrebuiltReplaceMutator).Parallel()
|
||||
}
|
||||
|
||||
// prebuiltMutator ensures that there is always a module with an undecorated name, and marks
|
||||
// prebuilt modules that have both a prebuilt and a source module.
|
||||
func prebuiltMutator(ctx BottomUpMutatorContext) {
|
||||
|
Reference in New Issue
Block a user