blob: e4eb1d05c93b5abf098b24bc0110a3852e10f7c9 [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.
import("$dir_pw_build/pw_executable.gni")
import("$dir_pw_unit_test/test.gni")
config("default_config") {
include_dirs = [
"public",
"public_overrides",
]
}
# pw_unit_test core library.
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.
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.
source_set("simple_printing_main") {
public_deps = [
":pw_unit_test",
]
deps = [
":simple_printing_event_handler",
"$dir_pw_dumb_io",
]
sources = [
"simple_printing_main.cc",
]
}
# Library providing an event handler which logs using pw_log.
if (dir_pw_log_backend != "") {
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
}
source_set("logging_main") {
public_deps = [
":pw_unit_test",
]
deps = [
":logging_event_handler",
"$dir_pw_dumb_io",
]
sources = [
"logging_main.cc",
]
}
}
pw_test("framework_test") {
sources = [
"framework_test.cc",
]
}
pw_test_group("tests") {
tests = [ ":framework_test" ]
}