blob: 72e9c4a471777c327c7d27d8a35233212d011ec3 [file] [log] [blame]
Lalit Maganti79f2d7b2018-01-23 18:27:33 +00001# Copyright (C) 2018 The Android Open Source Project
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
Florian Mayer60d1e132018-01-26 15:00:52 +000015import("../gn/perfetto.gni")
Lalit Maganti79f2d7b2018-01-23 18:27:33 +000016import("//build_overrides/build.gni")
17
Florian Mayer94aaf692018-01-29 16:29:02 +000018# For use_libfuzzer.
19if (!build_with_chromium) {
20 import("//gn/standalone/sanitizers/vars.gni")
21} else {
22 import("//build/config/sanitizers/sanitizers.gni")
23}
24
Lalit Maganti79f2d7b2018-01-23 18:27:33 +000025source_set("end_to_end_integrationtests") {
26 testonly = true
27 deps = [
Florian Mayerc7255fd2018-01-25 10:29:24 +000028 ":task_runner_thread",
Lalit Maganti3f5705c2018-03-09 12:09:44 +000029 ":task_runner_thread_delegates",
Lalit Magantic4c3ceb2018-03-29 20:38:13 +010030 ":test_helper",
Lalit Maganti79f2d7b2018-01-23 18:27:33 +000031 "../gn:default_deps",
32 "../gn:gtest_deps",
33 "../protos/perfetto/trace:lite",
34 "../src/base:base",
35 "../src/base:test_support",
Lalit Maganti79f2d7b2018-01-23 18:27:33 +000036 ]
37 sources = [
38 "end_to_end_integrationtest.cc",
Lalit Maganti79f2d7b2018-01-23 18:27:33 +000039 ]
40 if (is_android && !build_with_chromium) {
41 deps += [ "../src/base:android_task_runner" ]
42 }
Lalit Magantid0e76792018-02-12 14:25:01 +000043 if (start_daemons_for_testing) {
44 cflags = [ "-DPERFETTO_START_DAEMONS_FOR_TESTING" ]
45 }
Lalit Maganti79f2d7b2018-01-23 18:27:33 +000046}
Florian Mayerc7255fd2018-01-25 10:29:24 +000047
Florian Mayer60d1e132018-01-26 15:00:52 +000048if (use_libfuzzer) {
49 executable("end_to_end_shared_memory_fuzzer") {
50 sources = [
51 "end_to_end_shared_memory_fuzzer.cc",
52 ]
53 testonly = true
54 deps = [
Florian Mayer60d1e132018-01-26 15:00:52 +000055 ":task_runner_thread",
Lalit Magantibfc3d3e2018-03-22 20:28:38 +000056 ":task_runner_thread_delegates",
Lalit Magantic4c3ceb2018-03-29 20:38:13 +010057 ":test_helper",
Florian Mayer60d1e132018-01-26 15:00:52 +000058 "../gn:default_deps",
59 "../src/base:test_support",
60 "../src/protozero",
61 "../src/tracing",
62 "../src/tracing:ipc",
63 ]
64 configs += [ "../gn:fuzzer_config" ]
65 }
66}
67
Florian Mayerc7255fd2018-01-25 10:29:24 +000068source_set("task_runner_thread") {
69 testonly = true
70 deps = [
71 "../gn:default_deps",
Florian Mayerd8bd81b2018-01-25 12:49:15 +000072 "../src/base:test_support",
Florian Mayerc7255fd2018-01-25 10:29:24 +000073 ]
74 sources = [
75 "task_runner_thread.cc",
76 "task_runner_thread.h",
77 ]
78}
Hector Dearmanbc8368e2018-01-25 17:34:11 +000079
Lalit Maganti3f5705c2018-03-09 12:09:44 +000080source_set("task_runner_thread_delegates") {
81 testonly = true
82 deps = [
83 ":task_runner_thread",
84 "../gn:default_deps",
85 "../src/base:test_support",
86 "../src/traced/probes:probes_src",
87 "../src/tracing:ipc",
88 ]
89 sources = [
90 "fake_producer.cc",
91 "fake_producer.h",
92 "task_runner_thread_delegates.h",
93 ]
94}
95
Lalit Magantic4c3ceb2018-03-29 20:38:13 +010096source_set("test_helper") {
97 testonly = true
Florian Mayerc29e0d32018-04-04 15:55:46 +010098 public_deps = [
99 "../src/tracing:ipc",
100 ]
Lalit Magantic4c3ceb2018-03-29 20:38:13 +0100101 deps = [
102 ":task_runner_thread",
103 ":task_runner_thread_delegates",
104 "../gn:default_deps",
105 "../protos/perfetto/trace:lite",
106 "../src/base:test_support",
107 ]
108 sources = [
109 "test_helper.cc",
110 "test_helper.h",
111 ]
112 if (start_daemons_for_testing) {
113 cflags = [ "-DPERFETTO_START_DAEMONS_FOR_TESTING" ]
114 }
115}
116
Hector Dearmanbc8368e2018-01-25 17:34:11 +0000117if (!build_with_chromium) {
Lalit Magantibfc3d3e2018-03-22 20:28:38 +0000118 source_set("end_to_end_benchmarks") {
119 testonly = true
120 deps = [
Lalit Magantibfc3d3e2018-03-22 20:28:38 +0000121 ":task_runner_thread",
122 ":task_runner_thread_delegates",
Lalit Magantic4c3ceb2018-03-29 20:38:13 +0100123 ":test_helper",
Lalit Magantibfc3d3e2018-03-22 20:28:38 +0000124 "../../gn:default_deps",
125 "../gn:gtest_deps",
126 "../protos/perfetto/trace:lite",
127 "../protos/perfetto/trace:zero",
128 "../src/base:test_support",
129 "//buildtools:benchmark",
130 ]
131 sources = [
132 "end_to_end_benchmark.cc",
133 ]
134 if (is_android && !build_with_chromium) {
135 deps += [ "../src/base:android_task_runner" ]
136 }
137 if (start_daemons_for_testing) {
138 cflags = [ "-DPERFETTO_START_DAEMONS_FOR_TESTING" ]
139 }
140 }
141
Hector Dearmanbc8368e2018-01-25 17:34:11 +0000142 source_set("benchmark_main") {
143 testonly = true
144 deps = [
145 "../../gn:default_deps",
146 "//buildtools:benchmark",
147 ]
148 sources = [
149 "benchmark_main.cc",
150 ]
151 }
152}