1# Copyright 2024 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 15import("//build_overrides/pigweed.gni") 16 17import("$dir_pw_docgen/docs.gni") 18import("$dir_pw_sensor/sensor.gni") 19import("$dir_pw_unit_test/test.gni") 20 21config("default_config") { 22 include_dirs = [ "public" ] 23} 24 25pw_source_set("pw_sensor_types") { 26 public = [ "public/pw_sensor/types.h" ] 27 public_configs = [ ":default_config" ] 28} 29 30pw_sensor_library("test_constants_lib") { 31 out_header = "pw_sensor/generated/sensor_constants.h" 32 sources = [ 33 "test_sensor1.yaml", 34 "test_sensor2.yaml", 35 ] 36 inputs = [ 37 "attributes.yaml", 38 "channels.yaml", 39 "triggers.yaml", 40 "units.yaml", 41 ] 42 generator_includes = [ getenv("PW_ROOT") ] 43 public_deps = [ 44 ":pw_sensor_types", 45 "$dir_pw_containers:flat_map", 46 "$dir_pw_tokenizer:pw_tokenizer", 47 ] 48} 49 50pw_test("constants_test") { 51 deps = [ ":test_constants_lib" ] 52 sources = [ 53 "attributes_test.cc", 54 "channels_test.cc", 55 "triggers_test.cc", 56 "units_test.cc", 57 ] 58} 59 60pw_test_group("tests") { 61 tests = [ ":constants_test" ] 62} 63 64pw_doc_group("docs") { 65 sources = [ "docs.rst" ] 66 group_deps = [ "py:docs" ] 67} 68