aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2017-07-13 14:43:27 -0700
committerColin Cross <ccross@android.com>2017-07-14 14:19:51 -0700
commitcec8171420763a7a33f210be7bd45e22d3b38831 (patch)
tree090551693ef9bac520e6977cef72404d27153966 /cmd
parenteb54da6ebe8b0baf285be7d107c4cf959c3c462e (diff)
downloadbuild_soong-cec8171420763a7a33f210be7bd45e22d3b38831.tar.gz
build_soong-cec8171420763a7a33f210be7bd45e22d3b38831.tar.bz2
build_soong-cec8171420763a7a33f210be7bd45e22d3b38831.zip
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
Diffstat (limited to 'cmd')
-rw-r--r--cmd/soong_build/main.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/cmd/soong_build/main.go b/cmd/soong_build/main.go
index ed8f2fd5..e15a6bdd 100644
--- a/cmd/soong_build/main.go
+++ b/cmd/soong_build/main.go
@@ -32,6 +32,7 @@ func main() {
srcDir := filepath.Dir(flag.Arg(0))
ctx := android.NewContext()
+ ctx.Register()
configuration, err := android.NewConfig(srcDir, bootstrap.BuildDir)
if err != nil {
@@ -44,5 +45,5 @@ func main() {
ctx.SetAllowMissingDependencies(configuration.AllowMissingDependencies())
- bootstrap.Main(ctx, configuration, configuration.ConfigFileName, configuration.ProductVariablesFileName)
+ bootstrap.Main(ctx.Context, configuration, configuration.ConfigFileName, configuration.ProductVariablesFileName)
}