blob: 63b61b6db132684b3bd7a57f9fbabf7d82adab87 [file] [log] [blame]
Keir Mierle3cee8792020-01-22 17:08:13 -08001# 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
15import("$dir_pw_build/facade.gni")
16import("$dir_pw_docgen/docs.gni")
17import("$dir_pw_unit_test/test.gni")
18
19config("default_config") {
20 include_dirs = [ "public" ]
21}
22
23pw_facade("pw_assert") {
24 backend = dir_pw_assert_backend
25 public_configs = [ ":default_config" ]
Keir Mierled1211ed2020-04-03 13:20:46 -070026 public = [
27 "public/pw_assert/assert.h",
28 "public/pw_assert/internal/assert_impl.h",
29 ]
Rob Mohra0ba54f2020-02-27 11:43:49 -080030 public_deps = [ dir_pw_preprocessor ]
Keir Mierle3cee8792020-01-22 17:08:13 -080031}
32
33pw_test_group("tests") {
Armando Montanezceb66f52020-06-04 12:56:38 -070034 tests = [
35 ":assert_backend_compile_test",
36 ":assert_facade_test",
37 ]
Keir Mierle3cee8792020-01-22 17:08:13 -080038}
39
Keir Mierle8d2a84f2020-04-14 22:00:00 -070040# 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.
43pw_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 Mierle0fa7f7d2020-05-07 12:34:00 -070051 deps = [ dir_pw_status ]
Keir Mierle8d2a84f2020-04-14 22:00:00 -070052}
53
Armando Montanezceb66f52020-06-04 12:56:38 -070054pw_test("assert_backend_compile_test") {
55 enable_if = dir_pw_assert_backend != ""
56 deps = [
57 ":pw_assert",
58 dir_pw_assert_backend,
Keir Mierle0fa7f7d2020-05-07 12:34:00 -070059 dir_pw_status,
Armando Montanezceb66f52020-06-04 12:56:38 -070060 ]
61 sources = [
62 "assert_backend_compile_test.c",
63 "assert_backend_compile_test.cc",
64 ]
Keir Mierle3cee8792020-01-22 17:08:13 -080065}
66
67pw_doc_group("docs") {
Rob Mohra0ba54f2020-02-27 11:43:49 -080068 sources = [ "docs.rst" ]
Keir Mierle3cee8792020-01-22 17:08:13 -080069}