aboutsummaryrefslogtreecommitdiffstats
path: root/genrule
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2017-03-16 16:50:10 -0700
committerColin Cross <ccross@android.com>2017-03-16 16:50:10 -0700
commit795c377e1450ad8e88deaaa5365ff1cc90c9f922 (patch)
tree08c3c008b105b615ee3bc03f0ccb1c7af1b7dc4f /genrule
parent4c48f724e1b339128447ab1dafd656a9557557f5 (diff)
downloadbuild_soong-795c377e1450ad8e88deaaa5365ff1cc90c9f922.tar.gz
build_soong-795c377e1450ad8e88deaaa5365ff1cc90c9f922.tar.bz2
build_soong-795c377e1450ad8e88deaaa5365ff1cc90c9f922.zip
Use a minimal set of mutators, module types, and singletons for tests
Calling android.NewContext() in tests results in a context that contains all the mutators, module types, and singletons, which causes unexpected interactions in unit tests. Create an empty context instead, and add in only the necessary mutators, module types, and singletons. Bug: 36366816 Test: soong tests Change-Id: Ic61262c37e3436b3ad4ccaca18b737021c304be6
Diffstat (limited to 'genrule')
-rw-r--r--genrule/filegroup.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/genrule/filegroup.go b/genrule/filegroup.go
index c1d08a82..71c54399 100644
--- a/genrule/filegroup.go
+++ b/genrule/filegroup.go
@@ -21,7 +21,7 @@ import (
)
func init() {
- android.RegisterModuleType("filegroup", fileGroupFactory)
+ android.RegisterModuleType("filegroup", FileGroupFactory)
}
type fileGroupProperties struct {
@@ -48,7 +48,7 @@ var _ android.SourceFileProducer = (*fileGroup)(nil)
// filegroup modules contain a list of files, and can be used to export files across package
// boundaries. filegroups (and genrules) can be referenced from srcs properties of other modules
// using the syntax ":module".
-func fileGroupFactory() (blueprint.Module, []interface{}) {
+func FileGroupFactory() (blueprint.Module, []interface{}) {
module := &fileGroup{}
return android.InitAndroidModule(module, &module.properties)