blob: 3bb1929bb918d3387a95799324812d5eb0739c34 [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/components.gni")
import("//build/test.gni")
group("tests") {
testonly = true
deps = [
":stdcompat-polyfills-no-inline-variables-unit-test($host_toolchain)",
":stdcompat-polyfills-unit-test($host_toolchain)",
":stdcompat-tests",
":stdcompat-unit-test($host_toolchain)",
]
}
stdcompat_test_sources = [
"algorithm_test.cc",
"array_test.cc",
"atomic_test.cc",
"bit_test.cc",
"constructors_internal_test.cc",
"cstddef_test.cc",
"functional_test.cc",
"iterator_test.cc",
"memory_test.cc",
"optional_test.cc",
"source_location_test.cc",
"span_test.cc",
"string_view_test.cc",
"traits_test.cc",
"tuple_test.cc",
"utility_internal_test.cc",
"utility_test.cc",
"variant_test.cc",
"vector_test.cc",
"version_test.cc",
]
group("stdcompat-test-deps") {
testonly = true
visibility = [ ":*" ]
public_deps = [
"//sdk/lib/stdcompat",
"//src/lib/fxl/test:gtest_main",
"//third_party/googletest:gmock",
"//third_party/googletest:gtest",
]
}
# This target will be forced to compile using stdcompat provided polyfills and no inline variables.
test("stdcompat-polyfills-no-inline-variables-unit-test") {
sources = stdcompat_test_sources
deps = [ ":stdcompat-test-deps" ]
configs += [
":stdcompat-select-polyfills",
":stdcompat-no-inline-variables",
]
}
# 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
manifest = "meta/stdcompat-test.cml"
deps = [ ":stdcompat-unit-test" ]
}
fuchsia_component("stdcompat-polyfills-test") {
testonly = true
manifest = "meta/stdcompat-polyfills-test.cml"
deps = [ ":stdcompat-polyfills-unit-test" ]
}
fuchsia_component("stdcompat-polyfills-no-inline-variables-test") {
testonly = true
manifest = "meta/stdcompat-polyfills-no-inline-variables-test.cml"
deps = [ ":stdcompat-polyfills-no-inline-variables-unit-test" ]
}
fuchsia_test_package("stdcompat-tests") {
test_components = [
":stdcompat-test",
":stdcompat-polyfills-test",
":stdcompat-polyfills-no-inline-variables-test",
]
}
config("stdcompat-select-polyfills") {
visibility = [ ":*" ]
defines = [ "LIB_STDCOMPAT_USE_POLYFILLS" ]
}
config("stdcompat-no-inline-variables") {
visibility = [ ":*" ]
defines = [ "LIB_STDCOMPAT_NO_INLINE_VARIABLES" ]
}