aboutsummaryrefslogtreecommitdiffstats
path: root/cc/test.go
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2017-07-18 02:37:03 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2017-07-18 02:37:03 +0000
commitda4a7257b5b4c4fd41b8e8e084713e3e4f20187b (patch)
treec89ba348f35ef7d171689b919f59d78230e5e704 /cc/test.go
parentdddf50039a70eaefeec95bde0ed1ca6d528a1eb9 (diff)
parentb97e818201e0a2bab8491242d14236cd95d5c1ba (diff)
downloadbuild_soong-da4a7257b5b4c4fd41b8e8e084713e3e4f20187b.tar.gz
build_soong-da4a7257b5b4c4fd41b8e8e084713e3e4f20187b.tar.bz2
build_soong-da4a7257b5b4c4fd41b8e8e084713e3e4f20187b.zip
Merge "Add support for data field in cc_benchmark."android-o-preview-4
Diffstat (limited to 'cc/test.go')
-rw-r--r--cc/test.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/cc/test.go b/cc/test.go
index ea05ba5a..a52e94ac 100644
--- a/cc/test.go
+++ b/cc/test.go
@@ -298,6 +298,10 @@ func NewTestLibrary(hod android.HostOrDeviceSupported) *Module {
}
type BenchmarkProperties struct {
+ // list of files or filegroup modules that provide data that should be installed alongside
+ // the test
+ Data []string
+
// list of compatibility suites (for example "cts", "vts") that the module should be
// installed into.
Test_suites []string
@@ -306,6 +310,7 @@ type BenchmarkProperties struct {
type benchmarkDecorator struct {
*binaryDecorator
Properties BenchmarkProperties
+ data android.Paths
}
func (benchmark *benchmarkDecorator) linkerInit(ctx BaseModuleContext) {
@@ -324,12 +329,14 @@ func (benchmark *benchmarkDecorator) linkerProps() []interface{} {
}
func (benchmark *benchmarkDecorator) linkerDeps(ctx DepsContext, deps Deps) Deps {
+ android.ExtractSourcesDeps(ctx, benchmark.Properties.Data)
deps = benchmark.binaryDecorator.linkerDeps(ctx, deps)
deps.StaticLibs = append(deps.StaticLibs, "libgoogle-benchmark")
return deps
}
func (benchmark *benchmarkDecorator) install(ctx ModuleContext, file android.Path) {
+ benchmark.data = ctx.ExpandSources(benchmark.Properties.Data, nil)
benchmark.binaryDecorator.baseInstaller.dir = filepath.Join("nativetest", ctx.ModuleName())
benchmark.binaryDecorator.baseInstaller.dir64 = filepath.Join("nativetest64", ctx.ModuleName())
benchmark.binaryDecorator.baseInstaller.install(ctx, file)