blob: 48da2f3dd90d926f2ce231acd1cbea1898b81781 [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") {
Keir Mierle8d2a84f2020-04-14 22:00:00 -070034 tests = [ ":assert_facade_test" ]
Keir Mierle3cee8792020-01-22 17:08:13 -080035 if (dir_pw_assert_backend != "") {
Keir Mierle8d2a84f2020-04-14 22:00:00 -070036 tests += [ ":assert_backend_compile_test" ]
Keir Mierle3cee8792020-01-22 17:08:13 -080037 }
38}
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 ]
51}
52
Keir Mierle3cee8792020-01-22 17:08:13 -080053if (dir_pw_assert_backend != "") {
Keir Mierle8d2a84f2020-04-14 22:00:00 -070054 pw_test("assert_backend_compile_test") {
Keir Mierle3cee8792020-01-22 17:08:13 -080055 deps = [
56 ":pw_assert",
57 dir_pw_assert_backend,
58 ]
Keir Mierle3cee8792020-01-22 17:08:13 -080059 sources = [
Keir Mierle8d2a84f2020-04-14 22:00:00 -070060 "assert_backend_compile_test.c",
61 "assert_backend_compile_test.cc",
Keir Mierle3cee8792020-01-22 17:08:13 -080062 ]
63 }
64}
65
66pw_doc_group("docs") {
Rob Mohra0ba54f2020-02-27 11:43:49 -080067 sources = [ "docs.rst" ]
Keir Mierle3cee8792020-01-22 17:08:13 -080068}