Keir Mierle | 3cee879 | 2020-01-22 17:08:13 -0800 | [diff] [blame] | 1 | # Copyright 2020 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 | |
| 15 | import("$dir_pw_build/facade.gni") |
| 16 | import("$dir_pw_docgen/docs.gni") |
| 17 | import("$dir_pw_unit_test/test.gni") |
| 18 | |
| 19 | config("default_config") { |
| 20 | include_dirs = [ "public" ] |
| 21 | } |
| 22 | |
| 23 | pw_facade("pw_assert") { |
| 24 | backend = dir_pw_assert_backend |
| 25 | public_configs = [ ":default_config" ] |
Keir Mierle | d1211ed | 2020-04-03 13:20:46 -0700 | [diff] [blame] | 26 | public = [ |
| 27 | "public/pw_assert/assert.h", |
| 28 | "public/pw_assert/internal/assert_impl.h", |
| 29 | ] |
Rob Mohr | a0ba54f | 2020-02-27 11:43:49 -0800 | [diff] [blame] | 30 | public_deps = [ dir_pw_preprocessor ] |
Keir Mierle | 3cee879 | 2020-01-22 17:08:13 -0800 | [diff] [blame] | 31 | } |
| 32 | |
| 33 | pw_test_group("tests") { |
Armando Montanez | ceb66f5 | 2020-06-04 12:56:38 -0700 | [diff] [blame] | 34 | tests = [ |
| 35 | ":assert_backend_compile_test", |
| 36 | ":assert_facade_test", |
| 37 | ] |
Keir Mierle | 3cee879 | 2020-01-22 17:08:13 -0800 | [diff] [blame] | 38 | } |
| 39 | |
Keir Mierle | 8d2a84f | 2020-04-14 22:00:00 -0700 | [diff] [blame] | 40 | # The assert facade test doesn't require a backend since a fake one is |
| 41 | # provided. However, since this doesn't depend on the backend it re-includes |
| 42 | # the facade headers. |
| 43 | pw_test("assert_facade_test") { |
| 44 | configs = [ ":default_config" ] # For internal/assert_impl.h |
| 45 | sources = [ |
| 46 | "assert_facade_test.cc", |
| 47 | "fake_backend.cc", |
| 48 | "public/pw_assert/internal/assert_impl.h", |
| 49 | "pw_assert_test/fake_backend.h", |
| 50 | ] |
Keir Mierle | 0fa7f7d | 2020-05-07 12:34:00 -0700 | [diff] [blame] | 51 | deps = [ dir_pw_status ] |
Alexei Frolov | 844ff0f | 2020-05-06 12:15:29 -0700 | [diff] [blame^] | 52 | |
| 53 | # TODO(frolv): Fix this test on the QEMU target. |
| 54 | enable_if = pw_executable_config.target_type != "lm3s6965evb_executable" |
Keir Mierle | 8d2a84f | 2020-04-14 22:00:00 -0700 | [diff] [blame] | 55 | } |
| 56 | |
Armando Montanez | ceb66f5 | 2020-06-04 12:56:38 -0700 | [diff] [blame] | 57 | pw_test("assert_backend_compile_test") { |
| 58 | enable_if = dir_pw_assert_backend != "" |
| 59 | deps = [ |
| 60 | ":pw_assert", |
| 61 | dir_pw_assert_backend, |
Keir Mierle | 0fa7f7d | 2020-05-07 12:34:00 -0700 | [diff] [blame] | 62 | dir_pw_status, |
Armando Montanez | ceb66f5 | 2020-06-04 12:56:38 -0700 | [diff] [blame] | 63 | ] |
| 64 | sources = [ |
| 65 | "assert_backend_compile_test.c", |
| 66 | "assert_backend_compile_test.cc", |
| 67 | ] |
Keir Mierle | 3cee879 | 2020-01-22 17:08:13 -0800 | [diff] [blame] | 68 | } |
| 69 | |
| 70 | pw_doc_group("docs") { |
Rob Mohr | a0ba54f | 2020-02-27 11:43:49 -0800 | [diff] [blame] | 71 | sources = [ "docs.rst" ] |
Keir Mierle | 3cee879 | 2020-01-22 17:08:13 -0800 | [diff] [blame] | 72 | } |