aboutsummaryrefslogtreecommitdiffstats
path: root/bootstrap/command.go
diff options
context:
space:
mode:
authorDan Willemsen <dwillemsen@google.com>2015-06-23 17:21:00 -0700
committerDan Willemsen <dwillemsen@google.com>2015-06-25 11:45:54 -0700
commit87ba294ceb0b7aae8349d567931c85511d588b9b (patch)
treeaa9adff3d8d16915091b138d41e21d62a9dcad9f /bootstrap/command.go
parent30a80c3e5fd67a394094efd93ec878a260f508f1 (diff)
downloadandroid_build_blueprint-87ba294ceb0b7aae8349d567931c85511d588b9b.tar.gz
android_build_blueprint-87ba294ceb0b7aae8349d567931c85511d588b9b.tar.bz2
android_build_blueprint-87ba294ceb0b7aae8349d567931c85511d588b9b.zip
Add option to build and run tests during bootstrap
Users that want to enable this option can use the '-t' option to bootstrap.bash when passing '-r'. Builders that want to enable this can set the RUN_TESTS environment variable in their bootstrap.bash. The gotestmain tools is needed to write the main functions for the test binaries, since 'go test' doesn't work well in this environment. Change-Id: Iec5c2b5c9c3f5e3ba0ac8677fb88f5e963f9bd3f
Diffstat (limited to 'bootstrap/command.go')
-rw-r--r--bootstrap/command.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/bootstrap/command.go b/bootstrap/command.go
index 354a692..207d56e 100644
--- a/bootstrap/command.go
+++ b/bootstrap/command.go
@@ -34,6 +34,7 @@ var (
checkFile string
manifestFile string
cpuprofile string
+ runGoTests bool
)
func init() {
@@ -42,6 +43,7 @@ func init() {
flag.StringVar(&checkFile, "c", "", "the existing file to check against")
flag.StringVar(&manifestFile, "m", "", "the bootstrap manifest file")
flag.StringVar(&cpuprofile, "cpuprofile", "", "write cpu profile to file")
+ flag.BoolVar(&runGoTests, "t", false, "build and run go tests during bootstrap")
}
func Main(ctx *blueprint.Context, config interface{}, extraNinjaFileDeps ...string) {
@@ -73,6 +75,7 @@ func Main(ctx *blueprint.Context, config interface{}, extraNinjaFileDeps ...stri
bootstrapConfig := &Config{
generatingBootstrapper: generatingBootstrapper,
topLevelBlueprintsFile: flag.Arg(0),
+ runGoTests: runGoTests,
}
ctx.RegisterModuleType("bootstrap_go_package", newGoPackageModuleFactory(bootstrapConfig))