blob: db3c184361e0251698ea71adaea3013ddd2542fd [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
Armando Montanezfb3d3fb2020-06-09 18:12:12 -070015# gn-format disable
16import("//build_overrides/pigweed.gni")
17
18import("$dir_pigweed/legacy_target.gni")
Keir Mierle3cee8792020-01-22 17:08:13 -080019import("$dir_pw_build/facade.gni")
20import("$dir_pw_docgen/docs.gni")
21import("$dir_pw_unit_test/test.gni")
Keir Mierle3cee8792020-01-22 17:08:13 -080022config("default_config") {
23 include_dirs = [ "public" ]
24}
25
26pw_facade("pw_assert") {
27 backend = dir_pw_assert_backend
28 public_configs = [ ":default_config" ]
Keir Mierled1211ed2020-04-03 13:20:46 -070029 public = [
30 "public/pw_assert/assert.h",
31 "public/pw_assert/internal/assert_impl.h",
32 ]
Rob Mohra0ba54f2020-02-27 11:43:49 -080033 public_deps = [ dir_pw_preprocessor ]
Keir Mierle3cee8792020-01-22 17:08:13 -080034}
35
36pw_test_group("tests") {
Armando Montanezceb66f52020-06-04 12:56:38 -070037 tests = [
38 ":assert_backend_compile_test",
39 ":assert_facade_test",
40 ]
Keir Mierle3cee8792020-01-22 17:08:13 -080041}
42
Keir Mierle8d2a84f2020-04-14 22:00:00 -070043# The assert facade test doesn't require a backend since a fake one is
44# provided. However, since this doesn't depend on the backend it re-includes
45# the facade headers.
46pw_test("assert_facade_test") {
47 configs = [ ":default_config" ] # For internal/assert_impl.h
48 sources = [
49 "assert_facade_test.cc",
50 "fake_backend.cc",
51 "public/pw_assert/internal/assert_impl.h",
52 "pw_assert_test/fake_backend.h",
53 ]
Keir Mierle0fa7f7d2020-05-07 12:34:00 -070054 deps = [ dir_pw_status ]
Alexei Frolov844ff0f2020-05-06 12:15:29 -070055
56 # TODO(frolv): Fix this test on the QEMU target.
57 enable_if = pw_executable_config.target_type != "lm3s6965evb_executable"
Keir Mierle8d2a84f2020-04-14 22:00:00 -070058}
59
Armando Montanezceb66f52020-06-04 12:56:38 -070060pw_test("assert_backend_compile_test") {
61 enable_if = dir_pw_assert_backend != ""
62 deps = [
63 ":pw_assert",
64 dir_pw_assert_backend,
Keir Mierle0fa7f7d2020-05-07 12:34:00 -070065 dir_pw_status,
Armando Montanezceb66f52020-06-04 12:56:38 -070066 ]
67 sources = [
68 "assert_backend_compile_test.c",
69 "assert_backend_compile_test.cc",
70 ]
Keir Mierle3cee8792020-01-22 17:08:13 -080071}
72
73pw_doc_group("docs") {
Rob Mohra0ba54f2020-02-27 11:43:49 -080074 sources = [ "docs.rst" ]
Keir Mierle3cee8792020-01-22 17:08:13 -080075}