2022-10-10 18:20:10 +00:00
|
|
|
# Copyright 2022 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("//build_overrides/pigweed.gni")
|
|
|
|
|
2022-10-20 21:24:39 +00:00
|
|
|
import("$dir_pw_build/facade.gni")
|
2022-10-10 18:20:10 +00:00
|
|
|
import("$dir_pw_build/target_types.gni")
|
2022-10-20 21:24:39 +00:00
|
|
|
import("$dir_pw_chrono/backend.gni")
|
2022-10-10 18:20:10 +00:00
|
|
|
import("$dir_pw_docgen/docs.gni")
|
2022-10-20 21:24:39 +00:00
|
|
|
import("$dir_pw_perf_test/backend.gni")
|
2022-10-10 18:20:10 +00:00
|
|
|
import("$dir_pw_unit_test/test.gni")
|
|
|
|
|
|
|
|
config("public_include_path") {
|
2022-10-20 21:24:39 +00:00
|
|
|
include_dirs = [
|
|
|
|
"public",
|
|
|
|
"chrono_public_overrides",
|
|
|
|
]
|
2022-10-10 18:20:10 +00:00
|
|
|
visibility = [ ":*" ]
|
|
|
|
}
|
|
|
|
|
|
|
|
pw_test_group("tests") {
|
2022-10-20 21:24:39 +00:00
|
|
|
tests = [
|
|
|
|
":perf_test_test",
|
|
|
|
":timer_facade_test",
|
|
|
|
":chrono_timer_test",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
pw_source_set("duration_unit") {
|
|
|
|
public = [ "public/pw_perf_test/internal/duration_unit.h" ]
|
|
|
|
public_configs = [ ":public_include_path" ]
|
|
|
|
visibility = [ ":*" ]
|
|
|
|
}
|
|
|
|
|
|
|
|
pw_facade("timer_interface") {
|
|
|
|
backend = pw_perf_test_TIMER_INTERFACE_BACKEND
|
|
|
|
public = [ "public/pw_perf_test/internal/timer.h" ]
|
|
|
|
public_deps = [ ":duration_unit" ]
|
|
|
|
visibility = [ ":*" ]
|
2022-10-10 18:20:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
pw_source_set("pw_perf_test") {
|
|
|
|
public_configs = [ ":public_include_path" ]
|
|
|
|
public = [ "public/pw_perf_test/perf_test.h" ]
|
2022-10-20 21:24:39 +00:00
|
|
|
public_deps = [ ":timer_interface" ]
|
2022-10-10 18:20:10 +00:00
|
|
|
sources = [ "perf_test.cc" ]
|
|
|
|
}
|
|
|
|
|
|
|
|
pw_test("perf_test_test") {
|
2022-10-20 21:24:39 +00:00
|
|
|
enable_if = pw_perf_test_TIMER_INTERFACE_BACKEND != ""
|
2022-10-10 18:20:10 +00:00
|
|
|
sources = [ "perf_test_test.cc" ]
|
|
|
|
deps = [ ":pw_perf_test" ]
|
|
|
|
}
|
|
|
|
|
2022-10-20 21:24:39 +00:00
|
|
|
pw_test("timer_facade_test") {
|
|
|
|
enable_if = pw_perf_test_TIMER_INTERFACE_BACKEND != ""
|
|
|
|
sources = [ "timer_test.cc" ]
|
|
|
|
public_deps = [ ":timer_interface" ]
|
|
|
|
}
|
|
|
|
|
|
|
|
pw_test("chrono_timer_test") {
|
|
|
|
enable_if = pw_chrono_SYSTEM_CLOCK_BACKEND != ""
|
|
|
|
sources = [ "chrono_test.cc" ]
|
|
|
|
public_deps = [
|
|
|
|
":timer_interface",
|
|
|
|
"$dir_pw_chrono:system_timer",
|
|
|
|
"$dir_pw_thread:sleep",
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
2022-10-10 18:20:10 +00:00
|
|
|
pw_doc_group("docs") {
|
|
|
|
sources = [ "docs.rst" ]
|
|
|
|
}
|
2022-10-20 21:24:39 +00:00
|
|
|
|
|
|
|
# Chrono Implementation
|
|
|
|
pw_source_set("pw_perf_test_chrono") {
|
|
|
|
public_configs = [ ":public_overrides_include_path" ]
|
|
|
|
public = [ "chrono_public_overrides/pw_perf_test_timer_backend/timer.h" ]
|
|
|
|
public_deps = [ ":chrono_timer" ]
|
|
|
|
}
|
|
|
|
|
|
|
|
pw_source_set("chrono_timer") {
|
|
|
|
public_configs = [ ":public_include_path" ]
|
|
|
|
public = [ "public/pw_perf_test/internal/chrono_timer_interface.h" ]
|
|
|
|
public_deps = [
|
|
|
|
":duration_unit",
|
|
|
|
"$dir_pw_chrono:system_clock",
|
|
|
|
]
|
|
|
|
visibility = [ ":*" ]
|
|
|
|
}
|