blob: 092c863d4a7dd479e87fc34a8dd0515ff08fea59 [file] [log] [blame]
# Copyright 2020 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.
# Comment this import to prevent it from being reordered.
import("//build_overrides/pigweed.gni")
import("$dir_pw_arduino_build/arduino.gni")
import("$dir_pw_build/target_types.gni")
import("$dir_pw_unit_test/test.gni")
config("default_config") {
include_dirs = [ "public" ]
}
pw_source_set("teensy_flash") {
public_configs = [ ":default_config" ]
public = [ "public/teensy_flash/teensy_flash.h" ]
deps = [
"$dir_pw_kvs",
"$dir_pw_log",
]
sources = [ "teensy_flash.cc" ]
public_deps = [ "$dir_pw_kvs" ]
}
pw_source_set("teensy_flash_test_partition") {
public_configs = [ ":default_config" ]
deps = [ ":teensy_flash" ]
sources = [ "teensy_flash_test_partition.cc" ]
public_deps = [ "$dir_pw_kvs:flash_test_partition" ]
}
pw_source_set("teensy_flash_test_kvs") {
public_configs = [ ":default_config" ]
deps = [
":teensy_flash_test_partition",
"$dir_pw_kvs",
"$dir_pw_kvs:crc16",
]
sources = [ "teensy_flash_test_key_value_store.cc" ]
public_deps = [ "$dir_pw_kvs:test_key_value_store" ]
}
# Example of a single test. Normally modules have multiple tests, each declared
# with `pw_test`.
pw_test("teensy_flash_test") {
deps = [
":teensy_flash_test_partition",
"$dir_pw_kvs:flash_partition_test_2_iterations",
]
}
pw_test("teensy_kvs_test") {
deps = [
":teensy_flash_test_kvs",
"$dir_pw_kvs:key_value_store_initialized_test",
]
}
# Each module should have its own test group, composed of the different targets
# declared with `pw_test`.
pw_test_group("tests") {
tests = [
":teensy_flash_test",
":teensy_kvs_test",
]
enable_if = pw_build_EXECUTABLE_TARGET_TYPE == "arduino_executable" &&
(pw_arduino_build_BOARD == "teensy40" ||
pw_arduino_build_BOARD == "teensy41")
}