Merge "Add an isolated option for cc_test targets."

am: 946492f005

Change-Id: Ida02678de02acfe1f619217e814b2d99ac5c035d
This commit is contained in:
Christopher Ferris
2018-10-01 16:37:02 -07:00
committed by android-build-merger

View File

@@ -26,6 +26,9 @@ import (
type TestProperties struct {
// if set, build against the gtest library. Defaults to true.
Gtest *bool
// if set, use the isolated gtest runner. Defaults to false.
Isolated *bool
}
type TestBinaryProperties struct {
@@ -168,6 +171,8 @@ func (test *testDecorator) linkerDeps(ctx BaseModuleContext, deps Deps) Deps {
if test.gtest() {
if ctx.useSdk() && ctx.Device() {
deps.StaticLibs = append(deps.StaticLibs, "libgtest_main_ndk_c++", "libgtest_ndk_c++")
} else if BoolDefault(test.Properties.Isolated, false) {
deps.StaticLibs = append(deps.StaticLibs, "libgtest_isolated_main")
} else {
deps.StaticLibs = append(deps.StaticLibs, "libgtest_main", "libgtest")
}