• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
15include($ENV{PW_ROOT}/pw_build/pigweed.cmake)
16
17pw_add_module_config(pw_unit_test_CONFIG)
18
19pw_add_library(pw_unit_test.config INTERFACE
20  HEADERS
21    public/pw_unit_test/config.h
22  PUBLIC_INCLUDES
23    public
24  PUBLIC_DEPS
25    ${pw_unit_test_CONFIG}
26    pw_polyfill
27)
28
29add_library(pw_unit_test INTERFACE)
30target_link_libraries(pw_unit_test
31  INTERFACE
32    "${pw_unit_test_GOOGLETEST_BACKEND}"
33)
34
35pw_add_library(pw_unit_test.light STATIC
36  SOURCES
37    framework.cc
38  PUBLIC_DEPS
39    pw_polyfill
40    pw_preprocessor
41    pw_string
42    pw_unit_test.config
43  PUBLIC_INCLUDES
44    public_overrides  # pw_unit_test overrides the gtest/gtest.h header.
45)
46
47pw_add_library(pw_unit_test.static_library_support STATIC
48  HEADERS
49    public/pw_unit_test/static_library_support.h
50  PUBLIC_INCLUDES
51    public
52  SOURCES
53    static_library_support.cc
54  PUBLIC_DEPS
55    pw_unit_test.light
56)
57
58pw_add_library(pw_unit_test.event_handler INTERFACE
59  HEADERS
60    public/pw_unit_test/event_handler.h
61  PUBLIC_INCLUDES
62    public
63)
64
65pw_add_library(pw_unit_test.googletest_style_event_handler STATIC
66  HEADERS
67    public/pw_unit_test/googletest_style_event_handler.h
68  PUBLIC_INCLUDES
69    public
70  PUBLIC_DEPS
71    pw_unit_test.event_handler
72    pw_preprocessor
73  SOURCES
74    googletest_style_event_handler.cc
75)
76
77pw_add_library(pw_unit_test.simple_printing_main STATIC
78  SOURCES
79    simple_printing_main.cc
80    simple_printing_event_handler.cc
81  PRIVATE_DEPS
82    pw_unit_test
83    pw_unit_test.googletest_style_event_handler
84    pw_preprocessor
85    pw_string
86    pw_sys_io
87)
88
89pw_add_library(pw_unit_test.logging_event_handler STATIC
90  HEADERS
91    public/pw_unit_test/logging_event_handler.h
92  PUBLIC_INCLUDES
93    public
94  PUBLIC_DEPS
95    pw_log
96    pw_unit_test.googletest_style_event_handler
97  SOURCES
98    logging_event_handler.cc
99)
100
101pw_add_library(pw_unit_test.logging_main STATIC
102  SOURCES
103    logging_main.cc
104  PRIVATE_DEPS
105    pw_unit_test.logging_event_handler
106    pw_unit_test
107)
108