blob: 9e1d94143cbe434ca1e023be4d37370eda1327f7 [file] [log] [blame]
# Copyright 2020 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/test.gni")
import("//src/sys/build/fuchsia_component.gni")
import("//src/sys/build/fuchsia_test_package.gni")
group("tests") {
testonly = true
deps = [
":stdcompat-polyfills-unit-test($host_toolchain)",
":stdcompat-tests",
":stdcompat-unit-test($host_toolchain)",
]
}
stdcompat_test_sources = [
"constructors_internal_test.cc",
"traits_test.cc",
"utility_internal_test.cc",
"utility_test.cc",
"version_test.cc",
]
group("stdcompat-test-deps") {
testonly = true
visibility = [ ":*" ]
public_deps = [
"//src/lib/fxl/test:gtest_main",
"//third_party/googletest:gmock",
"//third_party/googletest:gtest",
"//zircon/system/ulib/stdcompat",
]
}
# This target will be forced to compile using stdcompat provided polyfills.
test("stdcompat-polyfills-unit-test") {
sources = stdcompat_test_sources
deps = [ ":stdcompat-test-deps" ]
configs += [ ":stdcompat-select-polyfills" ]
}
# This target will let the feature-test macro pick std implementation if available.
test("stdcompat-unit-test") {
sources = stdcompat_test_sources
deps = [ ":stdcompat-test-deps" ]
}
fuchsia_component("stdcompat-test") {
testonly = true
component_name = "stdcompat-test"
manifest = "meta/stdcompat-test.cml"
deps = [ ":stdcompat-unit-test" ]
}
fuchsia_component("stdcompat-polyfills-test") {
testonly = true
component_name = "stdcompat-polyfills-test"
manifest = "meta/stdcompat-polyfills-test.cml"
deps = [ ":stdcompat-polyfills-unit-test" ]
}
fuchsia_test_package("stdcompat-tests") {
test_components = [
":stdcompat-test",
":stdcompat-polyfills-test",
]
}
config("stdcompat-select-polyfills") {
visibility = [ ":*" ]
defines = [ "LIB_STDCOMPAT_USE_POLYFILLS" ]
}