blob: f9c1e7a35f167b1e7a87ad9bb750cafa8f48ac7d [file] [log] [blame]
Wyatt Hepler0412a7d2020-01-28 16:27:32 -08001# Copyright 2020 The Pigweed Authors
Alexei Frolov1a82c142019-10-31 17:37:12 -07002#
3# Licensed under the Apache License, Version 2.0 (the "License"); you may not
4# use this file except in compliance with the License. You may obtain a copy of
5# the License at
6#
7# https://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, WITHOUT
11# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12# License for the specific language governing permissions and limitations under
13# the License.
14
Wyatt Hepleredf6f292019-11-25 18:52:21 -080015import("$dir_pw_unit_test/test.gni")
16
Armando Montanez04c56ae2019-12-12 14:34:05 -080017# By default, Pigweed will build this target when invoking ninja.
18group("default") {
Alexei Frolov799be5d2020-01-09 15:54:39 -080019 deps = []
20 if (defined(pw_is_docs_target) && pw_is_docs_target) {
21 deps += [ "$dir_pigweed/docs" ]
Keir Mierlee2f5d0f2019-12-16 11:36:22 -080022 } else {
Alexei Frolov799be5d2020-01-09 15:54:39 -080023 if (pw_automatic_test_runner == "") {
24 # Without a test runner defined, build the tests but don't run them.
25 deps += [ ":pw_module_tests" ]
26 } else {
27 # With a test runner, depend on the run targets so they run with the build.
28 deps += [ ":pw_module_tests_run" ]
29 }
Keir Mierlee2f5d0f2019-12-16 11:36:22 -080030 }
Alexei Frolovca9cf602019-12-26 13:00:03 -080031 if (pw_build_host_tools) {
32 deps += [ ":host_tools" ]
33 }
34}
35
36group("host_tools") {
37 deps = [
38 "$dir_pw_target_runner/go:simple_client",
39 "$dir_pw_target_runner/go:simple_server",
40 ]
Armando Montanez04c56ae2019-12-12 14:34:05 -080041}
42
43group("pw_facades") {
44 deps = [
Armando Montanez5104cd62019-12-10 14:36:43 -080045 "$dir_pw_cpu_exception",
Armando Montanezf7a5a742020-03-02 14:58:59 -080046 "$dir_pw_sys_io",
Armando Montanez04c56ae2019-12-12 14:34:05 -080047 ]
48}
49
50# All Pigweed modules that can be built using gn. This is not built by default.
Alexei Frolov1a82c142019-10-31 17:37:12 -070051group("pw_modules") {
52 deps = [
Alexei Frolov0efdb112019-11-14 17:22:08 -080053 "$dir_pigweed/docs",
Jamie Garside558e1442020-03-27 17:05:55 +000054 "$dir_pw_allocator",
Wyatt Heplerb8b01e32020-01-08 18:33:40 -080055 "$dir_pw_base64",
Wyatt Hepler92ccb662020-01-21 18:28:41 -080056 "$dir_pw_checksum",
Wyatt Heplerc542a5d2020-01-15 15:43:10 -080057 "$dir_pw_polyfill",
Alexei Frolovc10c8122019-11-01 16:31:19 -070058 "$dir_pw_preprocessor",
Alexei Frolovbbf164c2019-12-16 12:51:59 -080059 "$dir_pw_protobuf",
Alexei Frolov41b32d32019-11-13 17:22:03 -080060 "$dir_pw_result",
Wyatt Hepler77105652019-11-06 17:50:03 -080061 "$dir_pw_span",
Alexei Frolov1a82c142019-10-31 17:37:12 -070062 "$dir_pw_status",
Armando Montanez0bcae732020-05-27 13:28:11 -070063 "$dir_pw_stream",
Wyatt Hepler48db4d62019-11-11 10:32:45 -080064 "$dir_pw_string",
Alexei Frolovc10c8122019-11-01 16:31:19 -070065 "$dir_pw_unit_test",
Alexei Frolov82d3cb32019-11-27 14:38:39 -080066 "$dir_pw_varint",
Alexei Frolov1a82c142019-10-31 17:37:12 -070067 ]
Alexei Frolov8c4b7522020-01-31 11:15:57 -080068
Alexei Frolov8c4b7522020-01-31 11:15:57 -080069 if (host_os != "win") {
70 deps += [
Rob Mohr2156c0a2020-02-07 10:06:53 -080071 # TODO(frolv): Remove these two when new KVS is ready.
Alexei Frolov8c4b7522020-01-31 11:15:57 -080072 "$dir_pw_kvs",
73 "$dir_pw_minimal_cpp_stdlib",
Rob Mohra68755a2020-02-07 09:28:16 -080074
Rob Mohr2156c0a2020-02-07 10:06:53 -080075 # TODO(pwbug/111): Remove this when building successfully on Windows.
76 "$dir_pw_tokenizer",
77 ]
Alexei Frolov8c4b7522020-01-31 11:15:57 -080078 }
Alexei Frolov1a82c142019-10-31 17:37:12 -070079}
Alexei Frolov925fb8f2019-11-05 16:32:30 -080080
81# Targets for all module unit test groups.
Wyatt Hepleredf6f292019-11-25 18:52:21 -080082pw_test_group("pw_module_tests") {
83 group_deps = [
Jamie Garside558e1442020-03-27 17:05:55 +000084 "$dir_pw_allocator:tests",
Keir Mierle3cee8792020-01-22 17:08:13 -080085 "$dir_pw_assert:tests",
Wyatt Heplerb8b01e32020-01-08 18:33:40 -080086 "$dir_pw_base64:tests",
Wyatt Hepler92ccb662020-01-21 18:28:41 -080087 "$dir_pw_checksum:tests",
Wyatt Hepler76293e32020-02-07 18:07:19 -080088 "$dir_pw_containers:tests",
Aaron Greenf3c3d2b2020-04-02 23:12:31 -070089 "$dir_pw_fuzzer:tests",
Keir Mierleaf5e3582019-12-30 13:11:05 -080090 "$dir_pw_log:tests",
Wyatt Heplercb725c12020-05-01 11:05:01 -070091 "$dir_pw_log_tokenized:tests",
Wyatt Heplerc542a5d2020-01-15 15:43:10 -080092 "$dir_pw_polyfill:tests",
Alexei Frolova454c682019-11-19 10:55:07 -080093 "$dir_pw_preprocessor:tests",
Alexei Frolovbbf164c2019-12-16 12:51:59 -080094 "$dir_pw_protobuf:tests",
Alexei Frolovf39cd8b2020-04-13 17:59:20 -070095 "$dir_pw_protobuf_compiler:tests",
Alexei Frolov41b32d32019-11-13 17:22:03 -080096 "$dir_pw_result:tests",
Keir Mierle866cff42020-04-28 22:24:44 -070097 "$dir_pw_ring_buffer:tests",
Alexei Frolov26e3ae62020-05-04 17:06:17 -070098 "$dir_pw_rpc:tests",
Alexei Frolova454c682019-11-19 10:55:07 -080099 "$dir_pw_span:tests",
100 "$dir_pw_status:tests",
Armando Montanez0bcae732020-05-27 13:28:11 -0700101 "$dir_pw_stream:tests",
Alexei Frolova454c682019-11-19 10:55:07 -0800102 "$dir_pw_string:tests",
Armando Montanez870a86b2020-05-26 10:54:38 -0700103 "$dir_pw_tokenizer:tests",
Wyatt Heplerb3fca3a2020-01-03 12:14:00 -0800104 "$dir_pw_unit_test:tests",
Alexei Frolov82d3cb32019-11-27 14:38:39 -0800105 "$dir_pw_varint:tests",
Alexei Frolov925fb8f2019-11-05 16:32:30 -0800106 ]
Armando Montanez5104cd62019-12-10 14:36:43 -0800107
108 # TODO(pwbug/17): Re-think when Pigweed config system is added.
109 if (dir_pw_cpu_exception_backend == dir_pw_cpu_exception_armv7m) {
110 group_deps += [ "$dir_pw_cpu_exception_armv7m:tests" ]
111 }
Alexei Frolov8c4b7522020-01-31 11:15:57 -0800112
Armando Montanez870a86b2020-05-26 10:54:38 -0700113 if (pw_build_host_tools) {
114 # TODO(pwbug/196): KVS tests are not compatible with device builds as they
115 # use features such as std::map and are computationally expensive. Solving
116 # this requires a more complex capabilities-based build and configuration
117 # system which allowing enabling specific tests for targets that support
118 # them and modifying test parameters for different targets.
119 #
120 # Checking for pw_build_host_tools (which is only set by the host) is a
121 # temporary fix until the problem can be properly solved.
122 group_deps += [ "$dir_pw_kvs:tests" ]
123 }
124
Alexei Frolov8c4b7522020-01-31 11:15:57 -0800125 if (host_os != "win") {
Armando Montanez870a86b2020-05-26 10:54:38 -0700126 # TODO(amontanez): pw_minimal_cpp_stdlib tests do not build on windows.
127 group_deps += [ "$dir_pw_minimal_cpp_stdlib:tests" ]
Alexei Frolov8c4b7522020-01-31 11:15:57 -0800128 }
Alexei Frolov925fb8f2019-11-05 16:32:30 -0800129}