Alexei Frolov | c10c812 | 2019-11-01 16:31:19 -0700 | [diff] [blame] | 1 | # Copyright 2019 The Pigweed Authors |
| 2 | # |
| 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 | |
Armando Montanez | fb3d3fb | 2020-06-09 18:12:12 -0700 | [diff] [blame] | 15 | # gn-format disable |
| 16 | import("//build_overrides/pigweed.gni") |
| 17 | |
Alexei Frolov | edd2f14 | 2020-06-09 19:11:27 -0700 | [diff] [blame] | 18 | import("$dir_pw_build/target_types.gni") |
Alexei Frolov | ea39552 | 2020-03-13 13:35:07 -0700 | [diff] [blame] | 19 | import("$dir_pw_docgen/docs.gni") |
Wyatt Hepler | b3fca3a | 2020-01-03 12:14:00 -0800 | [diff] [blame] | 20 | import("$dir_pw_unit_test/test.gni") |
Alexei Frolov | c10c812 | 2019-11-01 16:31:19 -0700 | [diff] [blame] | 21 | config("default_config") { |
Alexei Frolov | 802c6e4 | 2019-12-17 15:24:35 -0800 | [diff] [blame] | 22 | include_dirs = [ |
| 23 | "public", |
| 24 | "public_overrides", |
| 25 | ] |
Alexei Frolov | c10c812 | 2019-11-01 16:31:19 -0700 | [diff] [blame] | 26 | } |
| 27 | |
| 28 | # pw_unit_test core library. |
Alexei Frolov | edd2f14 | 2020-06-09 19:11:27 -0700 | [diff] [blame] | 29 | pw_source_set("pw_unit_test") { |
Wyatt Hepler | 2119240 | 2020-01-15 15:40:51 -0800 | [diff] [blame] | 30 | public_configs = [ ":default_config" ] |
Alexei Frolov | c10c812 | 2019-11-01 16:31:19 -0700 | [diff] [blame] | 31 | public_deps = [ |
Wyatt Hepler | a55d4c7 | 2020-01-16 10:26:04 -0800 | [diff] [blame] | 32 | "$dir_pw_polyfill", |
Alexei Frolov | c10c812 | 2019-11-01 16:31:19 -0700 | [diff] [blame] | 33 | "$dir_pw_preprocessor", |
Wyatt Hepler | 8663e9c | 2019-11-20 13:58:29 -0800 | [diff] [blame] | 34 | "$dir_pw_string", |
Alexei Frolov | c10c812 | 2019-11-01 16:31:19 -0700 | [diff] [blame] | 35 | ] |
| 36 | public = [ |
Alexei Frolov | c10c812 | 2019-11-01 16:31:19 -0700 | [diff] [blame] | 37 | "public/pw_unit_test/event_handler.h", |
| 38 | "public/pw_unit_test/framework.h", |
Alexei Frolov | 802c6e4 | 2019-12-17 15:24:35 -0800 | [diff] [blame] | 39 | "public_overrides/gtest/gtest.h", |
Alexei Frolov | c10c812 | 2019-11-01 16:31:19 -0700 | [diff] [blame] | 40 | ] |
| 41 | sources = [ "framework.cc" ] + public |
| 42 | } |
| 43 | |
| 44 | # Library providing an event handler which outputs human-readable text. |
Alexei Frolov | edd2f14 | 2020-06-09 19:11:27 -0700 | [diff] [blame] | 45 | pw_source_set("simple_printing_event_handler") { |
Alexei Frolov | c10c812 | 2019-11-01 16:31:19 -0700 | [diff] [blame] | 46 | public_deps = [ |
| 47 | ":pw_unit_test", |
| 48 | "$dir_pw_preprocessor", |
| 49 | ] |
Rob Mohr | a0ba54f | 2020-02-27 11:43:49 -0800 | [diff] [blame] | 50 | public = [ "public/pw_unit_test/simple_printing_event_handler.h" ] |
Alexei Frolov | c10c812 | 2019-11-01 16:31:19 -0700 | [diff] [blame] | 51 | sources = [ "simple_printing_event_handler.cc" ] + public |
| 52 | } |
| 53 | |
| 54 | # Library providing a standard desktop main function for the pw_unit_test |
| 55 | # framework. Unit test files can link against this library to build runnable |
| 56 | # unit test executables. |
Alexei Frolov | edd2f14 | 2020-06-09 19:11:27 -0700 | [diff] [blame] | 57 | pw_source_set("simple_printing_main") { |
Rob Mohr | a0ba54f | 2020-02-27 11:43:49 -0800 | [diff] [blame] | 58 | public_deps = [ ":pw_unit_test" ] |
Alexei Frolov | c10c812 | 2019-11-01 16:31:19 -0700 | [diff] [blame] | 59 | deps = [ |
| 60 | ":simple_printing_event_handler", |
Armando Montanez | f7a5a74 | 2020-03-02 14:58:59 -0800 | [diff] [blame] | 61 | "$dir_pw_sys_io", |
Alexei Frolov | c10c812 | 2019-11-01 16:31:19 -0700 | [diff] [blame] | 62 | ] |
Rob Mohr | a0ba54f | 2020-02-27 11:43:49 -0800 | [diff] [blame] | 63 | sources = [ "simple_printing_main.cc" ] |
Alexei Frolov | c10c812 | 2019-11-01 16:31:19 -0700 | [diff] [blame] | 64 | } |
| 65 | |
Alexei Frolov | ea39552 | 2020-03-13 13:35:07 -0700 | [diff] [blame] | 66 | pw_doc_group("docs") { |
| 67 | sources = [ "docs.rst" ] |
| 68 | } |
| 69 | |
Keir Mierle | da0bccb | 2020-01-17 13:51:35 -0800 | [diff] [blame] | 70 | # Library providing an event handler which logs using pw_log. |
Alexei Frolov | 4c0428a | 2020-06-10 10:46:04 -0700 | [diff] [blame] | 71 | pw_source_set("logging_event_handler") { |
| 72 | public_deps = [ |
| 73 | ":pw_unit_test", |
| 74 | "$dir_pw_log", |
| 75 | "$dir_pw_preprocessor", |
| 76 | ] |
| 77 | public = [ "public/pw_unit_test/logging_event_handler.h" ] |
| 78 | sources = [ "logging_event_handler.cc" ] + public |
| 79 | } |
Keir Mierle | da0bccb | 2020-01-17 13:51:35 -0800 | [diff] [blame] | 80 | |
Alexei Frolov | 4c0428a | 2020-06-10 10:46:04 -0700 | [diff] [blame] | 81 | pw_source_set("logging_main") { |
| 82 | public_deps = [ ":pw_unit_test" ] |
| 83 | deps = [ |
| 84 | ":logging_event_handler", |
| 85 | "$dir_pw_sys_io", |
| 86 | ] |
| 87 | sources = [ "logging_main.cc" ] |
Keir Mierle | da0bccb | 2020-01-17 13:51:35 -0800 | [diff] [blame] | 88 | } |
| 89 | |
Wyatt Hepler | b3fca3a | 2020-01-03 12:14:00 -0800 | [diff] [blame] | 90 | pw_test("framework_test") { |
Rob Mohr | a0ba54f | 2020-02-27 11:43:49 -0800 | [diff] [blame] | 91 | sources = [ "framework_test.cc" ] |
Alexei Frolov | c10c812 | 2019-11-01 16:31:19 -0700 | [diff] [blame] | 92 | } |
Wyatt Hepler | b3fca3a | 2020-01-03 12:14:00 -0800 | [diff] [blame] | 93 | |
| 94 | pw_test_group("tests") { |
| 95 | tests = [ ":framework_test" ] |
| 96 | } |