blob: 5184919994efb948aad3944db09881db61db473a [file] [log] [blame]
# Copyright 2019 The Pigweed Authors
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.
# gn-format disable
import("//build_overrides/pigweed.gni")
import("$dir_pw_build/target_types.gni")
import("$dir_pw_docgen/docs.gni")
import("$dir_pw_unit_test/test.gni")
config("default_config") {
include_dirs = [
"public",
"public_overrides",
]
}
# pw_unit_test core library.
pw_source_set("pw_unit_test") {
public_configs = [ ":default_config" ]
public_deps = [
"$dir_pw_polyfill",
"$dir_pw_preprocessor",
"$dir_pw_string",
]
public = [
"public/pw_unit_test/event_handler.h",
"public/pw_unit_test/framework.h",
"public_overrides/gtest/gtest.h",
]
sources = [ "framework.cc" ] + public
}
# Library providing an event handler which outputs human-readable text.
pw_source_set("simple_printing_event_handler") {
public_deps = [
":pw_unit_test",
"$dir_pw_preprocessor",
]
public = [ "public/pw_unit_test/simple_printing_event_handler.h" ]
sources = [ "simple_printing_event_handler.cc" ] + public
}
# Library providing a standard desktop main function for the pw_unit_test
# framework. Unit test files can link against this library to build runnable
# unit test executables.
pw_source_set("simple_printing_main") {
public_deps = [ ":pw_unit_test" ]
deps = [
":simple_printing_event_handler",
"$dir_pw_sys_io",
]
sources = [ "simple_printing_main.cc" ]
}
pw_doc_group("docs") {
sources = [ "docs.rst" ]
}
# Library providing an event handler which logs using pw_log.
pw_source_set("logging_event_handler") {
public_deps = [
":pw_unit_test",
"$dir_pw_log",
"$dir_pw_preprocessor",
]
public = [ "public/pw_unit_test/logging_event_handler.h" ]
sources = [ "logging_event_handler.cc" ] + public
}
pw_source_set("logging_main") {
public_deps = [ ":pw_unit_test" ]
deps = [
":logging_event_handler",
"$dir_pw_sys_io",
]
sources = [ "logging_main.cc" ]
}
pw_test("framework_test") {
sources = [ "framework_test.cc" ]
}
pw_test_group("tests") {
tests = [ ":framework_test" ]
}