From 9df92d6438fb64b0ad9949f299cbc625826046ee Mon Sep 17 00:00:00 2001 From: Christopher Ferris Date: Tue, 21 Aug 2018 12:40:08 -0700 Subject: [PATCH] Add an isolated option for cc_test targets. Test: Built a test using the isolated flag. Change-Id: I0fe51437a66e03dbfb4ffcfd3a04af094388c6bc --- cc/test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cc/test.go b/cc/test.go index 3fffffcd3..96049db8d 100644 --- a/cc/test.go +++ b/cc/test.go @@ -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") }